1. 12 Dec, 2013 2 commits
    • ap@apple.com's avatar
      Source/WebCore: Replace uses of WTF::BitArray with std::bitset · 5aec375d
      ap@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=125642
      
      Patch by Sam Weinig <sam@webkit.org> on 2013-12-12
      Reviewed by Anders Carlsson.
      
      * css/CSSParser.cpp:
      (WebCore::filterProperties):
      (WebCore::CSSParser::createStyleProperties):
      * css/StyleProperties.cpp:
      (WebCore::StyleProperties::asText):
      
      LayoutTests: Public key in a generated KeyPair should always be extractable
      https://bugs.webkit.org/show_bug.cgi?id=125643
      
      Reviewed by Sam Weinig.
      
      * crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt: Added.
      * crypto/subtle/rsa-oaep-generate-non-extractable-key.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5aec375d
    • ap@apple.com's avatar
      Make algorithm.name return registered name, not normalized one · 8199d8e9
      ap@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=125641
      
      Reviewed by Anders Carlsson.
      
      Source/WebCore: 
      
      Currently, WebCrypto editor's draft stipulates that algorithm name is lowercased
      as part of normalization.
      
      But it makes little sense to register algorithms as mixed (mostly upper) case, yet
      return the name lowercased. Other implementations don't bother respecting this,
      and signs are that the spec will change.
      
      I'd like to match other implementations here, because sticking to the spec only
      makes us fail 3rd party test suites for no good reason.
      
      Updated many existing tests.
      
      * crypto/CryptoAlgorithmRegistry.cpp:
      (WebCore::CryptoAlgorithmRegistry::getIdentifierForName):
      (WebCore::CryptoAlgorithmRegistry::registerAlgorithm):
      * crypto/CryptoAlgorithmRegistry.h:
      * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
      * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
      * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
      * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
      * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
      * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
      * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
      * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
      * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
      * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
      
      LayoutTests: 
      
      * crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt:
      * crypto/subtle/aes-cbc-192-encrypt-decrypt.html:
      * crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt:
      * crypto/subtle/aes-cbc-256-encrypt-decrypt.html:
      * crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt:
      * crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt:
      * crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html:
      * crypto/subtle/aes-cbc-encrypt-decrypt.html:
      * crypto/subtle/aes-cbc-generate-key-expected.txt:
      * crypto/subtle/aes-cbc-generate-key.html:
      * crypto/subtle/aes-cbc-import-jwk-expected.txt:
      * crypto/subtle/aes-cbc-import-jwk.html:
      * crypto/subtle/aes-cbc-invalid-length-expected.txt:
      * crypto/subtle/aes-cbc-invalid-length.html:
      * crypto/subtle/aes-cbc-unwrap-failure-expected.txt:
      * crypto/subtle/aes-cbc-unwrap-failure.html:
      * crypto/subtle/aes-cbc-unwrap-rsa-expected.txt:
      * crypto/subtle/aes-cbc-unwrap-rsa.html:
      * crypto/subtle/aes-cbc-wrap-rsa-expected.txt:
      * crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt:
      * crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html:
      * crypto/subtle/aes-cbc-wrap-rsa.html:
      * crypto/subtle/aes-kw-key-manipulation-expected.txt:
      * crypto/subtle/aes-kw-key-manipulation.html:
      * crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt:
      * crypto/subtle/aes-kw-wrap-unwrap-aes.html:
      * crypto/subtle/aes-postMessage-expected.txt:
      * crypto/subtle/aes-postMessage.html:
      * crypto/subtle/hmac-generate-key-expected.txt:
      * crypto/subtle/hmac-generate-key.html:
      * crypto/subtle/hmac-import-jwk-expected.txt:
      * crypto/subtle/hmac-import-jwk.html:
      * crypto/subtle/hmac-postMessage-expected.txt:
      * crypto/subtle/hmac-postMessage.html:
      * crypto/subtle/hmac-sign-verify-empty-key-expected.txt:
      * crypto/subtle/hmac-sign-verify-empty-key.html:
      * crypto/subtle/hmac-sign-verify-expected.txt:
      * crypto/subtle/hmac-sign-verify.html:
      * crypto/subtle/postMessage-worker-expected.txt:
      * crypto/subtle/postMessage-worker.html:
      * crypto/subtle/resources/postMessage-worker.js:
      * crypto/subtle/rsa-oaep-key-manipulation-expected.txt:
      * crypto/subtle/rsa-oaep-key-manipulation.html:
      * crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt:
      * crypto/subtle/rsa-oaep-wrap-unwrap-aes.html:
      * crypto/subtle/rsa-postMessage-expected.txt:
      * crypto/subtle/rsa-postMessage.html:
      * crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt:
      * crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html:
      * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt:
      * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160491 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8199d8e9
  2. 15 Nov, 2013 1 commit
    • ap@apple.com's avatar
      Update WebCrypto tests · df32d58c
      ap@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=124388
      
      Reviewed by Anders Carlsson.
      
      Updated tests for newer common.js. Changed some tests from just dumping results
      to comparing them to known expected ones. Fixed a syntax error in
      aes-cbc-invalid-length.html, so it now actually runs.
      
      * crypto/subtle/resources/common.js: Update to a new version from Blink, because
      it's much nicer than the old one, and it's good to be compatible at test level.
      Moved crypto.subtle definition from webkitSubtle here to avoid repeating it in all
      tests. Added a quick and dirty Promise.all implementation.
      
      * crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt:
      * crypto/subtle/aes-cbc-192-encrypt-decrypt.html:
      * crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt:
      * crypto/subtle/aes-cbc-256-encrypt-decrypt.html:
      * crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt:
      * crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt:
      * crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html:
      * crypto/subtle/aes-cbc-encrypt-decrypt.html:
      * crypto/subtle/aes-cbc-generate-key.html:
      * crypto/subtle/aes-cbc-import-jwk-expected.txt:
      * crypto/subtle/aes-cbc-import-jwk.html:
      * crypto/subtle/aes-cbc-invalid-length-expected.txt:
      * crypto/subtle/aes-cbc-invalid-length.html:
      * crypto/subtle/aes-cbc-wrong-key-class.html:
      * crypto/subtle/aes-export-key-expected.txt:
      * crypto/subtle/aes-export-key.html:
      * crypto/subtle/argument-conversion-expected.txt:
      * crypto/subtle/argument-conversion.html:
      * crypto/subtle/hmac-export-key-expected.txt:
      * crypto/subtle/hmac-export-key.html:
      * crypto/subtle/hmac-generate-key.html:
      * crypto/subtle/hmac-import-jwk-expected.txt:
      * crypto/subtle/hmac-import-jwk.html:
      * crypto/subtle/hmac-sign-verify-empty-key-expected.txt:
      * crypto/subtle/hmac-sign-verify-empty-key.html:
      * crypto/subtle/hmac-sign-verify-expected.txt:
      * crypto/subtle/hmac-sign-verify.html:
      * crypto/subtle/import-jwk-expected.txt:
      * crypto/subtle/import-jwk.html:
      * crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt:
      * crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html:
      * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt:
      * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html:
      * crypto/subtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt:
      * crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html:
      * crypto/subtle/sha-1-expected.txt:
      * crypto/subtle/sha-1.html:
      * crypto/subtle/sha-224-expected.txt:
      * crypto/subtle/sha-224.html:
      * crypto/subtle/sha-256-expected.txt:
      * crypto/subtle/sha-256.html:
      * crypto/subtle/sha-384-expected.txt:
      * crypto/subtle/sha-384.html:
      * crypto/subtle/sha-512-expected.txt:
      * crypto/subtle/sha-512.html:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      df32d58c
  3. 13 Nov, 2013 3 commits
    • ap@apple.com's avatar
      Implement key generation and JWK import for RSASSA-PKCS1-v1_5 · a237529b
      ap@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=124236
      
      Reviewed by Sam Weinig.
      
      Source/WebCore:
      
      Tests: crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html
             crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html
      
      * WebCore.xcodeproj/project.pbxproj: Added new files.
      
      * bindings/js/JSCryptoAlgorithmBuilder.cpp:
      (WebCore::JSCryptoAlgorithmBuilder::add):
      * bindings/js/JSCryptoAlgorithmBuilder.h:
      * crypto/CryptoAlgorithmDescriptionBuilder.h:
      Added a way to add an Uint8Array, as needed for RSA key.algorithm.publicExponent.
      
      * bindings/js/JSCryptoAlgorithmDictionary.cpp:
      (WebCore::createAesCbcParams): Removed unneeded JSC prefixes.
      (WebCore::createAesKeyGenParams): Ditto.
      (WebCore::createHmacParams): Ditto.
      (WebCore::createHmacKeyParams): Ditto.
      (WebCore::createRsaKeyGenParams): Added.
      (WebCore::createRsaSsaKeyParams): Added. WebCrypto currently doesn't specify any
      parameters for importKey, so the structure remains blank (unlike with JWK).
      (WebCore::createRsaSsaParams): Added (currently unused, will be sued for sign/verify soon).
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt): Removed unneeded JSC prefixes.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt): Ditto.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForSign): Added support for RSAES_PKCS1_v1_5.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForVerify): Ditto.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForDigest): Removed unneeded JSC prefixes.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey): Ditto.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveKey): Ditto.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveBits): Ditto.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey): Added support for RSAES_PKCS1_v1_5.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForExportKey): Removed unneeded JSC prefixes.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForWrapKey): Ditto.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForUnwrapKey): Ditto.
      
      * bindings/js/JSCryptoKeySerializationJWK.h:
      * bindings/js/JSCryptoKeySerializationJWK.cpp:
      (WebCore::getJSArrayFromJSON): Added.
      (WebCore::getBigIntegerVectorFromJSON): Added.
      (WebCore::createRSASSAKeyParameters): Create parameters for key import. The key
      will remember which algorithm it's allowed to be used with.
      (WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm): Added support for
      RS256...RS512 (tha is, RSAES_PKCS1_v1_5 with SHA-256...SHA-512).
      (WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence): Split out of keyData().
      (WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents): Added code to read
      RSA key components from JWK.
      (WebCore::JSCryptoKeySerializationJWK::keyData): Call one of the above functions.
      
      * crypto/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp: Added.
      (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
      (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
      Placeholders.
      
      * crypto/CryptoKey.h: (WebCore::CryptoKeyClass): Added RSA key class for poor man's RTTI.
      
      * crypto/CryptoKeyData.h: (WebCore::CryptoKeyData::FormatRSAComponents): Added RSAComponents
      for poor man's RTTI.
      
      * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp: (WebCore::CryptoAlgorithmAES_CBC::importKey):
      * crypto/algorithms/CryptoAlgorithmHMAC.cpp: (WebCore::CryptoAlgorithmHMAC::importKey):
      * crypto/keys/CryptoKeyAES.h:
      (WebCore::isCryptoKeyAES):
      (WebCore::toCryptoKeyAES):
      * crypto/keys/CryptoKeyDataOctetSequence.h:
      (WebCore::toCryptoKeyDataOctetSequence):
      * crypto/keys/CryptoKeyHMAC.h:
      (WebCore::isCryptoKeyHMAC):
      (WebCore::toCryptoKeyHMAC):
      * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
      (WebCore::CryptoAlgorithmAES_CBC::encrypt):
      (WebCore::CryptoAlgorithmAES_CBC::decrypt):
      * crypto/mac/CryptoAlgorithmHMACMac.cpp:
      (WebCore::CryptoAlgorithmHMAC::sign):
      (WebCore::CryptoAlgorithmHMAC::verify):
      Switched from "as" functions to "is" and "to" ones, as that's more idiomatic.
      
      * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp: Added.
      * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h: Added.
      Glue code for importKey/generateKey for now.
      
      * crypto/keys/CryptoKeyDataRSAComponents.cpp: Added.
      (WebCore::CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents):
      (WebCore::CryptoKeyDataRSAComponents::~CryptoKeyDataRSAComponents):
      * crypto/keys/CryptoKeyDataRSAComponents.h: Added.
      (WebCore::toCryptoKeyDataRSAComponents):
      Added a structure to hold RSA key components, extracted from JWK or another format.
      
      * crypto/keys/CryptoKeyRSA.h: Added.
      * crypto/mac/CryptoKeyRSAMac.cpp: Added.
      
      * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
      (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
      Register RSASSA_PKCS1_v1_5.
      
      * crypto/parameters/CryptoAlgorithmHmacKeyParams.h: Added a constructor to make
      sure that hasLength is never left uninitialized, even when reading formats that
      don't contain a length.
      
      * crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h: Added.
      * crypto/parameters/CryptoAlgorithmRsaSsaKeyParams.h: Added.
      * crypto/parameters/CryptoAlgorithmRsaSsaParams.h: Added.
      Added parameter structures that are needed for RSASSA_PKCS1_v1_5.
      
      LayoutTests:
      
      * crypto/subtle/resources/common.js:
      (hexToArrayBuffer): Fixed a typo
      (Base64URL.stringify):
      (Base64URL.parse):
      Added helpers to deal with Base64URL, as needed for JWK.
      
      * crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt: Added.
      * crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html: Added.
      * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt: Added.
      * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159180 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a237529b
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r159160, r159161, and r159164. · 388f415d
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/159160
      http://trac.webkit.org/changeset/159161
      http://trac.webkit.org/changeset/159164
      https://bugs.webkit.org/show_bug.cgi?id=124253
      
      Too many errors (make fewer) (Requested by ap on #webkit).
      
      Source/WebCore:
      
      * WebCore.xcodeproj/project.pbxproj:
      * bindings/js/JSCryptoAlgorithmBuilder.cpp:
      * bindings/js/JSCryptoAlgorithmBuilder.h:
      * bindings/js/JSCryptoAlgorithmDictionary.cpp:
      (WebCore::createAesCbcParams):
      (WebCore::createAesKeyGenParams):
      (WebCore::createHmacParams):
      (WebCore::createHmacKeyParams):
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt):
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt):
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForSign):
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForVerify):
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForDigest):
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey):
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveKey):
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveBits):
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey):
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForExportKey):
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForWrapKey):
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForUnwrapKey):
      * bindings/js/JSCryptoKeySerializationJWK.cpp:
      (WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
      (WebCore::JSCryptoKeySerializationJWK::keyData):
      * bindings/js/JSCryptoKeySerializationJWK.h:
      * crypto/CryptoAlgorithmDescriptionBuilder.h:
      * crypto/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp: Removed.
      * crypto/CryptoKey.h:
      (WebCore::ENUM_CLASS):
      * crypto/CryptoKeyData.h:
      (WebCore::CryptoKeyData::ENUM_CLASS):
      * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
      (WebCore::CryptoAlgorithmAES_CBC::importKey):
      * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
      (WebCore::CryptoAlgorithmHMAC::importKey):
      * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp: Removed.
      * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h: Removed.
      * crypto/keys/CryptoKeyAES.h:
      (WebCore::asCryptoKeyAES):
      * crypto/keys/CryptoKeyDataOctetSequence.h:
      (WebCore::asCryptoKeyDataOctetSequence):
      * crypto/keys/CryptoKeyDataRSAComponents.cpp: Removed.
      * crypto/keys/CryptoKeyDataRSAComponents.h: Removed.
      * crypto/keys/CryptoKeyHMAC.h:
      (WebCore::asCryptoKeyHMAC):
      * crypto/keys/CryptoKeyRSA.h: Removed.
      * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
      (WebCore::CryptoAlgorithmAES_CBC::encrypt):
      (WebCore::CryptoAlgorithmAES_CBC::decrypt):
      * crypto/mac/CryptoAlgorithmHMACMac.cpp:
      (WebCore::CryptoAlgorithmHMAC::sign):
      (WebCore::CryptoAlgorithmHMAC::verify):
      * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
      (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
      * crypto/mac/CryptoKeyRSAMac.cpp: Removed.
      * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
      * crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h: Removed.
      * crypto/parameters/CryptoAlgorithmRsaSsaKeyParams.h: Removed.
      * crypto/parameters/CryptoAlgorithmRsaSsaParams.h: Removed.
      
      LayoutTests:
      
      * crypto/subtle/resources/common.js:
      (hexToArrayBuffer):
      * crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt: Removed.
      * crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html: Removed.
      * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt: Removed.
      * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html: Removed.
      * platform/mac/TestExpectations:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      388f415d
    • ap@apple.com's avatar
      Implement key generation and JWK import for RSASSA-PKCS1-v1_5 · c0d58adc
      ap@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=124236
      
      Reviewed by Sam Weinig.
      
      Source/WebCore: 
      
      Tests: crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html
             crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html
      
      * WebCore.xcodeproj/project.pbxproj: Added new files.
      
      * bindings/js/JSCryptoAlgorithmBuilder.cpp:
      (WebCore::JSCryptoAlgorithmBuilder::add):
      * bindings/js/JSCryptoAlgorithmBuilder.h:
      * crypto/CryptoAlgorithmDescriptionBuilder.h:
      Added a way to add an Uint8Array, as needed for RSA key.algorithm.publicExponent.
      
      * bindings/js/JSCryptoAlgorithmDictionary.cpp:
      (WebCore::createAesCbcParams): Removed unneeded JSC prefixes.
      (WebCore::createAesKeyGenParams): Ditto.
      (WebCore::createHmacParams): Ditto.
      (WebCore::createHmacKeyParams): Ditto.
      (WebCore::createRsaKeyGenParams): Added. 
      (WebCore::createRsaSsaKeyParams): Added. WebCrypto currently doesn't specify any
      parameters for importKey, so the structure remains blank (unlike with JWK).
      (WebCore::createRsaSsaParams): Added (currently unused, will be sued for sign/verify soon).
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt): Removed unneeded JSC prefixes.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt): Ditto.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForSign): Added support for RSAES_PKCS1_v1_5.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForVerify): Ditto.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForDigest): Removed unneeded JSC prefixes.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey): Ditto.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveKey): Ditto.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveBits): Ditto.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey): Added support for RSAES_PKCS1_v1_5.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForExportKey): Removed unneeded JSC prefixes.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForWrapKey): Ditto.
      (WebCore::JSCryptoAlgorithmDictionary::createParametersForUnwrapKey): Ditto.
      
      * bindings/js/JSCryptoKeySerializationJWK.h:
      * bindings/js/JSCryptoKeySerializationJWK.cpp:
      (WebCore::getJSArrayFromJSON): Added.
      (WebCore::getBigIntegerVectorFromJSON): Added.
      (WebCore::createRSASSAKeyParameters): Create parameters for key import. The key
      will remember which algorithm it's allowed to be used with.
      (WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm): Added support for
      RS256...RS512 (tha is, RSAES_PKCS1_v1_5 with SHA-256...SHA-512).
      (WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence): Split out of keyData().
      (WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents): Added code to read
      RSA key components from JWK.
      (WebCore::JSCryptoKeySerializationJWK::keyData): Call one of the above functions.
      
      * crypto/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp: Added.
      (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
      (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
      Placeholders.
      
      * crypto/CryptoKey.h: (WebCore::CryptoKeyClass): Added RSA key class for poor man's RTTI.
      
      * crypto/CryptoKeyData.h: (WebCore::CryptoKeyData::FormatRSAComponents): Added RSAComponents
      for poor man's RTTI.
      
      * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp: (WebCore::CryptoAlgorithmAES_CBC::importKey): 
      * crypto/algorithms/CryptoAlgorithmHMAC.cpp: (WebCore::CryptoAlgorithmHMAC::importKey):
      * crypto/keys/CryptoKeyAES.h:
      (WebCore::isCryptoKeyAES):
      (WebCore::toCryptoKeyAES):
      * crypto/keys/CryptoKeyDataOctetSequence.h:
      (WebCore::toCryptoKeyDataOctetSequence):
      * crypto/keys/CryptoKeyHMAC.h:
      (WebCore::isCryptoKeyHMAC):
      (WebCore::toCryptoKeyHMAC):
      * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
      (WebCore::CryptoAlgorithmAES_CBC::encrypt):
      (WebCore::CryptoAlgorithmAES_CBC::decrypt):
      * crypto/mac/CryptoAlgorithmHMACMac.cpp:
      (WebCore::CryptoAlgorithmHMAC::sign):
      (WebCore::CryptoAlgorithmHMAC::verify):
      Switched from "as" functions to "is" and "to" ones, as that's more idiomatic.
      
      * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp: Added.
      * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h: Added.
      Glue code for importKey/generateKey for now.
      
      * crypto/keys/CryptoKeyDataRSAComponents.cpp: Added.
      (WebCore::CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents):
      (WebCore::CryptoKeyDataRSAComponents::~CryptoKeyDataRSAComponents):
      * crypto/keys/CryptoKeyDataRSAComponents.h: Added.
      (WebCore::toCryptoKeyDataRSAComponents):
      Added a structure to hold RSA key components, extracted from JWK or another format.
      
      * crypto/keys/CryptoKeyRSA.h: Added.
      * crypto/mac/CryptoKeyRSAMac.cpp: Added.
      
      * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
      (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
      Register RSASSA_PKCS1_v1_5.
      
      * crypto/parameters/CryptoAlgorithmHmacKeyParams.h: Added a constructor to make
      sure that hasLength is never left uninitialized, even when reading formats that
      don't contain a length.
      
      * crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h: Added.
      * crypto/parameters/CryptoAlgorithmRsaSsaKeyParams.h: Added.
      * crypto/parameters/CryptoAlgorithmRsaSsaParams.h: Added.
      Added parameter structures that are needed for RSASSA_PKCS1_v1_5.
      
      LayoutTests: 
      
      * crypto/subtle/resources/common.js:
      (hexToArrayBuffer): Fixed a typo
      (Base64URL.stringify):
      (Base64URL.parse):
      Added helpers to deal with Base64URL, as needed for JWK.
      
      * crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt: Added.
      * crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html: Added.
      * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt: Added.
      * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c0d58adc