Changeset 159975 in webkit


Ignore:
Timestamp:
Dec 2, 2013 3:43:01 PM (10 years ago)
Author:
ap@apple.com
Message:

WebCrypto HMAC doesn't check key algorithm's hash
https://bugs.webkit.org/show_bug.cgi?id=125114

Reviewed by Anders Carlsson.

Source/WebCore:

Test: crypto/subtle/hmac-check-algorithm.html

  • crypto/algorithms/CryptoAlgorithmHMAC.cpp:

(WebCore::CryptoAlgorithmHMAC::keyAlgorithmMatches): Check it.

LayoutTests:

  • crypto/subtle/hmac-check-algorithm-expected.txt: Added.
  • crypto/subtle/hmac-check-algorithm.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r159968 r159975  
     12013-12-02  Alexey Proskuryakov  <ap@apple.com>
     2
     3        WebCrypto HMAC doesn't check key algorithm's hash
     4        https://bugs.webkit.org/show_bug.cgi?id=125114
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * crypto/subtle/hmac-check-algorithm-expected.txt: Added.
     9        * crypto/subtle/hmac-check-algorithm.html: Added.
     10
    1112013-12-02  Zoltan Horvath  <zoltan@webkit.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r159974 r159975  
     12013-12-02  Alexey Proskuryakov  <ap@apple.com>
     2
     3        WebCrypto HMAC doesn't check key algorithm's hash
     4        https://bugs.webkit.org/show_bug.cgi?id=125114
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Test: crypto/subtle/hmac-check-algorithm.html
     9
     10        * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
     11        (WebCore::CryptoAlgorithmHMAC::keyAlgorithmMatches): Check it.
     12
    1132013-12-02  Brady Eidson  <beidson@apple.com>
    214
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp

    r159717 r159975  
    5757}
    5858
    59 bool CryptoAlgorithmHMAC::keyAlgorithmMatches(const CryptoAlgorithmHmacParams&, const CryptoKey& key) const
     59bool CryptoAlgorithmHMAC::keyAlgorithmMatches(const CryptoAlgorithmHmacParams& parameters, const CryptoKey& key) const
    6060{
    6161    if (key.algorithmIdentifier() != s_identifier)
    6262        return false;
    6363    ASSERT(isCryptoKeyHMAC(key));
     64
     65    if (toCryptoKeyHMAC(key).hashAlgorithmIdentifier() != parameters.hash)
     66        return false;
    6467
    6568    return true;
Note: See TracChangeset for help on using the changeset viewer.