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

Unified Diff: content/child/webcrypto/shared_crypto_unittest.cc

Issue 203753009: [webcrypto] Add PKCS#8 export for RSA private keys for NSS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/webcrypto/shared_crypto.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/shared_crypto_unittest.cc
diff --git a/content/child/webcrypto/shared_crypto_unittest.cc b/content/child/webcrypto/shared_crypto_unittest.cc
index 6995b48c4b07868b63f7df252dc5f99df9611e5d..821945fb800bb70c7cb84b27d7ae94dc29c70568 100644
--- a/content/child/webcrypto/shared_crypto_unittest.cc
+++ b/content/child/webcrypto/shared_crypto_unittest.cc
@@ -810,7 +810,7 @@ TEST_F(SharedCryptoTest, AesCbcFailures) {
// keys).
EXPECT_STATUS(Status::ErrorUnexpectedKeyType(),
ExportKey(blink::WebCryptoKeyFormatSpki, key, &output));
- EXPECT_STATUS(Status::ErrorUnsupported(),
+ EXPECT_STATUS(Status::ErrorUnexpectedKeyType(),
ExportKey(blink::WebCryptoKeyFormatPkcs8, key, &output));
}
@@ -1681,7 +1681,7 @@ TEST_F(SharedCryptoTest, MAYBE(ImportExportSpki)) {
ExportKey(blink::WebCryptoKeyFormatSpki, key, &output));
}
-TEST_F(SharedCryptoTest, MAYBE(ImportPkcs8)) {
+TEST_F(SharedCryptoTest, MAYBE(ImportExportPkcs8)) {
// Passing case: Import a valid RSA key in PKCS#8 format.
blink::WebCryptoKey key = blink::WebCryptoKey::createNull();
ASSERT_STATUS_SUCCESS(ImportKey(
@@ -1704,6 +1704,11 @@ TEST_F(SharedCryptoTest, MAYBE(ImportPkcs8)) {
"010001",
CryptoData(key.algorithm().rsaHashedParams()->publicExponent()));
+ blink::WebArrayBuffer exported_key;
+ ASSERT_STATUS_SUCCESS(
+ ExportKey(blink::WebCryptoKeyFormatPkcs8, key, &exported_key));
+ ExpectArrayBufferMatchesHex(kPrivateKeyPkcs8DerHex, exported_key);
+
// Failing case: Empty PKCS#8 data
EXPECT_STATUS(Status::ErrorImportEmptyKeyData(),
ImportKey(blink::WebCryptoKeyFormatPkcs8,
« no previous file with comments | « content/child/webcrypto/shared_crypto.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698