| 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 "net/cert/x509_certificate.h" | 5 #include "net/cert/x509_certificate.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1168 X509Certificate::kPublicKeyTypeRSA}, | 1168 X509Certificate::kPublicKeyTypeRSA}, |
| 1169 {"prime256v1-ecdsa-ee-by-1024-rsa-intermediate.pem", | 1169 {"prime256v1-ecdsa-ee-by-1024-rsa-intermediate.pem", |
| 1170 256, | 1170 256, |
| 1171 X509Certificate::kPublicKeyTypeECDSA}, | 1171 X509Certificate::kPublicKeyTypeECDSA}, |
| 1172 #if defined(OS_MACOSX) && !defined(OS_IOS) | 1172 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 1173 // OS X has an key length limit of 4096 bits. This should manifest as an | 1173 // OS X has an key length limit of 4096 bits. This should manifest as an |
| 1174 // unknown key. If a future version of OS X changes this, large_key.pem may | 1174 // unknown key. If a future version of OS X changes this, large_key.pem may |
| 1175 // need to be renegerated with a larger key. See https://crbug.com/472291. | 1175 // need to be renegerated with a larger key. See https://crbug.com/472291. |
| 1176 {"large_key.pem", 0, X509Certificate::kPublicKeyTypeUnknown}, | 1176 {"large_key.pem", 0, X509Certificate::kPublicKeyTypeUnknown}, |
| 1177 #else | 1177 #else |
| 1178 {"large_key.pem", 4104, X509Certificate::kPublicKeyTypeRSA}, | 1178 {"large_key.pem", 8200, X509Certificate::kPublicKeyTypeRSA}, |
| 1179 #endif | 1179 #endif |
| 1180 }; | 1180 }; |
| 1181 | 1181 |
| 1182 class X509CertificatePublicKeyInfoTest | 1182 class X509CertificatePublicKeyInfoTest |
| 1183 : public testing::TestWithParam<PublicKeyInfoTestData> { | 1183 : public testing::TestWithParam<PublicKeyInfoTestData> { |
| 1184 }; | 1184 }; |
| 1185 | 1185 |
| 1186 TEST_P(X509CertificatePublicKeyInfoTest, GetPublicKeyInfo) { | 1186 TEST_P(X509CertificatePublicKeyInfoTest, GetPublicKeyInfo) { |
| 1187 PublicKeyInfoTestData data = GetParam(); | 1187 PublicKeyInfoTestData data = GetParam(); |
| 1188 | 1188 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1206 &actual_type); | 1206 &actual_type); |
| 1207 | 1207 |
| 1208 EXPECT_EQ(data.expected_bits, actual_bits); | 1208 EXPECT_EQ(data.expected_bits, actual_bits); |
| 1209 EXPECT_EQ(data.expected_type, actual_type); | 1209 EXPECT_EQ(data.expected_type, actual_type); |
| 1210 } | 1210 } |
| 1211 | 1211 |
| 1212 INSTANTIATE_TEST_CASE_P(, X509CertificatePublicKeyInfoTest, | 1212 INSTANTIATE_TEST_CASE_P(, X509CertificatePublicKeyInfoTest, |
| 1213 testing::ValuesIn(kPublicKeyInfoTestData)); | 1213 testing::ValuesIn(kPublicKeyInfoTestData)); |
| 1214 | 1214 |
| 1215 } // namespace net | 1215 } // namespace net |
| OLD | NEW |