Chromium Code Reviews| Index: blimp/net/exact_match_cert_verifier.h |
| diff --git a/blimp/net/exact_match_cert_verifier.h b/blimp/net/exact_match_cert_verifier.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..50b0f53ca3270ed71db32ede051ffacd93cbf718 |
| --- /dev/null |
| +++ b/blimp/net/exact_match_cert_verifier.h |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BLIMP_NET_EXACT_MATCH_CERT_VERIFIER_H_ |
| +#define BLIMP_NET_EXACT_MATCH_CERT_VERIFIER_H_ |
| + |
| +#include <string> |
| + |
| +#include "blimp/net/blimp_net_export.h" |
| +#include "net/cert/cert_verifier.h" |
| + |
| +namespace blimp { |
| + |
| +// Checks if the peer certificate is an exact match to the X509 certificate |
|
Ryan Sleevi
2016/02/23 21:01:31
s/X509/X.509/
Kevin M
2016/02/24 00:31:42
Done.
|
| +// supplied out-of-band by the Blimp Assigner. |
|
Ryan Sleevi
2016/02/23 21:01:31
This seems overly specific documentation, but perh
Kevin M
2016/02/24 00:31:42
Done.
|
| +// Rejects all certificates other than the |engine_cert| specified at |
| +// construction time. |
| +class BLIMP_NET_EXPORT ExactMatchCertVerifier : public net::CertVerifier { |
| + public: |
| + // |engine_cert|: The one allowable certificate. |
| + explicit ExactMatchCertVerifier( |
| + scoped_refptr<net::X509Certificate> engine_cert); |
| + |
| + ~ExactMatchCertVerifier() override; |
| + |
| + // net::CertVerifier implementation. |
| + int Verify(net::X509Certificate* cert, |
| + const std::string& hostname, |
| + const std::string& ocsp_response, |
| + int flags, |
| + net::CRLSet* crl_set, |
| + net::CertVerifyResult* verify_result, |
| + const net::CompletionCallback& callback, |
| + scoped_ptr<Request>* out_req, |
| + const net::BoundNetLog& net_log) override; |
| + |
| + private: |
| + scoped_refptr<net::X509Certificate> engine_cert_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ExactMatchCertVerifier); |
| +}; |
| + |
| +} // namespace blimp |
| + |
| +#endif // BLIMP_NET_EXACT_MATCH_CERT_VERIFIER_H_ |