OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_QUIC_CRYPTO_PROOF_VERIFIER_OPENSSL_H_ |
| 6 #define NET_QUIC_CRYPTO_PROOF_VERIFIER_OPENSSL_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" |
| 13 #include "net/base/net_export.h" |
| 14 #include "net/quic/crypto/proof_verifier.h" |
| 15 |
| 16 struct x509_store_st; |
| 17 typedef struct x509_store_st X509_STORE; |
| 18 struct x509_st; |
| 19 typedef struct x509_st X509; |
| 20 |
| 21 namespace net { |
| 22 |
| 23 // ProofVerifierOpenSSL implements the QUIC ProofVerifier interface using |
| 24 // OpenSSL. |
| 25 class NET_EXPORT_PRIVATE ProofVerifierOpenSSL : public ProofVerifier { |
| 26 public: |
| 27 explicit ProofVerifierOpenSSL(const std::string& root_ca_filename); |
| 28 virtual ~ProofVerifierOpenSSL(); |
| 29 |
| 30 // ProofVerifier interface |
| 31 virtual bool VerifyProof(const std::string& hostname, |
| 32 const std::string& server_config, |
| 33 const std::vector<std::string>& certs, |
| 34 const std::string& signature, |
| 35 std::string* error_details) const OVERRIDE; |
| 36 |
| 37 private: |
| 38 X509* VerifyChain(const std::vector<std::string>& certs) const; |
| 39 static bool VerifySignature(const std::string& signed_data, |
| 40 const std::string& signature, |
| 41 X509* cert); |
| 42 static bool VerifyLeafForHost(X509* cert, const std::string& hostname); |
| 43 |
| 44 X509_STORE* store_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(ProofVerifierOpenSSL); |
| 47 }; |
| 48 |
| 49 } // namespace net |
| 50 |
| 51 #endif // NET_QUIC_CRYPTO_PROOF_VERIFIER_OPENSSL_H_ |
OLD | NEW |