| 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 "content/child/webcrypto/shared_crypto.h" | 5 #include "content/child/webcrypto/shared_crypto.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 blink::WebCryptoKey key = blink::WebCryptoKey::createNull(); | 108 blink::WebCryptoKey key = blink::WebCryptoKey::createNull(); |
| 109 Status status = ImportKey(blink::WebCryptoKeyFormatRaw, | 109 Status status = ImportKey(blink::WebCryptoKeyFormatRaw, |
| 110 CryptoData(key_raw), | 110 CryptoData(key_raw), |
| 111 CreateAlgorithm(blink::WebCryptoAlgorithmIdAesGcm), | 111 CreateAlgorithm(blink::WebCryptoAlgorithmIdAesGcm), |
| 112 true, | 112 true, |
| 113 blink::WebCryptoKeyUsageEncrypt, | 113 blink::WebCryptoKeyUsageEncrypt, |
| 114 &key); | 114 &key); |
| 115 | 115 |
| 116 if (status.IsError()) | 116 if (status.IsError()) |
| 117 EXPECT_EQ(Status::ErrorUnsupported(), status); | 117 EXPECT_EQ(blink::WebCryptoErrorTypeNotSupported, status.error_type()); |
| 118 return status.IsSuccess(); | 118 return status.IsSuccess(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 bool SupportsRsaOaep() { | 121 bool SupportsRsaOaep() { |
| 122 #if defined(USE_OPENSSL) | 122 #if defined(USE_OPENSSL) |
| 123 return false; | 123 return false; |
| 124 #else | 124 #else |
| 125 #if defined(USE_NSS) | 125 #if defined(USE_NSS) |
| 126 if (!NSS_VersionCheck("3.16.2")) | 126 if (!NSS_VersionCheck("3.16.2")) |
| 127 return false; | 127 return false; |
| (...skipping 4189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4317 EXPECT_EQ(public_key_spki, unwrapped_public_key_spki); | 4317 EXPECT_EQ(public_key_spki, unwrapped_public_key_spki); |
| 4318 EXPECT_EQ(private_key_pkcs8, unwrapped_private_key_pkcs8); | 4318 EXPECT_EQ(private_key_pkcs8, unwrapped_private_key_pkcs8); |
| 4319 | 4319 |
| 4320 EXPECT_NE(public_key_spki, wrapped_public_key); | 4320 EXPECT_NE(public_key_spki, wrapped_public_key); |
| 4321 EXPECT_NE(private_key_pkcs8, wrapped_private_key); | 4321 EXPECT_NE(private_key_pkcs8, wrapped_private_key); |
| 4322 } | 4322 } |
| 4323 | 4323 |
| 4324 } // namespace webcrypto | 4324 } // namespace webcrypto |
| 4325 | 4325 |
| 4326 } // namespace content | 4326 } // namespace content |
| OLD | NEW |