1. 04 Dec, 2013 1 commit
    • ap@apple.com's avatar
      Update WebCrypto JWK mapping to newer proposal · e6074e79
      ap@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=124218
      
      Reviewed by Anders Carlsson.
      
      Source/WebCore: 
      
      Tests: crypto/subtle/jwk-export-use-values.html
             crypto/subtle/jwk-import-use-values.html
      
      1. "extractable" renamed to "ext" in JWK.
      2. New values for "use" mapping, which can now be combined into comma separated lists,
      and cover all possible WebCrypto usages.
      
      * bindings/js/JSCryptoKeySerializationJWK.cpp:
      (WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
      (WebCore::JSCryptoKeySerializationJWK::reconcileExtractable):
      (WebCore::JSCryptoKeySerializationJWK::addJWKAlgorithmToJSON):
      (WebCore::processUseValue):
      (WebCore::JSCryptoKeySerializationJWK::addJWKUseToJSON):
      (WebCore::JSCryptoKeySerializationJWK::serialize):
      
      LayoutTests: 
      
      * crypto/subtle/jwk-export-use-values-expected.txt: Added.
      * crypto/subtle/jwk-export-use-values.html: Added.
      * crypto/subtle/jwk-import-use-values-expected.txt: Added.
      * crypto/subtle/jwk-import-use-values.html: Added.
      New tests for "use" mapping.
      
      * crypto/subtle/aes-cbc-import-jwk.html:
      * crypto/subtle/aes-cbc-unwrap-rsa.html:
      * crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html:
      * crypto/subtle/aes-cbc-wrap-rsa.html:
      * crypto/subtle/aes-export-key-expected.txt:
      * crypto/subtle/aes-export-key.html:
      * crypto/subtle/hmac-export-key-expected.txt:
      * crypto/subtle/hmac-export-key.html:
      * crypto/subtle/hmac-import-jwk.html:
      * crypto/subtle/import-jwk-expected.txt:
      * crypto/subtle/import-jwk.html:
      * crypto/subtle/rsa-export-key-expected.txt:
      * crypto/subtle/rsa-export-key.html:
      * crypto/subtle/rsa-export-private-key-expected.txt:
      * crypto/subtle/rsa-export-private-key.html:
      * crypto/subtle/rsa-oaep-key-manipulation-expected.txt:
      * crypto/subtle/rsa-oaep-key-manipulation.html:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e6074e79
  2. 21 Nov, 2013 1 commit
    • ap@apple.com's avatar
      Implement WebCrypto wrapKey · abd0bbca
      ap@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=124738
      
      Reviewed by Anders Carlsson.
      
      Source/WebCore: 
      
      Tests: crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html
             crypto/subtle/aes-cbc-wrap-rsa.html
      
      * bindings/js/JSSubtleCryptoCustom.cpp:
      (WebCore::exportKey): Factored out the actual operation that can be chained with
      encryption for wrapKey.
      (WebCore::JSSubtleCrypto::exportKey):
      (WebCore::JSSubtleCrypto::wrapKey):
      (WebCore::JSSubtleCrypto::unwrapKey): Fixed a memory leak in failure code path.
      
      * crypto/SubtleCrypto.idl: Added wrapKey.
      
      LayoutTests: 
      
      * crypto/subtle/aes-cbc-wrap-rsa-expected.txt: Added.
      * crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt: Added.
      * crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html: Added.
      * crypto/subtle/aes-cbc-wrap-rsa.html: Added.
      
      * crypto/subtle/aes-export-key-expected.txt:
      * crypto/subtle/hmac-export-key-expected.txt:
      There is no longer a console message, the error is in an exception.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159644 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      abd0bbca