Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1296)

Unified Diff: blimp/net/blimp_cert_verifier.h

Issue 1696563002: Blimp: add support for SSL connections. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: blimp/net/blimp_cert_verifier.h
diff --git a/blimp/net/blimp_cert_verifier.h b/blimp/net/blimp_cert_verifier.h
new file mode 100644
index 0000000000000000000000000000000000000000..2c60a4d1bc1cd981b07085f9d8b74e306db0391f
--- /dev/null
+++ b/blimp/net/blimp_cert_verifier.h
@@ -0,0 +1,44 @@
+// 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_BLIMP_CERT_VERIFIER_H_
+#define BLIMP_NET_BLIMP_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
+// supplied out-of-band by the Blimp Assigner.
+// Rejects all other certificates.
Wez 2016/02/12 02:31:14 Suggest: "Rejects all certificates other than the
Kevin M 2016/02/13 00:44:18 Done.
+class BLIMP_NET_EXPORT BlimpCertVerifier : public net::CertVerifier {
Wez 2016/02/12 21:42:38 Is there anything actually Blimp specific about th
Kevin M 2016/02/13 00:44:18 Done.
+ public:
+ // |assigned_cert|: The one allowable certificate.
+ explicit BlimpCertVerifier(scoped_refptr<net::X509Certificate> assigned_cert);
+
+ ~BlimpCertVerifier() override;
+
+ // net::CertVerifier implementation.
+ int Verify(net::X509Certificate* cert,
+ const std::string&,
+ const std::string&,
+ int,
+ net::CRLSet*,
+ net::CertVerifyResult* verify_result,
+ const net::CompletionCallback&,
+ scoped_ptr<net::CertVerifier::Request>*,
+ const net::BoundNetLog&) override;
+
+ private:
+ scoped_refptr<net::X509Certificate> assigned_cert_;
+
+ DISALLOW_COPY_AND_ASSIGN(BlimpCertVerifier);
+};
+
+} // namespace blimp
+
+#endif // BLIMP_NET_BLIMP_CERT_VERIFIER_H_

Powered by Google App Engine
This is Rietveld 408576698