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

Side by Side Diff: crypto/ec_private_key_unittest.cc

Issue 1739403002: Cut down on usage of deprecated APIs in //crypto. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « crypto/ec_private_key_openssl.cc ('k') | crypto/ec_signature_creator_openssl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "crypto/ec_private_key.h" 5 #include "crypto/ec_private_key.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 // Generate random private keys. Export, then re-import. We should get 15 // Generate random private keys. Export, then re-import. We should get
16 // back the same exact public key, and the private key should have the same 16 // back the same exact public key, and the private key should have the same
17 // value and elliptic curve params. 17 // value and elliptic curve params.
18 TEST(ECPrivateKeyUnitTest, InitRandomTest) { 18 TEST(ECPrivateKeyUnitTest, InitRandomTest) {
19 const std::string password1; 19 const std::string password1;
20 const std::string password2 = "test"; 20 const std::string password2 = "test";
21 21
22 scoped_ptr<crypto::ECPrivateKey> keypair1(crypto::ECPrivateKey::Create()); 22 scoped_ptr<crypto::ECPrivateKey> keypair1(crypto::ECPrivateKey::Create());
23 scoped_ptr<crypto::ECPrivateKey> keypair2(crypto::ECPrivateKey::Create()); 23 scoped_ptr<crypto::ECPrivateKey> keypair2(crypto::ECPrivateKey::Create());
24 ASSERT_TRUE(keypair1.get()); 24 ASSERT_TRUE(keypair1.get());
25 ASSERT_TRUE(keypair2.get()); 25 ASSERT_TRUE(keypair2.get());
26 26
27 std::vector<uint8_t> key1value; 27 std::vector<uint8_t> key1value;
28 std::vector<uint8_t> key2value; 28 std::vector<uint8_t> key2value;
29 std::vector<uint8_t> key1params; 29 EXPECT_TRUE(keypair1->ExportValueForTesting(&key1value));
30 std::vector<uint8_t> key2params; 30 EXPECT_TRUE(keypair2->ExportValueForTesting(&key2value));
31 EXPECT_TRUE(keypair1->ExportValue(&key1value));
32 EXPECT_TRUE(keypair2->ExportValue(&key2value));
33 EXPECT_TRUE(keypair1->ExportECParams(&key1params));
34 EXPECT_TRUE(keypair2->ExportECParams(&key2params));
35 31
36 std::vector<uint8_t> privkey1; 32 std::vector<uint8_t> privkey1;
37 std::vector<uint8_t> privkey2; 33 std::vector<uint8_t> privkey2;
38 std::vector<uint8_t> pubkey1; 34 std::vector<uint8_t> pubkey1;
39 std::vector<uint8_t> pubkey2; 35 std::vector<uint8_t> pubkey2;
40 std::string raw_pubkey1; 36 std::string raw_pubkey1;
41 std::string raw_pubkey2; 37 std::string raw_pubkey2;
42 ASSERT_TRUE(keypair1->ExportEncryptedPrivateKey(password1, 1, &privkey1)); 38 ASSERT_TRUE(keypair1->ExportEncryptedPrivateKey(password1, 1, &privkey1));
43 ASSERT_TRUE(keypair2->ExportEncryptedPrivateKey(password2, 1, &privkey2)); 39 ASSERT_TRUE(keypair2->ExportEncryptedPrivateKey(password2, 1, &privkey2));
44 EXPECT_TRUE(keypair1->ExportPublicKey(&pubkey1)); 40 EXPECT_TRUE(keypair1->ExportPublicKey(&pubkey1));
45 EXPECT_TRUE(keypair2->ExportPublicKey(&pubkey2)); 41 EXPECT_TRUE(keypair2->ExportPublicKey(&pubkey2));
46 EXPECT_TRUE(keypair1->ExportRawPublicKey(&raw_pubkey1)); 42 EXPECT_TRUE(keypair1->ExportRawPublicKey(&raw_pubkey1));
47 EXPECT_TRUE(keypair2->ExportRawPublicKey(&raw_pubkey2)); 43 EXPECT_TRUE(keypair2->ExportRawPublicKey(&raw_pubkey2));
48 44
49 scoped_ptr<crypto::ECPrivateKey> keypair3( 45 scoped_ptr<crypto::ECPrivateKey> keypair3(
50 crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo( 46 crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo(
51 password1, privkey1, pubkey1)); 47 password1, privkey1, pubkey1));
52 scoped_ptr<crypto::ECPrivateKey> keypair4( 48 scoped_ptr<crypto::ECPrivateKey> keypair4(
53 crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo( 49 crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo(
54 password2, privkey2, pubkey2)); 50 password2, privkey2, pubkey2));
55 ASSERT_TRUE(keypair3.get()); 51 ASSERT_TRUE(keypair3.get());
56 ASSERT_TRUE(keypair4.get()); 52 ASSERT_TRUE(keypair4.get());
57 53
58 std::vector<uint8_t> key3value; 54 std::vector<uint8_t> key3value;
59 std::vector<uint8_t> key4value; 55 std::vector<uint8_t> key4value;
60 std::vector<uint8_t> key3params; 56 EXPECT_TRUE(keypair3->ExportValueForTesting(&key3value));
61 std::vector<uint8_t> key4params; 57 EXPECT_TRUE(keypair4->ExportValueForTesting(&key4value));
62 EXPECT_TRUE(keypair3->ExportValue(&key3value));
63 EXPECT_TRUE(keypair4->ExportValue(&key4value));
64 EXPECT_TRUE(keypair3->ExportECParams(&key3params));
65 EXPECT_TRUE(keypair4->ExportECParams(&key4params));
66 58
67 EXPECT_EQ(key1value, key3value); 59 EXPECT_EQ(key1value, key3value);
68 EXPECT_EQ(key2value, key4value); 60 EXPECT_EQ(key2value, key4value);
69 EXPECT_EQ(key1params, key3params);
70 EXPECT_EQ(key2params, key4params);
71 61
72 std::vector<uint8_t> pubkey3; 62 std::vector<uint8_t> pubkey3;
73 std::vector<uint8_t> pubkey4; 63 std::vector<uint8_t> pubkey4;
74 std::string raw_pubkey3; 64 std::string raw_pubkey3;
75 std::string raw_pubkey4; 65 std::string raw_pubkey4;
76 EXPECT_TRUE(keypair3->ExportPublicKey(&pubkey3)); 66 EXPECT_TRUE(keypair3->ExportPublicKey(&pubkey3));
77 EXPECT_TRUE(keypair4->ExportPublicKey(&pubkey4)); 67 EXPECT_TRUE(keypair4->ExportPublicKey(&pubkey4));
78 EXPECT_TRUE(keypair3->ExportRawPublicKey(&raw_pubkey3)); 68 EXPECT_TRUE(keypair3->ExportRawPublicKey(&raw_pubkey3));
79 EXPECT_TRUE(keypair4->ExportRawPublicKey(&raw_pubkey4)); 69 EXPECT_TRUE(keypair4->ExportRawPublicKey(&raw_pubkey4));
80 70
81 EXPECT_EQ(pubkey1, pubkey3); 71 EXPECT_EQ(pubkey1, pubkey3);
82 EXPECT_EQ(pubkey2, pubkey4); 72 EXPECT_EQ(pubkey2, pubkey4);
83 EXPECT_EQ(raw_pubkey1, raw_pubkey3); 73 EXPECT_EQ(raw_pubkey1, raw_pubkey3);
84 EXPECT_EQ(raw_pubkey2, raw_pubkey4); 74 EXPECT_EQ(raw_pubkey2, raw_pubkey4);
85 } 75 }
86 76
87 TEST(ECPrivateKeyUnitTest, Copy) { 77 TEST(ECPrivateKeyUnitTest, Copy) {
88 scoped_ptr<crypto::ECPrivateKey> keypair1(crypto::ECPrivateKey::Create()); 78 scoped_ptr<crypto::ECPrivateKey> keypair1(crypto::ECPrivateKey::Create());
89 scoped_ptr<crypto::ECPrivateKey> keypair2(keypair1->Copy()); 79 scoped_ptr<crypto::ECPrivateKey> keypair2(keypair1->Copy());
90 ASSERT_TRUE(keypair1.get()); 80 ASSERT_TRUE(keypair1.get());
91 ASSERT_TRUE(keypair2.get()); 81 ASSERT_TRUE(keypair2.get());
92 82
93 std::vector<uint8_t> key1value; 83 std::vector<uint8_t> key1value;
94 std::vector<uint8_t> key2value; 84 std::vector<uint8_t> key2value;
95 EXPECT_TRUE(keypair1->ExportValue(&key1value)); 85 EXPECT_TRUE(keypair1->ExportValueForTesting(&key1value));
96 EXPECT_TRUE(keypair2->ExportValue(&key2value)); 86 EXPECT_TRUE(keypair2->ExportValueForTesting(&key2value));
97 EXPECT_EQ(key1value, key2value); 87 EXPECT_EQ(key1value, key2value);
98 88
99 std::vector<uint8_t> key1params;
100 std::vector<uint8_t> key2params;
101 EXPECT_TRUE(keypair1->ExportECParams(&key1params));
102 EXPECT_TRUE(keypair2->ExportECParams(&key2params));
103 EXPECT_EQ(key1params, key2params);
104
105 std::vector<uint8_t> pubkey1; 89 std::vector<uint8_t> pubkey1;
106 std::vector<uint8_t> pubkey2; 90 std::vector<uint8_t> pubkey2;
107 EXPECT_TRUE(keypair1->ExportPublicKey(&pubkey1)); 91 EXPECT_TRUE(keypair1->ExportPublicKey(&pubkey1));
108 EXPECT_TRUE(keypair2->ExportPublicKey(&pubkey2)); 92 EXPECT_TRUE(keypair2->ExportPublicKey(&pubkey2));
109 EXPECT_EQ(pubkey1, pubkey2); 93 EXPECT_EQ(pubkey1, pubkey2);
110 94
111 std::string raw_pubkey1; 95 std::string raw_pubkey1;
112 std::string raw_pubkey2; 96 std::string raw_pubkey2;
113 EXPECT_TRUE(keypair1->ExportRawPublicKey(&raw_pubkey1)); 97 EXPECT_TRUE(keypair1->ExportRawPublicKey(&raw_pubkey1));
114 EXPECT_TRUE(keypair2->ExportRawPublicKey(&raw_pubkey2)); 98 EXPECT_TRUE(keypair2->ExportRawPublicKey(&raw_pubkey2));
(...skipping 14 matching lines...) Expand all
129 password1, 1, &privkey1)); 113 password1, 1, &privkey1));
130 ASSERT_TRUE(keypair1->ExportPublicKey(&pubkey1)); 114 ASSERT_TRUE(keypair1->ExportPublicKey(&pubkey1));
131 115
132 scoped_ptr<crypto::ECPrivateKey> keypair2( 116 scoped_ptr<crypto::ECPrivateKey> keypair2(
133 crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo( 117 crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo(
134 password2, privkey1, pubkey1)); 118 password2, privkey1, pubkey1));
135 ASSERT_FALSE(keypair2.get()); 119 ASSERT_FALSE(keypair2.get());
136 } 120 }
137 121
138 TEST(ECPrivateKeyUnitTest, LoadNSSKeyTest) { 122 TEST(ECPrivateKeyUnitTest, LoadNSSKeyTest) {
139 static const unsigned char nss_key[] = { 123 static const uint8_t kNSSKey[] = {
140 0x30, 0x81, 0xb8, 0x30, 0x23, 0x06, 0x0a, 0x2a, 0x86, 0x48, 0x86, 0xf7, 124 0x30, 0x81, 0xb8, 0x30, 0x23, 0x06, 0x0a, 0x2a, 0x86, 0x48, 0x86, 0xf7,
141 0x0d, 0x01, 0x0c, 0x01, 0x03, 0x30, 0x15, 0x04, 0x10, 0x3f, 0xac, 0xe9, 125 0x0d, 0x01, 0x0c, 0x01, 0x03, 0x30, 0x15, 0x04, 0x10, 0x3f, 0xac, 0xe9,
142 0x38, 0xdb, 0x40, 0x6b, 0x26, 0x89, 0x09, 0x73, 0x18, 0x8d, 0x7f, 0x1c, 126 0x38, 0xdb, 0x40, 0x6b, 0x26, 0x89, 0x09, 0x73, 0x18, 0x8d, 0x7f, 0x1c,
143 0x82, 0x02, 0x01, 0x01, 0x04, 0x81, 0x90, 0x5e, 0x5e, 0x11, 0xef, 0xbb, 127 0x82, 0x02, 0x01, 0x01, 0x04, 0x81, 0x90, 0x5e, 0x5e, 0x11, 0xef, 0xbb,
144 0x7c, 0x4d, 0xec, 0xc0, 0xdc, 0xc7, 0x23, 0xd2, 0xc4, 0x77, 0xbc, 0xf4, 128 0x7c, 0x4d, 0xec, 0xc0, 0xdc, 0xc7, 0x23, 0xd2, 0xc4, 0x77, 0xbc, 0xf4,
145 0x5d, 0x59, 0x4c, 0x07, 0xc2, 0x8a, 0x26, 0xfa, 0x25, 0x1c, 0xaa, 0x42, 129 0x5d, 0x59, 0x4c, 0x07, 0xc2, 0x8a, 0x26, 0xfa, 0x25, 0x1c, 0xaa, 0x42,
146 0xed, 0xd0, 0xed, 0xbb, 0x5c, 0xe9, 0x13, 0x07, 0xaa, 0xdd, 0x52, 0x3c, 130 0xed, 0xd0, 0xed, 0xbb, 0x5c, 0xe9, 0x13, 0x07, 0xaa, 0xdd, 0x52, 0x3c,
147 0x65, 0x25, 0xbf, 0x94, 0x02, 0xaf, 0xd6, 0x97, 0xe9, 0x33, 0x00, 0x76, 131 0x65, 0x25, 0xbf, 0x94, 0x02, 0xaf, 0xd6, 0x97, 0xe9, 0x33, 0x00, 0x76,
148 0x64, 0x4a, 0x73, 0xab, 0xfb, 0x99, 0x6e, 0x83, 0x12, 0x05, 0x86, 0x72, 132 0x64, 0x4a, 0x73, 0xab, 0xfb, 0x99, 0x6e, 0x83, 0x12, 0x05, 0x86, 0x72,
149 0x6c, 0xd5, 0xa4, 0xcf, 0xb1, 0xd5, 0x4d, 0x54, 0x87, 0x8b, 0x4b, 0x95, 133 0x6c, 0xd5, 0xa4, 0xcf, 0xb1, 0xd5, 0x4d, 0x54, 0x87, 0x8b, 0x4b, 0x95,
150 0x1d, 0xcd, 0xf3, 0xfe, 0xa8, 0xda, 0xe0, 0xb6, 0x72, 0x13, 0x3f, 0x2e, 134 0x1d, 0xcd, 0xf3, 0xfe, 0xa8, 0xda, 0xe0, 0xb6, 0x72, 0x13, 0x3f, 0x2e,
151 0x66, 0xe0, 0xb9, 0x2e, 0xfa, 0x69, 0x40, 0xbe, 0xd7, 0x67, 0x6e, 0x53, 135 0x66, 0xe0, 0xb9, 0x2e, 0xfa, 0x69, 0x40, 0xbe, 0xd7, 0x67, 0x6e, 0x53,
152 0x2b, 0x3f, 0x53, 0xe5, 0x39, 0x54, 0x77, 0xe1, 0x1d, 0xe6, 0x81, 0x92, 136 0x2b, 0x3f, 0x53, 0xe5, 0x39, 0x54, 0x77, 0xe1, 0x1d, 0xe6, 0x81, 0x92,
153 0x58, 0x82, 0x14, 0xfb, 0x47, 0x85, 0x3c, 0xc3, 0xdf, 0xdd, 0xcc, 0x79, 137 0x58, 0x82, 0x14, 0xfb, 0x47, 0x85, 0x3c, 0xc3, 0xdf, 0xdd, 0xcc, 0x79,
154 0x9f, 0x41, 0x83, 0x72, 0xf2, 0x0a, 0xe9, 0xe1, 0x2c, 0x12, 0xb0, 0xb0, 138 0x9f, 0x41, 0x83, 0x72, 0xf2, 0x0a, 0xe9, 0xe1, 0x2c, 0x12, 0xb0, 0xb0,
155 0x0a, 0xb2, 0x1d, 0xca, 0x15, 0xb2, 0xca}; 139 0x0a, 0xb2, 0x1d, 0xca, 0x15, 0xb2, 0xca,
156 static const unsigned char nss_pub_key[] = { 140 };
141 static const uint8_t kNSSPublicKey[] = {
157 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 142 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
158 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 143 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03,
159 0x42, 0x00, 0x04, 0x85, 0x92, 0x9e, 0x95, 0x5c, 0x6b, 0x9e, 0xd6, 0x1e, 144 0x42, 0x00, 0x04, 0x85, 0x92, 0x9e, 0x95, 0x5c, 0x6b, 0x9e, 0xd6, 0x1e,
160 0xb8, 0x64, 0xea, 0xc2, 0xb3, 0xef, 0x18, 0xed, 0x3a, 0x5e, 0xc4, 0x5c, 145 0xb8, 0x64, 0xea, 0xc2, 0xb3, 0xef, 0x18, 0xed, 0x3a, 0x5e, 0xc4, 0x5c,
161 0x15, 0x37, 0x6a, 0xe9, 0xaa, 0x0b, 0x34, 0x03, 0xfd, 0xca, 0x83, 0x0f, 146 0x15, 0x37, 0x6a, 0xe9, 0xaa, 0x0b, 0x34, 0x03, 0xfd, 0xca, 0x83, 0x0f,
162 0xd7, 0x5c, 0x5d, 0xc5, 0x53, 0x6e, 0xe5, 0xa9, 0x33, 0xd5, 0xcc, 0xab, 147 0xd7, 0x5c, 0x5d, 0xc5, 0x53, 0x6e, 0xe5, 0xa9, 0x33, 0xd5, 0xcc, 0xab,
163 0x53, 0x78, 0xdd, 0xd6, 0x12, 0x3a, 0x5e, 0xeb, 0xbf, 0xdf, 0x16, 0xd3, 148 0x53, 0x78, 0xdd, 0xd6, 0x12, 0x3a, 0x5e, 0xeb, 0xbf, 0xdf, 0x16, 0xd3,
164 0x2c, 0x3b, 0xe8, 0xdb, 0x19, 0xfc, 0x5e}; 149 0x2c, 0x3b, 0xe8, 0xdb, 0x19, 0xfc, 0x5e,
150 };
165 151
166 scoped_ptr<crypto::ECPrivateKey> keypair_nss( 152 scoped_ptr<crypto::ECPrivateKey> keypair_nss(
167 crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo( 153 crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo(
168 "", std::vector<uint8_t>(nss_key, nss_key + arraysize(nss_key)), 154 "", std::vector<uint8_t>(std::begin(kNSSKey), std::end(kNSSKey)),
169 std::vector<uint8_t>(nss_pub_key, 155 std::vector<uint8_t>(std::begin(kNSSPublicKey),
170 nss_pub_key + arraysize(nss_pub_key)))); 156 std::end(kNSSPublicKey))));
171 157
172 EXPECT_TRUE(keypair_nss.get()); 158 EXPECT_TRUE(keypair_nss.get());
173 } 159 }
174 160
175 // Although the plan is to transition from OpenSSL to NSS, ensure NSS can import
176 // OpenSSL's format so that it is possible to rollback.
177 TEST(ECPrivateKeyUnitTest, LoadOpenSSLKeyTest) { 161 TEST(ECPrivateKeyUnitTest, LoadOpenSSLKeyTest) {
178 static const unsigned char openssl_key[] = { 162 static const uint8_t kOpenSSLKey[] = {
179 0x30, 0x81, 0xb0, 0x30, 0x1b, 0x06, 0x0a, 0x2a, 0x86, 0x48, 0x86, 0xf7, 163 0x30, 0x81, 0xb0, 0x30, 0x1b, 0x06, 0x0a, 0x2a, 0x86, 0x48, 0x86, 0xf7,
180 0x0d, 0x01, 0x0c, 0x01, 0x03, 0x30, 0x0d, 0x04, 0x08, 0xb2, 0xfe, 0x68, 164 0x0d, 0x01, 0x0c, 0x01, 0x03, 0x30, 0x0d, 0x04, 0x08, 0xb2, 0xfe, 0x68,
181 0xc2, 0xea, 0x0f, 0x10, 0x9c, 0x02, 0x01, 0x01, 0x04, 0x81, 0x90, 0xe2, 165 0xc2, 0xea, 0x0f, 0x10, 0x9c, 0x02, 0x01, 0x01, 0x04, 0x81, 0x90, 0xe2,
182 0xf6, 0x1c, 0xca, 0xad, 0x64, 0x30, 0xbf, 0x88, 0x04, 0x35, 0xe5, 0x0f, 166 0xf6, 0x1c, 0xca, 0xad, 0x64, 0x30, 0xbf, 0x88, 0x04, 0x35, 0xe5, 0x0f,
183 0x11, 0x49, 0x06, 0x01, 0x14, 0x33, 0x80, 0xa2, 0x78, 0x44, 0x5b, 0xaa, 167 0x11, 0x49, 0x06, 0x01, 0x14, 0x33, 0x80, 0xa2, 0x78, 0x44, 0x5b, 0xaa,
184 0x0d, 0xd7, 0x00, 0x36, 0x9d, 0x91, 0x97, 0x37, 0x20, 0x7b, 0x27, 0xc1, 168 0x0d, 0xd7, 0x00, 0x36, 0x9d, 0x91, 0x97, 0x37, 0x20, 0x7b, 0x27, 0xc1,
185 0xa0, 0xa2, 0x73, 0x06, 0x15, 0xdf, 0xc8, 0x13, 0x9b, 0xc9, 0x8c, 0x9c, 169 0xa0, 0xa2, 0x73, 0x06, 0x15, 0xdf, 0xc8, 0x13, 0x9b, 0xc9, 0x8c, 0x9c,
186 0xce, 0x00, 0xd0, 0xc8, 0x42, 0xc1, 0xda, 0x2b, 0x07, 0x2b, 0x12, 0xa3, 170 0xce, 0x00, 0xd0, 0xc8, 0x42, 0xc1, 0xda, 0x2b, 0x07, 0x2b, 0x12, 0xa3,
187 0xce, 0x10, 0x39, 0x7a, 0xf1, 0x55, 0x69, 0x8d, 0xa5, 0xc4, 0x2a, 0x00, 171 0xce, 0x10, 0x39, 0x7a, 0xf1, 0x55, 0x69, 0x8d, 0xa5, 0xc4, 0x2a, 0x00,
188 0x0d, 0x94, 0xc6, 0xde, 0x6a, 0x3d, 0xb7, 0xe5, 0x6d, 0x59, 0x3e, 0x09, 172 0x0d, 0x94, 0xc6, 0xde, 0x6a, 0x3d, 0xb7, 0xe5, 0x6d, 0x59, 0x3e, 0x09,
189 0xb5, 0xe3, 0x3e, 0xfc, 0x50, 0x56, 0xe9, 0x50, 0x42, 0x7c, 0xe7, 0xf0, 173 0xb5, 0xe3, 0x3e, 0xfc, 0x50, 0x56, 0xe9, 0x50, 0x42, 0x7c, 0xe7, 0xf0,
190 0x19, 0xbd, 0x31, 0xa7, 0x85, 0x47, 0xb3, 0xe9, 0xb3, 0x50, 0x3c, 0xc9, 174 0x19, 0xbd, 0x31, 0xa7, 0x85, 0x47, 0xb3, 0xe9, 0xb3, 0x50, 0x3c, 0xc9,
191 0x32, 0x37, 0x1a, 0x93, 0x78, 0x48, 0x78, 0x82, 0xde, 0xad, 0x5c, 0xf2, 175 0x32, 0x37, 0x1a, 0x93, 0x78, 0x48, 0x78, 0x82, 0xde, 0xad, 0x5c, 0xf2,
192 0xcf, 0xf2, 0xbb, 0x2c, 0x44, 0x05, 0x7f, 0x4a, 0xf9, 0xb1, 0x2b, 0xdd, 176 0xcf, 0xf2, 0xbb, 0x2c, 0x44, 0x05, 0x7f, 0x4a, 0xf9, 0xb1, 0x2b, 0xdd,
193 0x49, 0xf6, 0x7e, 0xd0, 0x42, 0xaa, 0x14, 0x3c, 0x24, 0x77, 0xb4}; 177 0x49, 0xf6, 0x7e, 0xd0, 0x42, 0xaa, 0x14, 0x3c, 0x24, 0x77, 0xb4,
194 static const unsigned char openssl_pub_key[] = { 178 };
179 static const uint8_t kOpenSSLPublicKey[] = {
195 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 180 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
196 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 181 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03,
197 0x42, 0x00, 0x04, 0xb9, 0xda, 0x0d, 0x71, 0x60, 0xb3, 0x63, 0x28, 0x22, 182 0x42, 0x00, 0x04, 0xb9, 0xda, 0x0d, 0x71, 0x60, 0xb3, 0x63, 0x28, 0x22,
198 0x67, 0xe7, 0xe0, 0xa3, 0xf8, 0x00, 0x8e, 0x4c, 0x89, 0xed, 0x31, 0x34, 183 0x67, 0xe7, 0xe0, 0xa3, 0xf8, 0x00, 0x8e, 0x4c, 0x89, 0xed, 0x31, 0x34,
199 0xf6, 0xdb, 0xc4, 0xfe, 0x0b, 0x5d, 0xe1, 0x11, 0x39, 0x49, 0xa6, 0x50, 184 0xf6, 0xdb, 0xc4, 0xfe, 0x0b, 0x5d, 0xe1, 0x11, 0x39, 0x49, 0xa6, 0x50,
200 0xa8, 0xe3, 0x4a, 0xc0, 0x40, 0x88, 0xb8, 0x38, 0x3f, 0x56, 0xfb, 0x33, 185 0xa8, 0xe3, 0x4a, 0xc0, 0x40, 0x88, 0xb8, 0x38, 0x3f, 0x56, 0xfb, 0x33,
201 0x8d, 0xd4, 0x64, 0x91, 0xd6, 0x15, 0x77, 0x42, 0x27, 0xc5, 0xaa, 0x44, 186 0x8d, 0xd4, 0x64, 0x91, 0xd6, 0x15, 0x77, 0x42, 0x27, 0xc5, 0xaa, 0x44,
202 0xff, 0xab, 0x4d, 0xb5, 0x7e, 0x25, 0x3d}; 187 0xff, 0xab, 0x4d, 0xb5, 0x7e, 0x25, 0x3d,
188 };
189 static const char kOpenSSLRawPublicKey[] = {
Ryan Sleevi 2016/03/01 22:05:27 uint8_t
davidben 2016/03/01 22:10:08 I think this actually does want to be the signed o
davidben 2016/03/01 22:10:47 Oh, but MSVC hates it. Fine. I'll add the annoying
davidben 2016/03/01 22:18:43 Done.
190 0xb9, 0xda, 0x0d, 0x71, 0x60, 0xb3, 0x63, 0x28, 0x22, 0x67, 0xe7,
191 0xe0, 0xa3, 0xf8, 0x00, 0x8e, 0x4c, 0x89, 0xed, 0x31, 0x34, 0xf6,
192 0xdb, 0xc4, 0xfe, 0x0b, 0x5d, 0xe1, 0x11, 0x39, 0x49, 0xa6, 0x50,
193 0xa8, 0xe3, 0x4a, 0xc0, 0x40, 0x88, 0xb8, 0x38, 0x3f, 0x56, 0xfb,
194 0x33, 0x8d, 0xd4, 0x64, 0x91, 0xd6, 0x15, 0x77, 0x42, 0x27, 0xc5,
195 0xaa, 0x44, 0xff, 0xab, 0x4d, 0xb5, 0x7e, 0x25, 0x3d,
196 };
203 197
204 scoped_ptr<crypto::ECPrivateKey> keypair_openssl( 198 scoped_ptr<crypto::ECPrivateKey> keypair_openssl(
205 crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo( 199 crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo(
206 "", std::vector<uint8_t>(openssl_key, 200 "",
207 openssl_key + arraysize(openssl_key)), 201 std::vector<uint8_t>(std::begin(kOpenSSLKey), std::end(kOpenSSLKey)),
208 std::vector<uint8_t>(openssl_pub_key, 202 std::vector<uint8_t>(std::begin(kOpenSSLPublicKey),
209 openssl_pub_key + arraysize(openssl_pub_key)))); 203 std::end(kOpenSSLPublicKey))));
210 204
211 EXPECT_TRUE(keypair_openssl.get()); 205 EXPECT_TRUE(keypair_openssl.get());
206
207 std::vector<uint8_t> public_key;
208 EXPECT_TRUE(keypair_openssl->ExportPublicKey(&public_key));
209 EXPECT_EQ(std::vector<uint8_t>(std::begin(kOpenSSLPublicKey),
210 std::end(kOpenSSLPublicKey)),
211 public_key);
212
213 std::string raw_public_key;
214 EXPECT_TRUE(keypair_openssl->ExportRawPublicKey(&raw_public_key));
215 EXPECT_EQ(std::string(std::begin(kOpenSSLRawPublicKey),
216 std::end(kOpenSSLRawPublicKey)),
217 raw_public_key);
212 } 218 }
213 219
214 // The Android code writes out Channel IDs differently from the NSS 220 // The Android code writes out Channel IDs differently from the NSS
215 // implementation; the empty password is converted to "\0\0". The OpenSSL port 221 // implementation; the empty password is converted to "\0\0". The OpenSSL port
216 // should support either. 222 // should support either.
217 #if defined(USE_OPENSSL) 223 #if defined(USE_OPENSSL)
218 TEST(ECPrivateKeyUnitTest, LoadOldOpenSSLKeyTest) { 224 TEST(ECPrivateKeyUnitTest, LoadOldOpenSSLKeyTest) {
219 static const unsigned char openssl_key[] = { 225 static const uint8_t kOpenSSLKey[] = {
220 0x30, 0x82, 0x01, 0xa1, 0x30, 0x1b, 0x06, 0x0a, 0x2a, 0x86, 0x48, 0x86, 226 0x30, 0x82, 0x01, 0xa1, 0x30, 0x1b, 0x06, 0x0a, 0x2a, 0x86, 0x48, 0x86,
221 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x03, 0x30, 0x0d, 0x04, 0x08, 0x86, 0xaa, 227 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x03, 0x30, 0x0d, 0x04, 0x08, 0x86, 0xaa,
222 0xd7, 0xdf, 0x3b, 0x91, 0x97, 0x60, 0x02, 0x01, 0x01, 0x04, 0x82, 0x01, 228 0xd7, 0xdf, 0x3b, 0x91, 0x97, 0x60, 0x02, 0x01, 0x01, 0x04, 0x82, 0x01,
223 0x80, 0xcb, 0x2a, 0x14, 0xaa, 0x4f, 0x38, 0x4c, 0xe1, 0x49, 0x00, 0xe2, 229 0x80, 0xcb, 0x2a, 0x14, 0xaa, 0x4f, 0x38, 0x4c, 0xe1, 0x49, 0x00, 0xe2,
224 0x1a, 0x3a, 0x75, 0x87, 0x7e, 0x3d, 0xea, 0x4d, 0x53, 0xd4, 0x46, 0x47, 230 0x1a, 0x3a, 0x75, 0x87, 0x7e, 0x3d, 0xea, 0x4d, 0x53, 0xd4, 0x46, 0x47,
225 0x23, 0x8f, 0xa1, 0x72, 0x51, 0x92, 0x86, 0x8b, 0xeb, 0x53, 0xe6, 0x6a, 231 0x23, 0x8f, 0xa1, 0x72, 0x51, 0x92, 0x86, 0x8b, 0xeb, 0x53, 0xe6, 0x6a,
226 0x0a, 0x6b, 0xb6, 0xa0, 0xdc, 0x0f, 0xdc, 0x20, 0xc3, 0x45, 0x85, 0xf1, 232 0x0a, 0x6b, 0xb6, 0xa0, 0xdc, 0x0f, 0xdc, 0x20, 0xc3, 0x45, 0x85, 0xf1,
227 0x95, 0x90, 0x5c, 0xf4, 0xfa, 0xee, 0x47, 0xaf, 0x35, 0xd0, 0xd0, 0xd3, 233 0x95, 0x90, 0x5c, 0xf4, 0xfa, 0xee, 0x47, 0xaf, 0x35, 0xd0, 0xd0, 0xd3,
228 0x14, 0xde, 0x0d, 0xca, 0x1b, 0xd3, 0xbb, 0x20, 0xec, 0x9d, 0x6a, 0xd4, 234 0x14, 0xde, 0x0d, 0xca, 0x1b, 0xd3, 0xbb, 0x20, 0xec, 0x9d, 0x6a, 0xd4,
229 0xc1, 0xce, 0x60, 0x81, 0xab, 0x0c, 0x72, 0x10, 0xfa, 0x28, 0x3c, 0xac, 235 0xc1, 0xce, 0x60, 0x81, 0xab, 0x0c, 0x72, 0x10, 0xfa, 0x28, 0x3c, 0xac,
(...skipping 15 matching lines...) Expand all
245 0xd1, 0xf3, 0xf3, 0xd0, 0xf4, 0x5a, 0xc4, 0x99, 0xaf, 0x8d, 0xe2, 0xbc, 251 0xd1, 0xf3, 0xf3, 0xd0, 0xf4, 0x5a, 0xc4, 0x99, 0xaf, 0x8d, 0xe2, 0xbc,
246 0xa2, 0xb9, 0x3d, 0x86, 0x5e, 0xba, 0xa0, 0xdf, 0x78, 0x81, 0x7c, 0x54, 252 0xa2, 0xb9, 0x3d, 0x86, 0x5e, 0xba, 0xa0, 0xdf, 0x78, 0x81, 0x7c, 0x54,
247 0x31, 0xe3, 0x98, 0xb5, 0x46, 0xcb, 0x4d, 0x26, 0x4b, 0xf8, 0xac, 0x3a, 253 0x31, 0xe3, 0x98, 0xb5, 0x46, 0xcb, 0x4d, 0x26, 0x4b, 0xf8, 0xac, 0x3a,
248 0x54, 0x1b, 0x77, 0x5a, 0x18, 0xa5, 0x43, 0x0e, 0x14, 0xde, 0x7b, 0xb7, 254 0x54, 0x1b, 0x77, 0x5a, 0x18, 0xa5, 0x43, 0x0e, 0x14, 0xde, 0x7b, 0xb7,
249 0x4e, 0x45, 0x99, 0x03, 0xd1, 0x3d, 0x18, 0xb2, 0x36, 0x00, 0x48, 0x07, 255 0x4e, 0x45, 0x99, 0x03, 0xd1, 0x3d, 0x18, 0xb2, 0x36, 0x00, 0x48, 0x07,
250 0x72, 0xbb, 0x4f, 0x21, 0x25, 0x3e, 0xda, 0x25, 0x24, 0x5b, 0xc8, 0xa0, 256 0x72, 0xbb, 0x4f, 0x21, 0x25, 0x3e, 0xda, 0x25, 0x24, 0x5b, 0xc8, 0xa0,
251 0x28, 0xd5, 0x9b, 0x96, 0x87, 0x07, 0x77, 0x84, 0xff, 0xd7, 0xac, 0x71, 257 0x28, 0xd5, 0x9b, 0x96, 0x87, 0x07, 0x77, 0x84, 0xff, 0xd7, 0xac, 0x71,
252 0xf6, 0x61, 0x63, 0x0b, 0xfb, 0x42, 0xfd, 0x52, 0xf4, 0xc4, 0x35, 0x0c, 258 0xf6, 0x61, 0x63, 0x0b, 0xfb, 0x42, 0xfd, 0x52, 0xf4, 0xc4, 0x35, 0x0c,
253 0xc2, 0xc1, 0x55, 0x22, 0x42, 0x2f, 0x13, 0x7d, 0x93, 0x27, 0xc8, 0x11, 259 0xc2, 0xc1, 0x55, 0x22, 0x42, 0x2f, 0x13, 0x7d, 0x93, 0x27, 0xc8, 0x11,
254 0x35, 0xc5, 0xe3, 0xc5, 0xaa, 0x15, 0x3c, 0xac, 0x30, 0xbc, 0x45, 0x16, 260 0x35, 0xc5, 0xe3, 0xc5, 0xaa, 0x15, 0x3c, 0xac, 0x30, 0xbc, 0x45, 0x16,
255 0xed}; 261 0xed,
256 static const unsigned char openssl_pub_key[] = { 262 };
263 static const uint8_t kOpenSSLPublicKey[] = {
257 0x30, 0x82, 0x01, 0x4b, 0x30, 0x82, 0x01, 0x03, 0x06, 0x07, 0x2a, 0x86, 264 0x30, 0x82, 0x01, 0x4b, 0x30, 0x82, 0x01, 0x03, 0x06, 0x07, 0x2a, 0x86,
258 0x48, 0xce, 0x3d, 0x02, 0x01, 0x30, 0x81, 0xf7, 0x02, 0x01, 0x01, 0x30, 265 0x48, 0xce, 0x3d, 0x02, 0x01, 0x30, 0x81, 0xf7, 0x02, 0x01, 0x01, 0x30,
259 0x2c, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x01, 0x02, 0x21, 266 0x2c, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x01, 0x02, 0x21,
260 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 267 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
261 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 268 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
262 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x30, 0x5b, 0x04, 269 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x30, 0x5b, 0x04,
263 0x20, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 270 0x20, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
264 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 271 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
265 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x04, 0x20, 0x5a, 272 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x04, 0x20, 0x5a,
266 0xc6, 0x35, 0xd8, 0xaa, 0x3a, 0x93, 0xe7, 0xb3, 0xeb, 0xbd, 0x55, 0x76, 273 0xc6, 0x35, 0xd8, 0xaa, 0x3a, 0x93, 0xe7, 0xb3, 0xeb, 0xbd, 0x55, 0x76,
267 0x98, 0x86, 0xbc, 0x65, 0x1d, 0x06, 0xb0, 0xcc, 0x53, 0xb0, 0xf6, 0x3b, 274 0x98, 0x86, 0xbc, 0x65, 0x1d, 0x06, 0xb0, 0xcc, 0x53, 0xb0, 0xf6, 0x3b,
268 0xce, 0x3c, 0x3e, 0x27, 0xd2, 0x60, 0x4b, 0x03, 0x15, 0x00, 0xc4, 0x9d, 275 0xce, 0x3c, 0x3e, 0x27, 0xd2, 0x60, 0x4b, 0x03, 0x15, 0x00, 0xc4, 0x9d,
269 0x36, 0x08, 0x86, 0xe7, 0x04, 0x93, 0x6a, 0x66, 0x78, 0xe1, 0x13, 0x9d, 276 0x36, 0x08, 0x86, 0xe7, 0x04, 0x93, 0x6a, 0x66, 0x78, 0xe1, 0x13, 0x9d,
270 0x26, 0xb7, 0x81, 0x9f, 0x7e, 0x90, 0x04, 0x41, 0x04, 0x6b, 0x17, 0xd1, 277 0x26, 0xb7, 0x81, 0x9f, 0x7e, 0x90, 0x04, 0x41, 0x04, 0x6b, 0x17, 0xd1,
271 0xf2, 0xe1, 0x2c, 0x42, 0x47, 0xf8, 0xbc, 0xe6, 0xe5, 0x63, 0xa4, 0x40, 278 0xf2, 0xe1, 0x2c, 0x42, 0x47, 0xf8, 0xbc, 0xe6, 0xe5, 0x63, 0xa4, 0x40,
272 0xf2, 0x77, 0x03, 0x7d, 0x81, 0x2d, 0xeb, 0x33, 0xa0, 0xf4, 0xa1, 0x39, 279 0xf2, 0x77, 0x03, 0x7d, 0x81, 0x2d, 0xeb, 0x33, 0xa0, 0xf4, 0xa1, 0x39,
273 0x45, 0xd8, 0x98, 0xc2, 0x96, 0x4f, 0xe3, 0x42, 0xe2, 0xfe, 0x1a, 0x7f, 280 0x45, 0xd8, 0x98, 0xc2, 0x96, 0x4f, 0xe3, 0x42, 0xe2, 0xfe, 0x1a, 0x7f,
274 0x9b, 0x8e, 0xe7, 0xeb, 0x4a, 0x7c, 0x0f, 0x9e, 0x16, 0x2b, 0xce, 0x33, 281 0x9b, 0x8e, 0xe7, 0xeb, 0x4a, 0x7c, 0x0f, 0x9e, 0x16, 0x2b, 0xce, 0x33,
275 0x57, 0x6b, 0x31, 0x5e, 0xce, 0xcb, 0xb6, 0x40, 0x68, 0x37, 0xbf, 0x51, 282 0x57, 0x6b, 0x31, 0x5e, 0xce, 0xcb, 0xb6, 0x40, 0x68, 0x37, 0xbf, 0x51,
276 0xf5, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 283 0xf5, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
277 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbc, 0xe6, 0xfa, 0xad, 284 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbc, 0xe6, 0xfa, 0xad,
278 0xa7, 0x17, 0x9e, 0x84, 0xf3, 0xb9, 0xca, 0xc2, 0xfc, 0x63, 0x25, 0x51, 285 0xa7, 0x17, 0x9e, 0x84, 0xf3, 0xb9, 0xca, 0xc2, 0xfc, 0x63, 0x25, 0x51,
279 0x02, 0x01, 0x01, 0x03, 0x42, 0x00, 0x04, 0xde, 0x09, 0x08, 0x07, 0x03, 286 0x02, 0x01, 0x01, 0x03, 0x42, 0x00, 0x04, 0xde, 0x09, 0x08, 0x07, 0x03,
280 0x2e, 0x8f, 0x37, 0x9a, 0xd5, 0xad, 0xe5, 0xc6, 0x9d, 0xd4, 0x63, 0xc7, 287 0x2e, 0x8f, 0x37, 0x9a, 0xd5, 0xad, 0xe5, 0xc6, 0x9d, 0xd4, 0x63, 0xc7,
281 0x4a, 0xe7, 0x20, 0xcb, 0x90, 0xa0, 0x1f, 0x18, 0x18, 0x72, 0xb5, 0x21, 288 0x4a, 0xe7, 0x20, 0xcb, 0x90, 0xa0, 0x1f, 0x18, 0x18, 0x72, 0xb5, 0x21,
282 0x88, 0x38, 0xc0, 0xdb, 0xba, 0xf6, 0x99, 0xd8, 0xa5, 0x3b, 0x83, 0xe9, 289 0x88, 0x38, 0xc0, 0xdb, 0xba, 0xf6, 0x99, 0xd8, 0xa5, 0x3b, 0x83, 0xe9,
283 0xe3, 0xd5, 0x61, 0x99, 0x73, 0x42, 0xc6, 0x6c, 0xe8, 0x0a, 0x95, 0x40, 290 0xe3, 0xd5, 0x61, 0x99, 0x73, 0x42, 0xc6, 0x6c, 0xe8, 0x0a, 0x95, 0x40,
284 0x41, 0x3b, 0x0d, 0x10, 0xa7, 0x4a, 0x93, 0xdb, 0x5a, 0xe7, 0xec}; 291 0x41, 0x3b, 0x0d, 0x10, 0xa7, 0x4a, 0x93, 0xdb, 0x5a, 0xe7, 0xec,
292 };
285 293
286 scoped_ptr<crypto::ECPrivateKey> keypair_openssl( 294 scoped_ptr<crypto::ECPrivateKey> keypair_openssl(
287 crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo( 295 crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo(
288 "", std::vector<uint8_t>(openssl_key, 296 "",
289 openssl_key + arraysize(openssl_key)), 297 std::vector<uint8_t>(std::begin(kOpenSSLKey), std::end(kOpenSSLKey)),
290 std::vector<uint8_t>(openssl_pub_key, 298 std::vector<uint8_t>(std::begin(kOpenSSLPublicKey),
291 openssl_pub_key + arraysize(openssl_pub_key)))); 299 std::end(kOpenSSLPublicKey))));
292 300
293 EXPECT_TRUE(keypair_openssl.get()); 301 EXPECT_TRUE(keypair_openssl.get());
294 } 302 }
295 #endif // defined(USE_OPENSSL) 303 #endif // defined(USE_OPENSSL)
OLDNEW
« no previous file with comments | « crypto/ec_private_key_openssl.cc ('k') | crypto/ec_signature_creator_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698