Changeset 159299 in webkit


Ignore:
Timestamp:
Nov 14, 2013, 11:56:37 AM (11 years ago)
Author:
ap@apple.com
Message:

[Mac] HMAC sign/verify crashes when key is empty
https://bugs.webkit.org/show_bug.cgi?id=124372

Reviewed by Sam Weinig.

Source/WebCore:

Test: crypto/subtle/hmac-sign-verify-empty-key.html

  • crypto/mac/CryptoAlgorithmHMACMac.cpp: (WebCore::calculateSignature): Give it

a non-null pointer then.

LayoutTests:

  • crypto/subtle/hmac-sign-verify-empty-key-expected.txt: Added.
  • crypto/subtle/hmac-sign-verify-empty-key.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r159295 r159299  
     12013-11-14  Alexey Proskuryakov  <ap@apple.com>
     2
     3        [Mac] HMAC sign/verify crashes when key is empty
     4        https://bugs.webkit.org/show_bug.cgi?id=124372
     5
     6        Reviewed by Sam Weinig.
     7
     8        * crypto/subtle/hmac-sign-verify-empty-key-expected.txt: Added.
     9        * crypto/subtle/hmac-sign-verify-empty-key.html: Added.
     10
    1112013-11-14  Samuel White  <samuel_white@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r159296 r159299  
     12013-11-14  Alexey Proskuryakov  <ap@apple.com>
     2
     3        [Mac] HMAC sign/verify crashes when key is empty
     4        https://bugs.webkit.org/show_bug.cgi?id=124372
     5
     6        Reviewed by Sam Weinig.
     7
     8        Test: crypto/subtle/hmac-sign-verify-empty-key.html
     9
     10        * crypto/mac/CryptoAlgorithmHMACMac.cpp: (WebCore::calculateSignature): Give it
     11        a non-null pointer then.
     12
    1132013-11-14  Alexey Proskuryakov  <ap@apple.com>
    214
  • trunk/Source/WebCore/crypto/mac/CryptoAlgorithmHMACMac.cpp

    r159213 r159299  
    8484
    8585    CCHmacContext context;
    86     CCHmacInit(&context, algorithm, key.data(), key.size());
     86    const char* keyData = key.data() ? key.data() : ""; // <rdar://problem/15467425> HMAC crashes when key pointer is null.
     87    CCHmacInit(&context, algorithm, keyData, key.size());
    8788    for (size_t i = 0, size = data.size(); i < size; ++i)
    8889        CCHmacUpdate(&context, data[i].first, data[i].second);
Note: See TracChangeset for help on using the changeset viewer.