Title: [217582] trunk/Source/WebCore
Revision
217582
Author
[email protected]
Date
2017-05-30 16:23:08 -0700 (Tue, 30 May 2017)

Log Message

Unreviewed, add some comments to HKDF/PBKDF2 Mac implementations

* crypto/mac/CryptoAlgorithmHKDFMac.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
* crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (217581 => 217582)


--- trunk/Source/WebCore/ChangeLog	2017-05-30 21:59:14 UTC (rev 217581)
+++ trunk/Source/WebCore/ChangeLog	2017-05-30 23:23:08 UTC (rev 217582)
@@ -1,3 +1,12 @@
+2017-05-30  Jiewen Tan  <[email protected]>
+
+        Unreviewed, add some comments to HKDF/PBKDF2 Mac implementations
+
+        * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
+        (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
+        * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
+        (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
+
 2017-05-30  Jeremy Jones  <[email protected]>
 
         m_resourceSelectionTaskQueue tasks should be cleared when player is destroyed to prevent invalid state.

Modified: trunk/Source/WebCore/crypto/mac/CryptoAlgorithmHKDFMac.cpp (217581 => 217582)


--- trunk/Source/WebCore/crypto/mac/CryptoAlgorithmHKDFMac.cpp	2017-05-30 21:59:14 UTC (rev 217581)
+++ trunk/Source/WebCore/crypto/mac/CryptoAlgorithmHKDFMac.cpp	2017-05-30 23:23:08 UTC (rev 217582)
@@ -46,6 +46,7 @@
         Vector<uint8_t> result(length / 8);
         CCDigestAlgorithm digestAlgorithm;
         getCommonCryptoDigestAlgorithm(hkdfParameters.hashIdentifier, digestAlgorithm);
+        // <rdar://problem/32439455> Currently, when rawKey is null, CCKeyDerivationHMac will bail out.
         if (CCKeyDerivationHMac(kCCKDFAlgorithmHKDF, digestAlgorithm, 0, rawKey.key().data(), rawKey.key().size(), 0, 0, hkdfParameters.infoVector().data(), hkdfParameters.infoVector().size(), 0, 0, hkdfParameters.saltVector().data(), hkdfParameters.saltVector().size(), result.data(), result.size())) {
             // We should only dereference callbacks after being back to the Document/Worker threads.
             context.postTask([exceptionCallback = WTFMove(exceptionCallback), callback = WTFMove(callback)](ScriptExecutionContext& context) {

Modified: trunk/Source/WebCore/crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp (217581 => 217582)


--- trunk/Source/WebCore/crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp	2017-05-30 21:59:14 UTC (rev 217581)
+++ trunk/Source/WebCore/crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp	2017-05-30 23:23:08 UTC (rev 217582)
@@ -63,6 +63,7 @@
         auto& rawKey = downcast<CryptoKeyRaw>(baseKey.get());
 
         Vector<uint8_t> result(length / 8);
+        // <rdar://problem/32439955> Currently, CCKeyDerivationPBKDF bails out when an empty password/salt is provided.
         if (CCKeyDerivationPBKDF(kCCPBKDF2, reinterpret_cast<const char *>(rawKey.key().data()), rawKey.key().size(), pbkdf2Parameters.saltVector().data(), pbkdf2Parameters.saltVector().size(), commonCryptoHMACAlgorithm(pbkdf2Parameters.hashIdentifier), pbkdf2Parameters.iterations, result.data(), length / 8)) {
             // We should only dereference callbacks after being back to the Document/Worker threads.
             context.postTask([exceptionCallback = WTFMove(exceptionCallback), callback = WTFMove(callback)](ScriptExecutionContext& context) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to