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

Unified Diff: net/base/x509_util_openssl_unittest.cc

Issue 8296014: Use NSS to generate Origin-Bound Certs on Win and Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review changes Created 9 years, 2 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: net/base/x509_util_openssl_unittest.cc
diff --git a/net/base/x509_util_openssl_unittest.cc b/net/base/x509_util_openssl_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0647a6297d0a10bf84ee689611fa79822f165b10
--- /dev/null
+++ b/net/base/x509_util_openssl_unittest.cc
@@ -0,0 +1,29 @@
+// Copyright (c) 2011 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.
+
+#include "base/memory/scoped_ptr.h"
+#include "crypto/rsa_private_key.h"
+#include "net/base/x509_util.h"
+#include "net/base/x509_util_openssl.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace net {
+
+// For OpenSSL, x509_util::CreateOriginBoundCert() is not yet implemented
+// and should return false. This unit test ensures that a stub implementation
+// is present.
+TEST(X509UtilOpenSSLTest, CreateOriginBoundCertNotImplemented) {
+ std::string origin = "http://weborigin.com:443";
+ scoped_ptr<crypto::RSAPrivateKey> private_key(
+ crypto::RSAPrivateKey::Create(1024));
+ std::string der_cert;
+ EXPECT_FALSE(x509_util::CreateOriginBoundCert(private_key.get(),
+ origin, 1,
+ base::TimeDelta::FromDays(1),
+ &der_cert));
+ EXPECT_TRUE(der_cert.empty());
+
+}
+
+} // namespace net
« net/base/net_error_list.h ('K') | « net/base/x509_util_openssl.cc ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698