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

Side by Side Diff: content/child/webcrypto/shared_crypto_unittest.cc

Issue 419673006: [webcrypto] Implement RSA-OAEP using BoringSSL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « content/child/webcrypto/openssl/util_openssl.cc ('k') | content/content_child.gypi » ('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 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
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 4346 matching lines...) Expand 10 before | Expand all | Expand 10 after
4481 EXPECT_EQ(public_key_spki, unwrapped_public_key_spki); 4481 EXPECT_EQ(public_key_spki, unwrapped_public_key_spki);
4482 EXPECT_EQ(private_key_pkcs8, unwrapped_private_key_pkcs8); 4482 EXPECT_EQ(private_key_pkcs8, unwrapped_private_key_pkcs8);
4483 4483
4484 EXPECT_NE(public_key_spki, wrapped_public_key); 4484 EXPECT_NE(public_key_spki, wrapped_public_key);
4485 EXPECT_NE(private_key_pkcs8, wrapped_private_key); 4485 EXPECT_NE(private_key_pkcs8, wrapped_private_key);
4486 } 4486 }
4487 4487
4488 } // namespace webcrypto 4488 } // namespace webcrypto
4489 4489
4490 } // namespace content 4490 } // namespace content
OLDNEW
« no previous file with comments | « content/child/webcrypto/openssl/util_openssl.cc ('k') | content/content_child.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698