Changeset 160491 in webkit


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

Make algorithm.name return registered name, not normalized one
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:
Location:
trunk
Files:
65 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r160489 r160491  
     12013-12-12  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Make algorithm.name return registered name, not normalized one
     4        https://bugs.webkit.org/show_bug.cgi?id=125641
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt:
     9        * crypto/subtle/aes-cbc-192-encrypt-decrypt.html:
     10        * crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt:
     11        * crypto/subtle/aes-cbc-256-encrypt-decrypt.html:
     12        * crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt:
     13        * crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt:
     14        * crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html:
     15        * crypto/subtle/aes-cbc-encrypt-decrypt.html:
     16        * crypto/subtle/aes-cbc-generate-key-expected.txt:
     17        * crypto/subtle/aes-cbc-generate-key.html:
     18        * crypto/subtle/aes-cbc-import-jwk-expected.txt:
     19        * crypto/subtle/aes-cbc-import-jwk.html:
     20        * crypto/subtle/aes-cbc-invalid-length-expected.txt:
     21        * crypto/subtle/aes-cbc-invalid-length.html:
     22        * crypto/subtle/aes-cbc-unwrap-failure-expected.txt:
     23        * crypto/subtle/aes-cbc-unwrap-failure.html:
     24        * crypto/subtle/aes-cbc-unwrap-rsa-expected.txt:
     25        * crypto/subtle/aes-cbc-unwrap-rsa.html:
     26        * crypto/subtle/aes-cbc-wrap-rsa-expected.txt:
     27        * crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt:
     28        * crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html:
     29        * crypto/subtle/aes-cbc-wrap-rsa.html:
     30        * crypto/subtle/aes-kw-key-manipulation-expected.txt:
     31        * crypto/subtle/aes-kw-key-manipulation.html:
     32        * crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt:
     33        * crypto/subtle/aes-kw-wrap-unwrap-aes.html:
     34        * crypto/subtle/aes-postMessage-expected.txt:
     35        * crypto/subtle/aes-postMessage.html:
     36        * crypto/subtle/hmac-generate-key-expected.txt:
     37        * crypto/subtle/hmac-generate-key.html:
     38        * crypto/subtle/hmac-import-jwk-expected.txt:
     39        * crypto/subtle/hmac-import-jwk.html:
     40        * crypto/subtle/hmac-postMessage-expected.txt:
     41        * crypto/subtle/hmac-postMessage.html:
     42        * crypto/subtle/hmac-sign-verify-empty-key-expected.txt:
     43        * crypto/subtle/hmac-sign-verify-empty-key.html:
     44        * crypto/subtle/hmac-sign-verify-expected.txt:
     45        * crypto/subtle/hmac-sign-verify.html:
     46        * crypto/subtle/postMessage-worker-expected.txt:
     47        * crypto/subtle/postMessage-worker.html:
     48        * crypto/subtle/resources/postMessage-worker.js:
     49        * crypto/subtle/rsa-oaep-key-manipulation-expected.txt:
     50        * crypto/subtle/rsa-oaep-key-manipulation.html:
     51        * crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt:
     52        * crypto/subtle/rsa-oaep-wrap-unwrap-aes.html:
     53        * crypto/subtle/rsa-postMessage-expected.txt:
     54        * crypto/subtle/rsa-postMessage.html:
     55        * crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt:
     56        * crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html:
     57        * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt:
     58        * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html:
     59
    1602013-12-12  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
    261
  • trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt

    r159327 r160491  
    77PASS key.type is 'secret'
    88PASS key.extractable is true
    9 PASS key.algorithm.name is 'aes-cbc'
     9PASS key.algorithm.name is 'AES-CBC'
    1010PASS key.algorithm.length is 192
    1111PASS key.usages is ['encrypt', 'decrypt']
  • trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html

    r159379 r160491  
    2424    shouldBe("key.type", "'secret'");
    2525    shouldBe("key.extractable", "true");
    26     shouldBe("key.algorithm.name", "'aes-cbc'");
     26    shouldBe("key.algorithm.name", "'AES-CBC'");
    2727    shouldBe("key.algorithm.length", "192");
    2828    shouldBe("key.usages", "['encrypt', 'decrypt']");
  • trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt

    r159327 r160491  
    77PASS key.type is 'secret'
    88PASS key.extractable is true
    9 PASS key.algorithm.name is 'aes-cbc'
     9PASS key.algorithm.name is 'AES-CBC'
    1010PASS key.algorithm.length is 256
    1111PASS key.usages is ['encrypt', 'decrypt']
  • trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html

    r159379 r160491  
    2424    shouldBe("key.type", "'secret'");
    2525    shouldBe("key.extractable", "true");
    26     shouldBe("key.algorithm.name", "'aes-cbc'");
     26    shouldBe("key.algorithm.name", "'AES-CBC'");
    2727    shouldBe("key.algorithm.length", "256");
    2828    shouldBe("key.usages", "['encrypt', 'decrypt']");
  • trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt

    r159379 r160491  
    77PASS key.type is 'secret'
    88PASS key.extractable is true
    9 PASS key.algorithm.name is 'aes-cbc'
     9PASS key.algorithm.name is 'AES-CBC'
    1010PASS key.algorithm.length is 128
    1111PASS key.usages is ['encrypt', 'decrypt']
  • trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt

    r159327 r160491  
    77PASS key.type is 'secret'
    88PASS key.extractable is true
    9 PASS key.algorithm.name is 'aes-cbc'
     9PASS key.algorithm.name is 'AES-CBC'
    1010PASS key.algorithm.length is 128
    1111PASS key.usages is ['encrypt', 'decrypt']
  • trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html

    r159379 r160491  
    2424    shouldBe("key.type", "'secret'");
    2525    shouldBe("key.extractable", "true");
    26     shouldBe("key.algorithm.name", "'aes-cbc'");
     26    shouldBe("key.algorithm.name", "'AES-CBC'");
    2727    shouldBe("key.algorithm.length", "128");
    2828    shouldBe("key.usages", "['encrypt', 'decrypt']");
  • trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html

    r159379 r160491  
    2424    shouldBe("key.type", "'secret'");
    2525    shouldBe("key.extractable", "true");
    26     shouldBe("key.algorithm.name", "'aes-cbc'");
     26    shouldBe("key.algorithm.name", "'AES-CBC'");
    2727    shouldBe("key.algorithm.length", "128");
    2828    shouldBe("key.usages", "['encrypt', 'decrypt']");
  • trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt

    r158582 r160491  
    1111PASS key.type is 'secret'
    1212PASS key.extractable is true
    13 PASS key.algorithm.name is 'aes-cbc'
     13PASS key.algorithm.name is 'AES-CBC'
    1414PASS key.algorithm.length is 128
    1515PASS key.usages is ['encrypt', 'decrypt']
  • trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html

    r159327 r160491  
    2727    shouldBe("key.type", "'secret'");
    2828    shouldBe("key.extractable", "true");
    29     shouldBe("key.algorithm.name", "'aes-cbc'");
     29    shouldBe("key.algorithm.name", "'AES-CBC'");
    3030    shouldBe("key.algorithm.length", "128");
    3131    shouldBe("key.usages", "['encrypt', 'decrypt']");
  • trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-expected.txt

    r159327 r160491  
    88PASS key.type is 'secret'
    99PASS key.extractable is false
    10 PASS key.algorithm.name is 'aes-cbc'
     10PASS key.algorithm.name is 'AES-CBC'
    1111PASS key.algorithm.length is 192
    1212PASS key.usages is ["encrypt"]
  • trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk.html

    r160061 r160491  
    3535    shouldBe("key.type", "'secret'");
    3636    shouldBe("key.extractable", "false");
    37     shouldBe("key.algorithm.name", "'aes-cbc'");
     37    shouldBe("key.algorithm.name", "'AES-CBC'");
    3838    shouldBe("key.algorithm.length", "192");
    3939    shouldBe("key.usages", '["encrypt"]');
  • trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt

    r159327 r160491  
    77PASS key.type is 'secret'
    88PASS key.extractable is true
    9 PASS key.algorithm.name is 'aes-cbc'
     9PASS key.algorithm.name is 'AES-CBC'
    1010PASS key.algorithm.length is 176
    1111PASS key.usages is ['encrypt', 'decrypt']
  • trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html

    r159327 r160491  
    2424    shouldBe("key.type", "'secret'");
    2525    shouldBe("key.extractable", "true");
    26     shouldBe("key.algorithm.name", "'aes-cbc'");
     26    shouldBe("key.algorithm.name", "'AES-CBC'");
    2727    shouldBe("key.algorithm.length", "176");
    2828    shouldBe("key.usages", "['encrypt', 'decrypt']");
  • trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure-expected.txt

    r159637 r160491  
    55
    66Importing an unwrapping key...
    7 PASS unwrappingKey.algorithm.name is 'aes-cbc'
     7PASS unwrappingKey.algorithm.name is 'AES-CBC'
    88Unwrapping a key...
    99PASS Promise rejected
  • trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html

    r159637 r160491  
    2323crypto.subtle.importKey("raw", unwrappingKeyOctets, "AES-CBC", nonExtractable, ["unwrapKey"]).then(function(result) {
    2424    unwrappingKey = result;
    25     shouldBe("unwrappingKey.algorithm.name", "'aes-cbc'");
     25    shouldBe("unwrappingKey.algorithm.name", "'AES-CBC'");
    2626    var unwrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
    2727    debug("Unwrapping a key...");
  • trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa-expected.txt

    r159637 r160491  
    55
    66Importing an unwrapping key...
    7 PASS unwrappingKey.algorithm.name is 'aes-cbc'
     7PASS unwrappingKey.algorithm.name is 'AES-CBC'
    88Unwrapping a key...
    99PASS unwrappedKey.toString() is '[object Key]'
    1010PASS unwrappedKey.type is 'public'
    1111PASS unwrappedKey.usages is ['sign','verify']
    12 PASS unwrappedKey.algorithm.name is 'rsassa-pkcs1-v1_5'
     12PASS unwrappedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
    1313PASS unwrappedKey.algorithm.modulusLength is 2048
    1414PASS Base64URL.stringify(unwrappedKey.algorithm.publicExponent) is publicKeyJSON.e
    15 PASS unwrappedKey.algorithm.hash.name is 'sha-256'
     15PASS unwrappedKey.algorithm.hash.name is 'SHA-256'
    1616PASS unwrappedKey.extractable is false
    1717PASS successfullyParsed is true
  • trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html

    r160061 r160491  
    3232crypto.subtle.importKey("raw", unwrappingKeyOctets, "AES-CBC", nonExtractable, ["unwrapKey"]).then(function(result) {
    3333    unwrappingKey = result;
    34     shouldBe("unwrappingKey.algorithm.name", "'aes-cbc'");
     34    shouldBe("unwrappingKey.algorithm.name", "'AES-CBC'");
    3535    var unwrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
    3636    debug("Unwrapping a key...");
     
    4242    shouldBe("unwrappedKey.type", "'public'");
    4343    shouldBe("unwrappedKey.usages", "['sign','verify']");
    44     shouldBe("unwrappedKey.algorithm.name", "'rsassa-pkcs1-v1_5'");
     44    shouldBe("unwrappedKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
    4545    shouldBe("unwrappedKey.algorithm.modulusLength", "2048");
    4646    shouldBe("Base64URL.stringify(unwrappedKey.algorithm.publicExponent)", "publicKeyJSON.e");
    47     shouldBe("unwrappedKey.algorithm.hash.name", "'sha-256'");
     47    shouldBe("unwrappedKey.algorithm.hash.name", "'SHA-256'");
    4848    shouldBe("unwrappedKey.extractable", "false");
    4949    finishJSTest();
  • trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-expected.txt

    r159644 r160491  
    55
    66Importing a key to wrap...
    7 PASS key.algorithm.name is 'rsassa-pkcs1-v1_5'
     7PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
    88Importing a key encryption key...
    9 PASS wrappingKey.algorithm.name is 'aes-cbc'
     9PASS wrappingKey.algorithm.name is 'AES-CBC'
    1010PASS wrappedKey.toString() is '[object ArrayBuffer]'
    1111PASS successfullyParsed is true
  • trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt

    r159644 r160491  
    55
    66Importing a key to wrap...
    7 PASS key.algorithm.name is 'rsassa-pkcs1-v1_5'
     7PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
    88Importing a key encryption key...
    9 PASS wrappingKey.algorithm.name is 'aes-cbc'
     9PASS wrappingKey.algorithm.name is 'AES-CBC'
    1010wrapping the key...
    1111PASS Rejected
  • trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html

    r160061 r160491  
    3232crypto.subtle.importKey("jwk", jwkKeyAsArrayBuffer, null, extractable, ["sign", "verify"]).then(function(result) {
    3333    key = result;
    34     shouldBe("key.algorithm.name", "'rsassa-pkcs1-v1_5'");
     34    shouldBe("key.algorithm.name", "'RSASSA-PKCS1-v1_5'");
    3535    debug("Importing a key encryption key...");
    3636    return crypto.subtle.importKey("raw", wrappingKeyOctets, "AES-CBC", nonExtractable, ["wrapKey"]);
    3737}).then(function(result) {
    3838    wrappingKey = result;
    39     shouldBe("wrappingKey.algorithm.name", "'aes-cbc'");
     39    shouldBe("wrappingKey.algorithm.name", "'AES-CBC'");
    4040    var wrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
    4141    debug("wrapping the key...");
  • trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html

    r160061 r160491  
    3232crypto.subtle.importKey("jwk", jwkKeyAsArrayBuffer, null, extractable, ["sign", "verify"]).then(function(result) {
    3333    key = result;
    34     shouldBe("key.algorithm.name", "'rsassa-pkcs1-v1_5'");
     34    shouldBe("key.algorithm.name", "'RSASSA-PKCS1-v1_5'");
    3535    debug("Importing a key encryption key...");
    3636    return crypto.subtle.importKey("raw", wrappingKeyOctets, "AES-CBC", nonExtractable, ["wrapKey"]);
    3737}).then(function(result) {
    3838    wrappingKey = result;
    39     shouldBe("wrappingKey.algorithm.name", "'aes-cbc'");
     39    shouldBe("wrappingKey.algorithm.name", "'AES-CBC'");
    4040    var wrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
    4141    return crypto.subtle.wrapKey("jwk", key, wrappingKey, wrapAlgorithm);
  • trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation-expected.txt

    r159966 r160491  
    77PASS key.toString() is '[object Key]'
    88PASS key.type is 'secret'
    9 PASS key.algorithm.name is 'aes-kw'
     9PASS key.algorithm.name is 'AES-KW'
    1010PASS key.algorithm.length is 256
    1111
     
    1818PASS importedKey.toString() is '[object Key]'
    1919PASS importedKey.type is 'secret'
    20 PASS importedKey.algorithm.name is 'aes-kw'
     20PASS importedKey.algorithm.name is 'AES-KW'
    2121PASS importedKey.algorithm.length is 256
    2222PASS successfullyParsed is true
  • trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation.html

    r159966 r160491  
    2121    shouldBe("key.toString()", "'[object Key]'");
    2222    shouldBe("key.type", "'secret'");
    23     shouldBe("key.algorithm.name", "'aes-kw'");
     23    shouldBe("key.algorithm.name", "'AES-KW'");
    2424    shouldBe("key.algorithm.length", "256");
    2525
     
    4040    shouldBe("importedKey.toString()", "'[object Key]'");
    4141    shouldBe("importedKey.type", "'secret'");
    42     shouldBe("importedKey.algorithm.name", "'aes-kw'");
     42    shouldBe("importedKey.algorithm.name", "'AES-KW'");
    4343    shouldBe("importedKey.algorithm.length", "256");
    4444
  • trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt

    r159966 r160491  
    1212PASS unwrappedKey.type is 'secret'
    1313PASS unwrappedKey.extractable is true
    14 PASS unwrappedKey.algorithm.name is 'aes-cbc'
     14PASS unwrappedKey.algorithm.name is 'AES-CBC'
    1515PASS unwrappedKey.algorithm.length is 128
    1616PASS unwrappedKey.usages is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
     
    2323PASS unwrappedKey.type is 'secret'
    2424PASS unwrappedKey.extractable is true
    25 PASS unwrappedKey.algorithm.name is 'aes-cbc'
     25PASS unwrappedKey.algorithm.name is 'AES-CBC'
    2626PASS unwrappedKey.algorithm.length is 128
    2727PASS unwrappedKey.usages is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
  • trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html

    r159966 r160491  
    4040    shouldBe("unwrappedKey.type", "'secret'");
    4141    shouldBe("unwrappedKey.extractable", "true");
    42     shouldBe("unwrappedKey.algorithm.name", "'aes-cbc'");
     42    shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
    4343    shouldBe("unwrappedKey.algorithm.length", "128");
    4444    shouldBe("unwrappedKey.usages", "['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']");
     
    6262    shouldBe("unwrappedKey.type", "'secret'");
    6363    shouldBe("unwrappedKey.extractable", "true");
    64     shouldBe("unwrappedKey.algorithm.name", "'aes-cbc'");
     64    shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
    6565    shouldBe("unwrappedKey.algorithm.length", "128");
    6666    shouldBe("unwrappedKey.usages", "['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']");
  • trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt

    r160455 r160491  
    66PASS key.type is 'secret'
    77PASS key.extractable is true
    8 PASS key.algorithm.name is 'aes-cbc'
     8PASS key.algorithm.name is 'AES-CBC'
    99PASS key.algorithm.length is 128
    1010PASS key.usages is ["encrypt", "decrypt", "sign", "verify"]
  • trunk/LayoutTests/crypto/subtle/aes-postMessage.html

    r160455 r160491  
    1717    shouldBe("key.type", "'secret'");
    1818    shouldBe("key.extractable", "true");
    19     shouldBe("key.algorithm.name", "'aes-cbc'");
     19    shouldBe("key.algorithm.name", "'AES-CBC'");
    2020    shouldBe("key.algorithm.length", "128");
    2121    shouldBe("key.usages", '["encrypt", "decrypt", "sign", "verify"]');
  • trunk/LayoutTests/crypto/subtle/hmac-generate-key-expected.txt

    r158582 r160491  
    1212PASS key.type is 'secret'
    1313PASS key.extractable is true
    14 PASS key.algorithm.name is 'hmac'
     14PASS key.algorithm.name is 'HMAC'
    1515PASS key.algorithm.length is 64
    1616PASS key.usages is ["sign", "verify"]
     
    1919PASS key.type is 'secret'
    2020PASS key.extractable is true
    21 PASS key.algorithm.name is 'hmac'
     21PASS key.algorithm.name is 'HMAC'
    2222PASS key.algorithm.length is 5
    2323PASS key.usages is ["sign"]
  • trunk/LayoutTests/crypto/subtle/hmac-generate-key.html

    r159327 r160491  
    2727    shouldBe("key.type", "'secret'");
    2828    shouldBe("key.extractable", "true");
    29     shouldBe("key.algorithm.name", "'hmac'");
     29    shouldBe("key.algorithm.name", "'HMAC'");
    3030    shouldBe("key.algorithm.length", "64");
    3131    shouldBe("key.usages", '["sign", "verify"]');
     
    3838    shouldBe("key.type", "'secret'");
    3939    shouldBe("key.extractable", "true");
    40     shouldBe("key.algorithm.name", "'hmac'");
     40    shouldBe("key.algorithm.name", "'HMAC'");
    4141    shouldBe("key.algorithm.length", "5");
    4242    shouldBe("key.usages", '["sign"]');
  • trunk/LayoutTests/crypto/subtle/hmac-import-jwk-expected.txt

    r159327 r160491  
    88PASS key.type is 'secret'
    99PASS key.extractable is false
    10 PASS key.algorithm.name is 'hmac'
     10PASS key.algorithm.name is 'HMAC'
    1111PASS key.algorithm.length is 32
    1212PASS key.usages is ["sign", "verify"]
  • trunk/LayoutTests/crypto/subtle/hmac-import-jwk.html

    r160061 r160491  
    3232    shouldBe("key.type", "'secret'");
    3333    shouldBe("key.extractable", "false");
    34     shouldBe("key.algorithm.name", "'hmac'");
     34    shouldBe("key.algorithm.name", "'HMAC'");
    3535    shouldBe("key.algorithm.length", "32");
    3636    shouldBe("key.usages", '["sign", "verify"]');
  • trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt

    r160455 r160491  
    66PASS key.type is 'secret'
    77PASS key.extractable is true
    8 PASS key.algorithm.name is 'hmac'
     8PASS key.algorithm.name is 'HMAC'
    99PASS key.algorithm.length is 16
    1010PASS key.usages is ["encrypt", "decrypt", "sign", "verify"]
  • trunk/LayoutTests/crypto/subtle/hmac-postMessage.html

    r160455 r160491  
    1717    shouldBe("key.type", "'secret'");
    1818    shouldBe("key.extractable", "true");
    19     shouldBe("key.algorithm.name", "'hmac'");
     19    shouldBe("key.algorithm.name", "'HMAC'");
    2020    shouldBe("key.algorithm.length", "16");
    2121    shouldBe("key.usages", '["encrypt", "decrypt", "sign", "verify"]');
  • trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key-expected.txt

    r159327 r160491  
    77PASS key.type is 'secret'
    88PASS key.extractable is true
    9 PASS key.algorithm.name is 'hmac'
     9PASS key.algorithm.name is 'HMAC'
    1010PASS key.algorithm.length is 0
    11 PASS key.algorithm.hash.name is 'sha-1'
     11PASS key.algorithm.hash.name is 'SHA-1'
    1212PASS key.usages is ['sign', 'verify']
    1313Using the key to sign 'foo'...
  • trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html

    r159379 r160491  
    2222    shouldBe("key.type", "'secret'");
    2323    shouldBe("key.extractable", "true");
    24     shouldBe("key.algorithm.name", "'hmac'");
     24    shouldBe("key.algorithm.name", "'HMAC'");
    2525    shouldBe("key.algorithm.length", "0"); // See <https://www.w3.org/Bugs/Public/show_bug.cgi?id=23098>.
    26     shouldBe("key.algorithm.hash.name", "'sha-1'");
     26    shouldBe("key.algorithm.hash.name", "'SHA-1'");
    2727    shouldBe("key.usages", "['sign', 'verify']");
    2828
  • trunk/LayoutTests/crypto/subtle/hmac-sign-verify-expected.txt

    r159327 r160491  
    77PASS key.type is 'secret'
    88PASS key.extractable is true
    9 PASS key.algorithm.name is 'hmac'
     9PASS key.algorithm.name is 'HMAC'
    1010PASS key.algorithm.length is 1
    11 PASS key.algorithm.hash.name is 'sha-1'
     11PASS key.algorithm.hash.name is 'SHA-1'
    1212PASS key.usages is ['sign', 'verify']
    1313Using the key to sign 'foo'...
  • trunk/LayoutTests/crypto/subtle/hmac-sign-verify.html

    r159379 r160491  
    2222    shouldBe("key.type", "'secret'");
    2323    shouldBe("key.extractable", "true");
    24     shouldBe("key.algorithm.name", "'hmac'");
     24    shouldBe("key.algorithm.name", "'HMAC'");
    2525    shouldBe("key.algorithm.length", "1"); // See <https://www.w3.org/Bugs/Public/show_bug.cgi?id=23098>.
    26     shouldBe("key.algorithm.hash.name", "'sha-1'");
     26    shouldBe("key.algorithm.hash.name", "'SHA-1'");
    2727    shouldBe("key.usages", "['sign', 'verify']");
    2828
  • trunk/LayoutTests/crypto/subtle/postMessage-worker-expected.txt

    r160455 r160491  
    77PASS key.type is 'secret'
    88PASS key.extractable is true
    9 PASS key.algorithm.name is 'hmac'
     9PASS key.algorithm.name is 'HMAC'
    1010PASS key.algorithm.length is 16
    1111PASS key.usages is ["encrypt", "decrypt", "sign", "verify"]
  • trunk/LayoutTests/crypto/subtle/postMessage-worker.html

    r160455 r160491  
    2323            shouldBe("key.type", "'secret'");
    2424            shouldBe("key.extractable", "true");
    25             shouldBe("key.algorithm.name", "'hmac'");
     25            shouldBe("key.algorithm.name", "'HMAC'");
    2626            shouldBe("key.algorithm.length", "16");
    2727            shouldBe("key.usages", '["encrypt", "decrypt", "sign", "verify"]');
  • trunk/LayoutTests/crypto/subtle/resources/postMessage-worker.js

    r160455 r160491  
    66    else if (!key.extractable)
    77        postMessage({ result:false, message:'key.extractable should be true' });
    8     else if (key.algorithm.name != "hmac")
    9         postMessage({ result:false, message:'key.algorithm.name should be "hmac"' });
     8    else if (key.algorithm.name != "HMAC")
     9        postMessage({ result:false, message:'key.algorithm.name should be "HMAC"' });
    1010    else if (key.usages.toString() != "encrypt,decrypt,sign,verify")
    1111        postMessage({ result:false, message:'key.usages should be ["encrypt", "decrypt", "sign", "verify"]' });
  • trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt

    r160061 r160491  
    77PASS keyPair.toString() is '[object KeyPair]'
    88PASS keyPair.publicKey.type is 'public'
    9 PASS keyPair.publicKey.algorithm.name is 'rsa-oaep'
     9PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP'
    1010PASS keyPair.publicKey.algorithm.modulusLength is 2048
    1111PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
    1212PASS keyPair.publicKey.algorithm.hash is undefined.
    1313PASS keyPair.privateKey.type is 'private'
    14 PASS keyPair.privateKey.algorithm.name is 'rsa-oaep'
     14PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP'
    1515PASS keyPair.privateKey.algorithm.modulusLength is 2048
    1616PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
     
    3434Importing it back...
    3535PASS exportedPublicKey.type is 'public'
    36 PASS exportedPublicKey.algorithm.name is 'rsa-oaep'
     36PASS exportedPublicKey.algorithm.name is 'RSA-OAEP'
    3737PASS exportedPublicKey.algorithm.modulusLength is 2048
    3838PASS bytesToHexString(exportedPublicKey.algorithm.publicExponent) is '010001'
    39 PASS exportedPublicKey.algorithm.hash.name is 'sha-1'
     39PASS exportedPublicKey.algorithm.hash.name is 'SHA-1'
    4040PASS exportedPublicKey.extractable is true
    4141PASS exportedPublicKey.usages is ['encrypt','decrypt','wrapKey','unwrapKey']
  • trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html

    r160061 r160491  
    2727    shouldBe("keyPair.toString()", "'[object KeyPair]'");
    2828    shouldBe("keyPair.publicKey.type", "'public'");
    29     shouldBe("keyPair.publicKey.algorithm.name", "'rsa-oaep'");
     29    shouldBe("keyPair.publicKey.algorithm.name", "'RSA-OAEP'");
    3030    shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048");
    3131    shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
    3232    shouldBeUndefined("keyPair.publicKey.algorithm.hash");
    3333    shouldBe("keyPair.privateKey.type", "'private'");
    34     shouldBe("keyPair.privateKey.algorithm.name", "'rsa-oaep'");
     34    shouldBe("keyPair.privateKey.algorithm.name", "'RSA-OAEP'");
    3535    shouldBe("keyPair.privateKey.algorithm.modulusLength", "2048");
    3636    shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
     
    6666    exportedPublicKey = result;
    6767    shouldBe("exportedPublicKey.type", "'public'");
    68     shouldBe("exportedPublicKey.algorithm.name", "'rsa-oaep'");
     68    shouldBe("exportedPublicKey.algorithm.name", "'RSA-OAEP'");
    6969    shouldBe("exportedPublicKey.algorithm.modulusLength", "2048");
    7070    shouldBe("bytesToHexString(exportedPublicKey.algorithm.publicExponent)", "'010001'");
    71     shouldBe("exportedPublicKey.algorithm.hash.name", "'sha-1'");
     71    shouldBe("exportedPublicKey.algorithm.hash.name", "'SHA-1'");
    7272    shouldBe("exportedPublicKey.extractable", "true");
    7373    shouldBe("exportedPublicKey.usages", "['encrypt','decrypt','wrapKey','unwrapKey']");
  • trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt

    r159944 r160491  
    1212PASS unwrappedKey.type is 'secret'
    1313PASS unwrappedKey.extractable is true
    14 PASS unwrappedKey.algorithm.name is 'aes-cbc'
     14PASS unwrappedKey.algorithm.name is 'AES-CBC'
    1515PASS unwrappedKey.algorithm.length is 256
    1616PASS unwrappedKey.usages is ['encrypt', 'decrypt']
     
    2424PASS unwrappedKey.type is 'secret'
    2525PASS unwrappedKey.extractable is true
    26 PASS unwrappedKey.algorithm.name is 'aes-cbc'
     26PASS unwrappedKey.algorithm.name is 'AES-CBC'
    2727PASS unwrappedKey.algorithm.length is 256
    2828PASS unwrappedKey.usages is ['encrypt', 'decrypt']
  • trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html

    r159944 r160491  
    6363    shouldBe("unwrappedKey.type", "'secret'");
    6464    shouldBe("unwrappedKey.extractable", "true");
    65     shouldBe("unwrappedKey.algorithm.name", "'aes-cbc'");
     65    shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
    6666    shouldBe("unwrappedKey.algorithm.length", "256");
    6767    shouldBe("unwrappedKey.usages", "['encrypt', 'decrypt']");
     
    8686    shouldBe("unwrappedKey.type", "'secret'");
    8787    shouldBe("unwrappedKey.extractable", "true");
    88     shouldBe("unwrappedKey.algorithm.name", "'aes-cbc'");
     88    shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
    8989    shouldBe("unwrappedKey.algorithm.length", "256");
    9090    shouldBe("unwrappedKey.usages", "['encrypt', 'decrypt']");
  • trunk/LayoutTests/crypto/subtle/rsa-postMessage-expected.txt

    r160455 r160491  
    77PASS key.type is 'private'
    88PASS key.extractable is true
    9 PASS key.algorithm.name is 'rsassa-pkcs1-v1_5'
     9PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
    1010PASS key.algorithm.modulusLength is 2048
    1111PASS bytesToHexString(key.algorithm.publicExponent) is '010001'
  • trunk/LayoutTests/crypto/subtle/rsa-postMessage.html

    r160455 r160491  
    3131    shouldBe("key.type", "'private'");
    3232    shouldBe("key.extractable", "true");
    33     shouldBe("key.algorithm.name", "'rsassa-pkcs1-v1_5'");
     33    shouldBe("key.algorithm.name", "'RSASSA-PKCS1-v1_5'");
    3434    shouldBe("key.algorithm.modulusLength", "2048");
    3535    shouldBe("bytesToHexString(key.algorithm.publicExponent)", "'010001'");
  • trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt

    r159327 r160491  
    77PASS keyPair.toString() is '[object KeyPair]'
    88PASS keyPair.publicKey.type is 'public'
    9 PASS keyPair.publicKey.algorithm.name is 'rsassa-pkcs1-v1_5'
     9PASS keyPair.publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
    1010PASS keyPair.publicKey.algorithm.modulusLength is 2048
    1111PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
    1212PASS keyPair.publicKey.algorithm.hash is undefined.
    1313PASS keyPair.privateKey.type is 'private'
    14 PASS keyPair.privateKey.algorithm.name is 'rsassa-pkcs1-v1_5'
     14PASS keyPair.privateKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
    1515PASS keyPair.privateKey.algorithm.modulusLength is 2048
    1616PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
  • trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html

    r159327 r160491  
    2727    shouldBe("keyPair.toString()", "'[object KeyPair]'");
    2828    shouldBe("keyPair.publicKey.type", "'public'");
    29     shouldBe("keyPair.publicKey.algorithm.name", "'rsassa-pkcs1-v1_5'");
     29    shouldBe("keyPair.publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
    3030    shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048");
    3131    shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
    3232    shouldBeUndefined("keyPair.publicKey.algorithm.hash");
    3333    shouldBe("keyPair.privateKey.type", "'private'");
    34     shouldBe("keyPair.privateKey.algorithm.name", "'rsassa-pkcs1-v1_5'");
     34    shouldBe("keyPair.privateKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
    3535    shouldBe("keyPair.privateKey.algorithm.modulusLength", "2048");
    3636    shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
  • trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt

    r159327 r160491  
    88PASS publicKey.type is 'public'
    99PASS publicKey.usages is ['sign','verify']
    10 PASS publicKey.algorithm.name is 'rsassa-pkcs1-v1_5'
     10PASS publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
    1111PASS publicKey.algorithm.modulusLength is 2048
    1212PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
    13 PASS publicKey.algorithm.hash.name is 'sha-256'
     13PASS publicKey.algorithm.hash.name is 'SHA-256'
    1414
    1515Importing a private key...
     
    1717PASS privateKey.type is 'private'
    1818PASS privateKey.usages is ['sign','verify']
    19 PASS privateKey.algorithm.name is 'rsassa-pkcs1-v1_5'
     19PASS privateKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
    2020PASS privateKey.algorithm.modulusLength is 2048
    2121PASS bytesToHexString(privateKey.algorithm.publicExponent) is '010001'
    22 PASS privateKey.algorithm.hash.name is 'sha-256'
     22PASS privateKey.algorithm.hash.name is 'SHA-256'
    2323PASS successfullyParsed is true
    2424
  • trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html

    r159327 r160491  
    4242    shouldBe("publicKey.type", "'public'");
    4343    shouldBe("publicKey.usages", "['sign','verify']");
    44     shouldBe("publicKey.algorithm.name", "'rsassa-pkcs1-v1_5'");
     44    shouldBe("publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
    4545    shouldBe("publicKey.algorithm.modulusLength", "2048");
    4646    shouldBe("bytesToHexString(publicKey.algorithm.publicExponent)", "'010001'");
    47     shouldBe("publicKey.algorithm.hash.name", "'sha-256'");
     47    shouldBe("publicKey.algorithm.hash.name", "'SHA-256'");
    4848    debug("\nImporting a private key...");
    4949    return crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["sign", "verify"]);
     
    5353    shouldBe("privateKey.type", "'private'");
    5454    shouldBe("privateKey.usages", "['sign','verify']");
    55     shouldBe("privateKey.algorithm.name", "'rsassa-pkcs1-v1_5'");
     55    shouldBe("privateKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
    5656    shouldBe("privateKey.algorithm.modulusLength", "2048");
    5757    shouldBe("bytesToHexString(privateKey.algorithm.publicExponent)", "'010001'");
    58     shouldBe("privateKey.algorithm.hash.name", "'sha-256'");
     58    shouldBe("privateKey.algorithm.hash.name", "'SHA-256'");
    5959    finishJSTest();
    6060});
  • trunk/Source/WebCore/ChangeLog

    r160487 r160491  
     12013-12-12  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Make algorithm.name return registered name, not normalized one
     4        https://bugs.webkit.org/show_bug.cgi?id=125641
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Currently, WebCrypto editor's draft stipulates that algorithm name is lowercased
     9        as part of normalization.
     10
     11        But it makes little sense to register algorithms as mixed (mostly upper) case, yet
     12        return the name lowercased. Other implementations don't bother respecting this,
     13        and signs are that the spec will change.
     14
     15        I'd like to match other implementations here, because sticking to the spec only
     16        makes us fail 3rd party test suites for no good reason.
     17
     18        Updated many existing tests.
     19
     20        * crypto/CryptoAlgorithmRegistry.cpp:
     21        (WebCore::CryptoAlgorithmRegistry::getIdentifierForName):
     22        (WebCore::CryptoAlgorithmRegistry::registerAlgorithm):
     23        * crypto/CryptoAlgorithmRegistry.h:
     24        * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
     25        * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
     26        * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
     27        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
     28        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
     29        * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
     30        * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
     31        * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
     32        * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
     33        * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
     34
    1352013-12-12  Csaba Osztrogonác  <ossy@webkit.org>
    236
  • trunk/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp

    r160455 r160491  
    5858    MutexLocker lock(registryMutex());
    5959
    60     auto iter = m_nameToIdentifierMap.find(name.isolatedCopy().lower());
     60    auto iter = m_nameToIdentifierMap.find(name.isolatedCopy());
    6161    if (iter == m_nameToIdentifierMap.end())
    6262        return false;
     
    8686void CryptoAlgorithmRegistry::registerAlgorithm(const String& name, CryptoAlgorithmIdentifier identifier, CryptoAlgorithmConstructor constructor)
    8787{
    88     ASSERT(name == name.lower());
    89 
    9088    MutexLocker lock(registryMutex());
    9189
  • trunk/Source/WebCore/crypto/CryptoAlgorithmRegistry.h

    r159717 r160491  
    6464
    6565    void registerAlgorithm(const String& name, CryptoAlgorithmIdentifier, CryptoAlgorithmConstructor);
    66     HashMap<String, CryptoAlgorithmIdentifier> m_nameToIdentifierMap;
     66    HashMap<String, CryptoAlgorithmIdentifier, CaseFoldingHash> m_nameToIdentifierMap;
    6767    HashMap<unsigned, String> m_identifierToNameMap;
    6868    HashMap<unsigned, CryptoAlgorithmConstructor> m_identifierToConstructorMap;
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.cpp

    r159717 r160491  
    3737namespace WebCore {
    3838
    39 const char* const CryptoAlgorithmAES_CBC::s_name = "aes-cbc";
     39const char* const CryptoAlgorithmAES_CBC::s_name = "AES-CBC";
    4040
    4141CryptoAlgorithmAES_CBC::CryptoAlgorithmAES_CBC()
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp

    r159966 r160491  
    3636namespace WebCore {
    3737
    38 const char* const CryptoAlgorithmAES_KW::s_name = "aes-kw";
     38const char* const CryptoAlgorithmAES_KW::s_name = "AES-KW";
    3939
    4040CryptoAlgorithmAES_KW::CryptoAlgorithmAES_KW()
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp

    r159975 r160491  
    3737namespace WebCore {
    3838
    39 const char* const CryptoAlgorithmHMAC::s_name = "hmac";
     39const char* const CryptoAlgorithmHMAC::s_name = "HMAC";
    4040
    4141CryptoAlgorithmHMAC::CryptoAlgorithmHMAC()
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp

    r159717 r160491  
    3838namespace WebCore {
    3939
    40 const char* const CryptoAlgorithmRSASSA_PKCS1_v1_5::s_name = "rsassa-pkcs1-v1_5";
     40const char* const CryptoAlgorithmRSASSA_PKCS1_v1_5::s_name = "RSASSA-PKCS1-v1_5";
    4141
    4242CryptoAlgorithmRSASSA_PKCS1_v1_5::CryptoAlgorithmRSASSA_PKCS1_v1_5()
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp

    r159944 r160491  
    3838namespace WebCore {
    3939
    40 const char* const CryptoAlgorithmRSA_OAEP::s_name = "rsa-oaep";
     40const char* const CryptoAlgorithmRSA_OAEP::s_name = "RSA-OAEP";
    4141
    4242CryptoAlgorithmRSA_OAEP::CryptoAlgorithmRSA_OAEP()
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.cpp

    r159578 r160491  
    3333namespace WebCore {
    3434
    35 const char* const CryptoAlgorithmSHA1::s_name = "sha-1";
     35const char* const CryptoAlgorithmSHA1::s_name = "SHA-1";
    3636
    3737CryptoAlgorithmSHA1::CryptoAlgorithmSHA1()
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.cpp

    r159578 r160491  
    3333namespace WebCore {
    3434
    35 const char* const CryptoAlgorithmSHA224::s_name = "sha-224";
     35const char* const CryptoAlgorithmSHA224::s_name = "SHA-224";
    3636
    3737CryptoAlgorithmSHA224::CryptoAlgorithmSHA224()
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA256.cpp

    r159578 r160491  
    3333namespace WebCore {
    3434
    35 const char* const CryptoAlgorithmSHA256::s_name = "sha-256";
     35const char* const CryptoAlgorithmSHA256::s_name = "SHA-256";
    3636
    3737CryptoAlgorithmSHA256::CryptoAlgorithmSHA256()
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA384.cpp

    r159578 r160491  
    3333namespace WebCore {
    3434
    35 const char* const CryptoAlgorithmSHA384::s_name = "sha-384";
     35const char* const CryptoAlgorithmSHA384::s_name = "SHA-384";
    3636
    3737CryptoAlgorithmSHA384::CryptoAlgorithmSHA384()
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA512.cpp

    r159578 r160491  
    3333namespace WebCore {
    3434
    35 const char* const CryptoAlgorithmSHA512::s_name = "sha-512";
     35const char* const CryptoAlgorithmSHA512::s_name = "SHA-512";
    3636
    3737CryptoAlgorithmSHA512::CryptoAlgorithmSHA512()
Note: See TracChangeset for help on using the changeset viewer.