Changeset 160534 in webkit


Ignore:
Timestamp:
Dec 13, 2013 12:56:06 AM (10 years ago)
Author:
ap@apple.com
Message:

WebCrypto wrapKey operation doesn't check key usage
https://bugs.webkit.org/show_bug.cgi?id=125675

Reviewed by Darin Adler.

Source/WebCore:

Tests: crypto/subtle/unwrapKey-check-usage.html

crypto/subtle/wrapKey-check-usage.html

  • bindings/js/JSSubtleCryptoCustom.cpp: (WebCore::JSSubtleCrypto::wrapKey):

Added accidentally omitted code. Other operations are fine.

LayoutTests:

  • crypto/subtle/unwrapKey-check-usage-expected.txt: Added.
  • crypto/subtle/unwrapKey-check-usage.html: Added.
  • crypto/subtle/wrapKey-check-usage-expected.txt: Added.
  • crypto/subtle/wrapKey-check-usage.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r160502 r160534  
     12013-12-12  Alexey Proskuryakov  <ap@apple.com>
     2
     3        WebCrypto wrapKey operation doesn't check key usage
     4        https://bugs.webkit.org/show_bug.cgi?id=125675
     5
     6        Reviewed by Darin Adler.
     7
     8        * crypto/subtle/unwrapKey-check-usage-expected.txt: Added.
     9        * crypto/subtle/unwrapKey-check-usage.html: Added.
     10        * crypto/subtle/wrapKey-check-usage-expected.txt: Added.
     11        * crypto/subtle/wrapKey-check-usage.html: Added.
     12
    1132013-12-12  Alexey Proskuryakov  <ap@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r160528 r160534  
     12013-12-12  Alexey Proskuryakov  <ap@apple.com>
     2
     3        WebCrypto wrapKey operation doesn't check key usage
     4        https://bugs.webkit.org/show_bug.cgi?id=125675
     5
     6        Reviewed by Darin Adler.
     7
     8        Tests: crypto/subtle/unwrapKey-check-usage.html
     9               crypto/subtle/wrapKey-check-usage.html
     10
     11        * bindings/js/JSSubtleCryptoCustom.cpp: (WebCore::JSSubtleCrypto::wrapKey):
     12        Added accidentally omitted code. Other operations are fine.
     13
    1142013-12-12  Darin Adler  <darin@apple.com>
    215
  • trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp

    r159966 r160534  
    647647        return throwTypeError(exec);
    648648
     649    if (!wrappingKey->allows(CryptoKeyUsageWrapKey)) {
     650        m_impl->document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, "Key usages do not include 'wrapKey'");
     651        setDOMException(exec, NOT_SUPPORTED_ERR);
     652        return jsUndefined();
     653    }
    649654
    650655    auto algorithm = createAlgorithmFromJSValue(exec, exec->uncheckedArgument(3));
Note: See TracChangeset for help on using the changeset viewer.