| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 blink::WebCryptoKeyUsageEncrypt, | 114 blink::WebCryptoKeyUsageEncrypt, |
| 115 &key); | 115 &key); |
| 116 | 116 |
| 117 if (status.IsError()) | 117 if (status.IsError()) |
| 118 EXPECT_EQ(blink::WebCryptoErrorTypeNotSupported, status.error_type()); | 118 EXPECT_EQ(blink::WebCryptoErrorTypeNotSupported, status.error_type()); |
| 119 return status.IsSuccess(); | 119 return status.IsSuccess(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool SupportsRsaOaep() { | 122 bool SupportsRsaOaep() { |
| 123 #if defined(USE_OPENSSL) | 123 #if defined(USE_OPENSSL) |
| 124 return false; | 124 return true; |
| 125 #else | 125 #else |
| 126 crypto::EnsureNSSInit(); | 126 crypto::EnsureNSSInit(); |
| 127 // TODO(eroman): Exclude version test for OS_CHROMEOS | 127 // TODO(eroman): Exclude version test for OS_CHROMEOS |
| 128 #if defined(USE_NSS) | 128 #if defined(USE_NSS) |
| 129 if (!NSS_VersionCheck("3.16.2")) | 129 if (!NSS_VersionCheck("3.16.2")) |
| 130 return false; | 130 return false; |
| 131 #endif | 131 #endif |
| 132 crypto::ScopedPK11Slot slot(PK11_GetInternalKeySlot()); | 132 crypto::ScopedPK11Slot slot(PK11_GetInternalKeySlot()); |
| 133 return !!PK11_DoesMechanism(slot.get(), CKM_RSA_PKCS_OAEP); | 133 return !!PK11_DoesMechanism(slot.get(), CKM_RSA_PKCS_OAEP); |
| 134 #endif | 134 #endif |
| (...skipping 4275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4410 EXPECT_EQ(public_key_spki, unwrapped_public_key_spki); | 4410 EXPECT_EQ(public_key_spki, unwrapped_public_key_spki); |
| 4411 EXPECT_EQ(private_key_pkcs8, unwrapped_private_key_pkcs8); | 4411 EXPECT_EQ(private_key_pkcs8, unwrapped_private_key_pkcs8); |
| 4412 | 4412 |
| 4413 EXPECT_NE(public_key_spki, wrapped_public_key); | 4413 EXPECT_NE(public_key_spki, wrapped_public_key); |
| 4414 EXPECT_NE(private_key_pkcs8, wrapped_private_key); | 4414 EXPECT_NE(private_key_pkcs8, wrapped_private_key); |
| 4415 } | 4415 } |
| 4416 | 4416 |
| 4417 } // namespace webcrypto | 4417 } // namespace webcrypto |
| 4418 | 4418 |
| 4419 } // namespace content | 4419 } // namespace content |
| OLD | NEW |