OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "crypto/ec_private_key.h" | 6 #include "crypto/ec_private_key.h" |
7 #include "net/base/x509_util.h" | 7 #include "net/base/x509_util.h" |
8 #include "net/base/x509_util_openssl.h" | 8 #include "net/base/x509_util_openssl.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
11 namespace net { | 11 namespace net { |
12 | 12 |
13 // For OpenSSL, x509_util::CreateOriginBoundCertEC() is not yet implemented | 13 // For OpenSSL, x509_util::CreateDomainBoundCertEC() is not yet implemented |
14 // and should return false. This unit test ensures that a stub implementation | 14 // and should return false. This unit test ensures that a stub implementation |
15 // is present. | 15 // is present. |
16 TEST(X509UtilOpenSSLTest, CreateOriginBoundCertNotImplemented) { | 16 TEST(X509UtilOpenSSLTest, CreateDomainBoundCertNotImplemented) { |
17 std::string origin = "http://weborigin.com:443"; | 17 std::string domain = "weborigin.com"; |
18 base::Time now = base::Time::Now(); | 18 base::Time now = base::Time::Now(); |
19 scoped_ptr<crypto::ECPrivateKey> private_key( | 19 scoped_ptr<crypto::ECPrivateKey> private_key( |
20 crypto::ECPrivateKey::Create()); | 20 crypto::ECPrivateKey::Create()); |
21 std::string der_cert; | 21 std::string der_cert; |
22 EXPECT_FALSE(x509_util::CreateOriginBoundCertEC( | 22 EXPECT_FALSE(x509_util::CreateDomainBoundCertEC( |
23 private_key.get(), | 23 private_key.get(), |
24 origin, 1, | 24 domain, 1, |
25 now, | 25 now, |
26 now + base::TimeDelta::FromDays(1), | 26 now + base::TimeDelta::FromDays(1), |
27 &der_cert)); | 27 &der_cert)); |
28 EXPECT_TRUE(der_cert.empty()); | 28 EXPECT_TRUE(der_cert.empty()); |
29 | 29 |
30 } | 30 } |
31 | 31 |
32 } // namespace net | 32 } // namespace net |
OLD | NEW |