⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 219976 in webkit


Ignore:
Timestamp:
Jul 27, 2017, 1:13:02 AM (9 years ago)
Author:
zandobersek@gmail.com
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.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r219970 r219976  
     12017-07-27  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [GCrypt] Key serialization support
     4        https://bugs.webkit.org/show_bug.cgi?id=173883
     5
     6        Reviewed by Jiewen Tan.
     7
     8        * platform/wpe/TestExpectations: Unskip the crypto/worker/ tests that
     9        utilize key serialization and are now passing.
     10
    1112017-07-26  Arnaud Renevier  <a.renevier@sisa.samsung.com> and Fujii Hironori  <Hironori.Fujii@sony.com>
    212
  • trunk/LayoutTests/platform/wpe/TestExpectations

    r219913 r219976  
    441441webkit.org/b/133122 crypto/workers/subtle/aes-cfb-import-key-unwrap-key.html [ Skip ]
    442442webkit.org/b/133122 crypto/workers/subtle/aes-cfb-import-key-wrap-key.html [ Skip ]
    443 webkit.org/b/133122 crypto/workers/subtle/aes-postMessage-worker.html [ Skip ]
    444 webkit.org/b/133122 crypto/workers/subtle/ec-generate-export-pkcs8-key.html [ Skip ]
    445 webkit.org/b/133122 crypto/workers/subtle/ec-generate-export-spki-key.html [ Skip ]
    446443webkit.org/b/133122 crypto/workers/subtle/ec-import-pkcs8-key.html [ Skip ]
    447 webkit.org/b/133122 crypto/workers/subtle/ec-import-spki-key.html [ Skip ]
    448444webkit.org/b/133122 crypto/workers/subtle/ec-postMessage-worker.html [ Skip ]
    449 webkit.org/b/133122 crypto/workers/subtle/hmac-postMessage-worker.html [ Skip ]
    450 webkit.org/b/133122 crypto/workers/subtle/hrsa-postMessage-worker.html [ Skip ]
    451 webkit.org/b/133122 crypto/workers/subtle/multiple-postMessage-worker.html [ Skip ]
    452 webkit.org/b/133122 crypto/workers/subtle/raw-postMessage-worker.html [ Skip ]
    453 webkit.org/b/133122 crypto/workers/subtle/rsa-export-pkcs8-key.html [ Skip ]
    454 webkit.org/b/133122 crypto/workers/subtle/rsa-export-spki-key.html [ Skip ]
    455 webkit.org/b/133122 crypto/workers/subtle/rsa-import-pkcs8-key.html [ Skip ]
    456 webkit.org/b/133122 crypto/workers/subtle/rsa-import-spki-key.html [ Skip ]
    457 webkit.org/b/133122 crypto/workers/subtle/rsa-postMessage-worker.html [ Skip ]
    458445
    459446imported/w3c/web-platform-tests/WebCryptoAPI [ Pass Slow ]
  • trunk/Source/WebCore/ChangeLog

    r219970 r219976  
     12017-07-27  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [GCrypt] Key serialization support
     4        https://bugs.webkit.org/show_bug.cgi?id=173883
     5
     6        Reviewed by Jiewen Tan.
     7
     8        Implement crypto key serialization for platforms that use libgcrypt.
     9
     10        Despite the function names and the existing implementation for the Mac port,
     11        we don't perform the KEK wrapping and unwrapping due to the review feedback
     12        advising against it.
     13
     14        Instead the passed-in key data is simply copied and returned as the result of
     15        the 'wrapping' operation, and similarly the passed-in serialized data is simply
     16        copied and returned as the result of the 'unwrapping' operation.
     17
     18        No new tests -- related tests are now passing and are unskipped.
     19
     20        * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp:
     21        (WebCore::getDefaultWebCryptoMasterKey):
     22        (WebCore::wrapSerializedCryptoKey):
     23        (WebCore::unwrapSerializedCryptoKey):
     24
    1252017-07-26  Arnaud Renevier  <a.renevier@sisa.samsung.com> and Fujii Hironori  <Hironori.Fujii@sony.com>
    226
  • trunk/Source/WebCore/crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp

    r214538 r219976  
    4141}
    4242
     43// Initially these helper functions were intended to perform KEK wrapping and unwrapping,
     44// but this is not required anymore, despite the function names and the Mac implementation
     45// still indicating otherwise.
     46// See https://bugs.webkit.org/show_bug.cgi?id=173883 for more info.
     47
    4348bool wrapSerializedCryptoKey(const Vector<uint8_t>& masterKey, const Vector<uint8_t>& key, Vector<uint8_t>& result)
    4449{
    45     notImplemented();
    4650    UNUSED_PARAM(masterKey);
    47     UNUSED_PARAM(key);
    48     UNUSED_PARAM(result);
    4951
    50     return false;
     52    // No wrapping performed -- the serialized key data is copied into the `result` variable.
     53    result = Vector<uint8_t>(key);
     54    return true;
    5155}
    5256
    5357bool unwrapSerializedCryptoKey(const Vector<uint8_t>& masterKey, const Vector<uint8_t>& wrappedKey, Vector<uint8_t>& key)
    5458{
    55     notImplemented();
    5659    UNUSED_PARAM(masterKey);
    57     UNUSED_PARAM(wrappedKey);
    58     UNUSED_PARAM(key);
    5960
    60     return false;
     61    // No unwrapping performed -- the serialized key data is copied into the `key` variable.
     62    key = Vector<uint8_t>(wrappedKey);
     63    return true;
    6164}
    6265
Note: See TracChangeset for help on using the changeset viewer.