Title: [219976] trunk
Revision
219976
Author
[email protected]
Date
2017-07-27 01:13:02 -0700 (Thu, 27 Jul 2017)

Log Message

[GCrypt] Key serialization support
https://bugs.webkit.org/show_bug.cgi?id=173883

Reviewed by Jiewen Tan.

Source/WebCore:

Implement crypto key serialization for platforms that use libgcrypt.

Despite the function names and the existing implementation for the Mac port,
we don't perform the KEK wrapping and unwrapping due to the review feedback
advising against it.

Instead the passed-in key data is simply copied and returned as the result of
the 'wrapping' operation, and similarly the passed-in serialized data is simply
copied and returned as the result of the 'unwrapping' operation.

No new tests -- related tests are now passing and are unskipped.

* crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp:
(WebCore::getDefaultWebCryptoMasterKey):
(WebCore::wrapSerializedCryptoKey):
(WebCore::unwrapSerializedCryptoKey):

LayoutTests:

* platform/wpe/TestExpectations: Unskip the crypto/worker/ tests that
utilize key serialization and are now passing.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (219975 => 219976)


--- trunk/LayoutTests/ChangeLog	2017-07-27 03:57:19 UTC (rev 219975)
+++ trunk/LayoutTests/ChangeLog	2017-07-27 08:13:02 UTC (rev 219976)
@@ -1,3 +1,13 @@
+2017-07-27  Zan Dobersek  <[email protected]>
+
+        [GCrypt] Key serialization support
+        https://bugs.webkit.org/show_bug.cgi?id=173883
+
+        Reviewed by Jiewen Tan.
+
+        * platform/wpe/TestExpectations: Unskip the crypto/worker/ tests that
+        utilize key serialization and are now passing.
+
 2017-07-26  Arnaud Renevier  <[email protected]> and Fujii Hironori  <[email protected]>
 
         Implement new TextMetrics, returned by canvas measureText()

Modified: trunk/LayoutTests/platform/wpe/TestExpectations (219975 => 219976)


--- trunk/LayoutTests/platform/wpe/TestExpectations	2017-07-27 03:57:19 UTC (rev 219975)
+++ trunk/LayoutTests/platform/wpe/TestExpectations	2017-07-27 08:13:02 UTC (rev 219976)
@@ -440,21 +440,8 @@
 webkit.org/b/133122 crypto/workers/subtle/aes-cfb-import-key-encrypt.html [ Skip ]
 webkit.org/b/133122 crypto/workers/subtle/aes-cfb-import-key-unwrap-key.html [ Skip ]
 webkit.org/b/133122 crypto/workers/subtle/aes-cfb-import-key-wrap-key.html [ Skip ]
-webkit.org/b/133122 crypto/workers/subtle/aes-postMessage-worker.html [ Skip ]
-webkit.org/b/133122 crypto/workers/subtle/ec-generate-export-pkcs8-key.html [ Skip ]
-webkit.org/b/133122 crypto/workers/subtle/ec-generate-export-spki-key.html [ Skip ]
 webkit.org/b/133122 crypto/workers/subtle/ec-import-pkcs8-key.html [ Skip ]
-webkit.org/b/133122 crypto/workers/subtle/ec-import-spki-key.html [ Skip ]
 webkit.org/b/133122 crypto/workers/subtle/ec-postMessage-worker.html [ Skip ]
-webkit.org/b/133122 crypto/workers/subtle/hmac-postMessage-worker.html [ Skip ]
-webkit.org/b/133122 crypto/workers/subtle/hrsa-postMessage-worker.html [ Skip ]
-webkit.org/b/133122 crypto/workers/subtle/multiple-postMessage-worker.html [ Skip ]
-webkit.org/b/133122 crypto/workers/subtle/raw-postMessage-worker.html [ Skip ]
-webkit.org/b/133122 crypto/workers/subtle/rsa-export-pkcs8-key.html [ Skip ]
-webkit.org/b/133122 crypto/workers/subtle/rsa-export-spki-key.html [ Skip ]
-webkit.org/b/133122 crypto/workers/subtle/rsa-import-pkcs8-key.html [ Skip ]
-webkit.org/b/133122 crypto/workers/subtle/rsa-import-spki-key.html [ Skip ]
-webkit.org/b/133122 crypto/workers/subtle/rsa-postMessage-worker.html [ Skip ]
 
 imported/w3c/web-platform-tests/WebCryptoAPI [ Pass Slow ]
 webkit.org/b/133122 imported/w3c/web-platform-tests/WebCryptoAPI/encrypt_decrypt/rsa.worker.html [ Failure ]

Modified: trunk/Source/WebCore/ChangeLog (219975 => 219976)


--- trunk/Source/WebCore/ChangeLog	2017-07-27 03:57:19 UTC (rev 219975)
+++ trunk/Source/WebCore/ChangeLog	2017-07-27 08:13:02 UTC (rev 219976)
@@ -1,3 +1,27 @@
+2017-07-27  Zan Dobersek  <[email protected]>
+
+        [GCrypt] Key serialization support
+        https://bugs.webkit.org/show_bug.cgi?id=173883
+
+        Reviewed by Jiewen Tan.
+
+        Implement crypto key serialization for platforms that use libgcrypt.
+
+        Despite the function names and the existing implementation for the Mac port,
+        we don't perform the KEK wrapping and unwrapping due to the review feedback
+        advising against it.
+
+        Instead the passed-in key data is simply copied and returned as the result of
+        the 'wrapping' operation, and similarly the passed-in serialized data is simply
+        copied and returned as the result of the 'unwrapping' operation.
+
+        No new tests -- related tests are now passing and are unskipped.
+
+        * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp:
+        (WebCore::getDefaultWebCryptoMasterKey):
+        (WebCore::wrapSerializedCryptoKey):
+        (WebCore::unwrapSerializedCryptoKey):
+
 2017-07-26  Arnaud Renevier  <[email protected]> and Fujii Hironori  <[email protected]>
 
         Implement new TextMetrics, returned by canvas measureText()

Modified: trunk/Source/WebCore/crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp (219975 => 219976)


--- trunk/Source/WebCore/crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp	2017-07-27 03:57:19 UTC (rev 219975)
+++ trunk/Source/WebCore/crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp	2017-07-27 08:13:02 UTC (rev 219976)
@@ -40,24 +40,27 @@
     return false;
 }
 
+// Initially these helper functions were intended to perform KEK wrapping and unwrapping,
+// but this is not required anymore, despite the function names and the Mac implementation
+// still indicating otherwise.
+// See https://bugs.webkit.org/show_bug.cgi?id=173883 for more info.
+
 bool wrapSerializedCryptoKey(const Vector<uint8_t>& masterKey, const Vector<uint8_t>& key, Vector<uint8_t>& result)
 {
-    notImplemented();
     UNUSED_PARAM(masterKey);
-    UNUSED_PARAM(key);
-    UNUSED_PARAM(result);
 
-    return false;
+    // No wrapping performed -- the serialized key data is copied into the `result` variable.
+    result = Vector<uint8_t>(key);
+    return true;
 }
 
 bool unwrapSerializedCryptoKey(const Vector<uint8_t>& masterKey, const Vector<uint8_t>& wrappedKey, Vector<uint8_t>& key)
 {
-    notImplemented();
     UNUSED_PARAM(masterKey);
-    UNUSED_PARAM(wrappedKey);
-    UNUSED_PARAM(key);
 
-    return false;
+    // No unwrapping performed -- the serialized key data is copied into the `key` variable.
+    key = Vector<uint8_t>(wrappedKey);
+    return true;
 }
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to