Changeset 160547 in webkit


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

WebCrypto Key.usages should be ordered alphabetically
https://bugs.webkit.org/show_bug.cgi?id=125696

Reviewed by Darin Adler.

Source/WebCore:

  • crypto/CryptoKey.cpp: (WebCore::CryptoKey::usages): Do it.

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-invalid-length-expected.txt:
  • crypto/subtle/aes-cbc-invalid-length.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-postMessage-expected.txt:
  • crypto/subtle/hmac-postMessage.html:
  • crypto/subtle/jwk-import-use-values-expected.txt:
  • crypto/subtle/jwk-import-use-values.html:
  • crypto/subtle/postMessage-worker-expected.txt:
  • crypto/subtle/postMessage-worker.html:
  • crypto/subtle/resources/postMessage-worker.js:

(onmessage):

  • 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/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt:
  • crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html:
Location:
trunk
Files:
32 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r160544 r160547  
     12013-12-13  Alexey Proskuryakov  <ap@apple.com>
     2
     3        WebCrypto Key.usages should be ordered alphabetically
     4        https://bugs.webkit.org/show_bug.cgi?id=125696
     5
     6        Reviewed by Darin Adler.
     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-invalid-length-expected.txt:
     19        * crypto/subtle/aes-cbc-invalid-length.html:
     20        * crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt:
     21        * crypto/subtle/aes-kw-wrap-unwrap-aes.html:
     22        * crypto/subtle/aes-postMessage-expected.txt:
     23        * crypto/subtle/aes-postMessage.html:
     24        * crypto/subtle/hmac-postMessage-expected.txt:
     25        * crypto/subtle/hmac-postMessage.html:
     26        * crypto/subtle/jwk-import-use-values-expected.txt:
     27        * crypto/subtle/jwk-import-use-values.html:
     28        * crypto/subtle/postMessage-worker-expected.txt:
     29        * crypto/subtle/postMessage-worker.html:
     30        * crypto/subtle/resources/postMessage-worker.js:
     31        (onmessage):
     32        * crypto/subtle/rsa-oaep-key-manipulation-expected.txt:
     33        * crypto/subtle/rsa-oaep-key-manipulation.html:
     34        * crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt:
     35        * crypto/subtle/rsa-oaep-wrap-unwrap-aes.html:
     36        * crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt:
     37        * crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html:
     38
    1392013-12-13  Rob Buis  <rob.buis@samsung.com>
    240
  • trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt

    r160491 r160547  
    99PASS key.algorithm.name is 'AES-CBC'
    1010PASS key.algorithm.length is 192
    11 PASS key.usages is ['encrypt', 'decrypt']
     11PASS key.usages is ['decrypt', 'encrypt']
    1212Using the key to encrypt plaintext...
    1313PASS bytesToHexString(new Uint8Array(encryptionResult)) is '4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'
  • trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html

    r160491 r160547  
    2626    shouldBe("key.algorithm.name", "'AES-CBC'");
    2727    shouldBe("key.algorithm.length", "192");
    28     shouldBe("key.usages", "['encrypt', 'decrypt']");
     28    shouldBe("key.usages", "['decrypt', 'encrypt']");
    2929
    3030    debug("Using the key to encrypt plaintext...");
  • trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt

    r160491 r160547  
    99PASS key.algorithm.name is 'AES-CBC'
    1010PASS key.algorithm.length is 256
    11 PASS key.usages is ['encrypt', 'decrypt']
     11PASS key.usages is ['decrypt', 'encrypt']
    1212Using the key to encrypt plaintext...
    1313PASS bytesToHexString(new Uint8Array(encryptionResult)) is 'f58c4c04d6e5f1ba779eabfb5f7bfbd69cfc4e967edb808d679f777bc6702c7d39f23369a9d9bacfa530e26304231461b2eb05e2c39be9fcda6c19078c6a9d1b3f461796d6b0d6b2e0c2a72b4d80e644'
  • trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html

    r160491 r160547  
    2626    shouldBe("key.algorithm.name", "'AES-CBC'");
    2727    shouldBe("key.algorithm.length", "256");
    28     shouldBe("key.usages", "['encrypt', 'decrypt']");
     28    shouldBe("key.usages", "['decrypt', 'encrypt']");
    2929
    3030    debug("Using the key to encrypt plaintext...");
  • trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt

    r160491 r160547  
    99PASS key.algorithm.name is 'AES-CBC'
    1010PASS key.algorithm.length is 128
    11 PASS key.usages is ['encrypt', 'decrypt']
     11PASS key.usages is ['decrypt', 'encrypt']
    1212Using the key to encrypt plaintext...
    1313PASS bytesToHexString(new Uint8Array(encryptionResult)) is '7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a78cb82807230e1321d3fae00d18cc2012'
  • trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt

    r160491 r160547  
    99PASS key.algorithm.name is 'AES-CBC'
    1010PASS key.algorithm.length is 128
    11 PASS key.usages is ['encrypt', 'decrypt']
     11PASS key.usages is ['decrypt', 'encrypt']
    1212Using the key to encrypt plaintext...
    1313PASS bytesToHexString(new Uint8Array(cyphertext)) is '630199c5f202cc7167bb84c6c72b349d'
  • trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html

    r160491 r160547  
    2626    shouldBe("key.algorithm.name", "'AES-CBC'");
    2727    shouldBe("key.algorithm.length", "128");
    28     shouldBe("key.usages", "['encrypt', 'decrypt']");
     28    shouldBe("key.usages", "['decrypt', 'encrypt']");
    2929
    3030    debug("Using the key to encrypt plaintext...");
  • trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html

    r160491 r160547  
    2626    shouldBe("key.algorithm.name", "'AES-CBC'");
    2727    shouldBe("key.algorithm.length", "128");
    28     shouldBe("key.usages", "['encrypt', 'decrypt']");
     28    shouldBe("key.usages", "['decrypt', 'encrypt']");
    2929
    3030    debug("Using the key to encrypt plaintext...");
  • trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt

    r160491 r160547  
    1313PASS key.algorithm.name is 'AES-CBC'
    1414PASS key.algorithm.length is 128
    15 PASS key.usages is ['encrypt', 'decrypt']
     15PASS key.usages is ['decrypt', 'encrypt']
    1616PASS successfullyParsed is true
    1717
  • trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html

    r160491 r160547  
    2929    shouldBe("key.algorithm.name", "'AES-CBC'");
    3030    shouldBe("key.algorithm.length", "128");
    31     shouldBe("key.usages", "['encrypt', 'decrypt']");
     31    shouldBe("key.usages", "['decrypt', 'encrypt']");
    3232
    3333    finishJSTest();
  • trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt

    r160491 r160547  
    99PASS key.algorithm.name is 'AES-CBC'
    1010PASS key.algorithm.length is 176
    11 PASS key.usages is ['encrypt', 'decrypt']
     11PASS key.usages is ['decrypt', 'encrypt']
    1212Using the key to encrypt plaintext...
    1313Failed, as expected. Note that the spec doesn't appear to clearly define which step should fail.
  • trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html

    r160491 r160547  
    2626    shouldBe("key.algorithm.name", "'AES-CBC'");
    2727    shouldBe("key.algorithm.length", "176");
    28     shouldBe("key.usages", "['encrypt', 'decrypt']");
     28    shouldBe("key.usages", "['decrypt', 'encrypt']");
    2929
    3030    debug("Using the key to encrypt plaintext...");
  • trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt

    r160491 r160547  
    1414PASS unwrappedKey.algorithm.name is 'AES-CBC'
    1515PASS unwrappedKey.algorithm.length is 128
    16 PASS unwrappedKey.usages is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
     16PASS unwrappedKey.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
    1717Exporting it...
    1818PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(keyData)
     
    2525PASS unwrappedKey.algorithm.name is 'AES-CBC'
    2626PASS unwrappedKey.algorithm.length is 128
    27 PASS unwrappedKey.usages is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
     27PASS unwrappedKey.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
    2828Exporting it...
    2929PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(keyData)
  • trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html

    r160491 r160547  
    4242    shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
    4343    shouldBe("unwrappedKey.algorithm.length", "128");
    44     shouldBe("unwrappedKey.usages", "['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']");
     44    shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']");
    4545
    4646    debug("Exporting it...");
     
    6464    shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
    6565    shouldBe("unwrappedKey.algorithm.length", "128");
    66     shouldBe("unwrappedKey.usages", "['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']");
     66    shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']");
    6767
    6868    debug("Exporting it...");
  • trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt

    r160491 r160547  
    88PASS key.algorithm.name is 'AES-CBC'
    99PASS key.algorithm.length is 128
    10 PASS key.usages is ["encrypt", "decrypt", "sign", "verify"]
     10PASS key.usages is ["decrypt", "encrypt", "sign", "verify"]
    1111PASS successfullyParsed is true
    1212
  • trunk/LayoutTests/crypto/subtle/aes-postMessage.html

    r160491 r160547  
    1919    shouldBe("key.algorithm.name", "'AES-CBC'");
    2020    shouldBe("key.algorithm.length", "128");
    21     shouldBe("key.usages", '["encrypt", "decrypt", "sign", "verify"]');
     21    shouldBe("key.usages", '["decrypt", "encrypt", "sign", "verify"]');
    2222
    2323    finishJSTest();
  • trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt

    r160491 r160547  
    88PASS key.algorithm.name is 'HMAC'
    99PASS key.algorithm.length is 16
    10 PASS key.usages is ["encrypt", "decrypt", "sign", "verify"]
     10PASS key.usages is ["decrypt", "encrypt", "sign", "verify"]
    1111PASS successfullyParsed is true
    1212
  • trunk/LayoutTests/crypto/subtle/hmac-postMessage.html

    r160491 r160547  
    1919    shouldBe("key.algorithm.name", "'HMAC'");
    2020    shouldBe("key.algorithm.length", "16");
    21     shouldBe("key.usages", '["encrypt", "decrypt", "sign", "verify"]');
     21    shouldBe("key.usages", '["decrypt", "encrypt", "sign", "verify"]');
    2222
    2323    finishJSTest();
  • trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt

    r160061 r160547  
    1111
    1212enconly,deconly:
    13 PASS key.usages is ["encrypt","decrypt"]
     13PASS key.usages is ["decrypt","encrypt"]
    1414
    1515wrap:
     
    2020
    2121wrap,unwrap:
    22 PASS key.usages is ["wrapKey","unwrapKey"]
     22PASS key.usages is ["unwrapKey","wrapKey"]
    2323
    2424enconly,deconly,wrap:
    25 PASS key.usages is ["encrypt","decrypt","wrapKey"]
     25PASS key.usages is ["decrypt","encrypt","wrapKey"]
    2626
    2727enc:
    28 PASS key.usages is ["encrypt","decrypt","wrapKey","unwrapKey"]
     28PASS key.usages is ["decrypt","encrypt","unwrapKey","wrapKey"]
    2929
    3030sigonly:
     
    5050
    5151enconly,,deconly:
    52 PASS key.usages is ["encrypt","decrypt"]
     52PASS key.usages is ["decrypt","encrypt"]
    5353
    5454PASS successfullyParsed is true
  • trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html

    r160061 r160547  
    5555    testWithAESCBC(["encrypt"], "enconly"),
    5656    testWithAESCBC(["decrypt"], "deconly"),
    57     testWithAESCBC(["encrypt", "decrypt"], "enconly,deconly"),
     57    testWithAESCBC(["decrypt", "encrypt"], "enconly,deconly"),
    5858    testWithAESCBC(["wrapKey"], "wrap"),
    5959    testWithAESCBC(["unwrapKey"], "unwrap"),
    60     testWithAESCBC(["wrapKey", "unwrapKey"], "wrap,unwrap"),
    61     testWithAESCBC(["encrypt", "decrypt", "wrapKey"], "enconly,deconly,wrap"),
    62     testWithAESCBC(["encrypt", "decrypt", "wrapKey", "unwrapKey"], "enc"),
     60    testWithAESCBC(["unwrapKey", "wrapKey"], "wrap,unwrap"),
     61    testWithAESCBC(["decrypt", "encrypt", "wrapKey"], "enconly,deconly,wrap"),
     62    testWithAESCBC(["decrypt", "encrypt", "unwrapKey", "wrapKey"], "enc"),
    6363    testWithHMAC(["sign"], "sigonly"),
    6464    testWithHMAC(["verify"], "vfyonly"),
     
    7070    testWithAESCBC([], "EncOnly"),
    7171    testWithAESCBC(["encrypt"], "enconly, deconly"),
    72     testWithAESCBC(["encrypt", "decrypt"], "enconly,,deconly"),
     72    testWithAESCBC(["decrypt","encrypt"], "enconly,,deconly"),
    7373
    7474]).then(function() { finishJSTest(); } );
  • trunk/LayoutTests/crypto/subtle/postMessage-worker-expected.txt

    r160491 r160547  
    99PASS key.algorithm.name is 'HMAC'
    1010PASS key.algorithm.length is 16
    11 PASS key.usages is ["encrypt", "decrypt", "sign", "verify"]
     11PASS key.usages is ["decrypt", "encrypt", "sign", "verify"]
    1212PASS successfullyParsed is true
    1313
  • trunk/LayoutTests/crypto/subtle/postMessage-worker.html

    r160491 r160547  
    2525            shouldBe("key.algorithm.name", "'HMAC'");
    2626            shouldBe("key.algorithm.length", "16");
    27             shouldBe("key.usages", '["encrypt", "decrypt", "sign", "verify"]');
     27            shouldBe("key.usages", '["decrypt", "encrypt", "sign", "verify"]');
    2828        }
    2929        finishJSTest();
  • trunk/LayoutTests/crypto/subtle/resources/postMessage-worker.js

    r160491 r160547  
    88    else if (key.algorithm.name != "HMAC")
    99        postMessage({ result:false, message:'key.algorithm.name should be "HMAC"' });
    10     else if (key.usages.toString() != "encrypt,decrypt,sign,verify")
    11         postMessage({ result:false, message:'key.usages should be ["encrypt", "decrypt", "sign", "verify"]' });
     10    else if (key.usages.toString() != "decrypt,encrypt,sign,verify")
     11        postMessage({ result:false, message:'key.usages should be ["decrypt", "encrypt", "sign", "verify"]' });
    1212    else
    1313        postMessage({ result:true, key:key });
  • trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt

    r160491 r160547  
    3939PASS exportedPublicKey.algorithm.hash.name is 'SHA-1'
    4040PASS exportedPublicKey.extractable is true
    41 PASS exportedPublicKey.usages is ['encrypt','decrypt','wrapKey','unwrapKey']
     41PASS exportedPublicKey.usages is ['decrypt','encrypt','unwrapKey','wrapKey']
    4242PASS successfullyParsed is true
    4343
  • trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html

    r160491 r160547  
    7171    shouldBe("exportedPublicKey.algorithm.hash.name", "'SHA-1'");
    7272    shouldBe("exportedPublicKey.extractable", "true");
    73     shouldBe("exportedPublicKey.usages", "['encrypt','decrypt','wrapKey','unwrapKey']");
     73    shouldBe("exportedPublicKey.usages", "['decrypt','encrypt','unwrapKey','wrapKey']");
    7474
    7575    finishJSTest();
  • trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt

    r160491 r160547  
    1414PASS unwrappedKey.algorithm.name is 'AES-CBC'
    1515PASS unwrappedKey.algorithm.length is 256
    16 PASS unwrappedKey.usages is ['encrypt', 'decrypt']
     16PASS unwrappedKey.usages is ['decrypt', 'encrypt']
    1717Exporting it...
    1818PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
     
    2626PASS unwrappedKey.algorithm.name is 'AES-CBC'
    2727PASS unwrappedKey.algorithm.length is 256
    28 PASS unwrappedKey.usages is ['encrypt', 'decrypt']
     28PASS unwrappedKey.usages is ['decrypt', 'encrypt']
    2929Exporting it...
    3030PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
  • trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html

    r160491 r160547  
    6565    shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
    6666    shouldBe("unwrappedKey.algorithm.length", "256");
    67     shouldBe("unwrappedKey.usages", "['encrypt', 'decrypt']");
     67    shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']");
    6868
    6969    debug("Exporting it...");
     
    8888    shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
    8989    shouldBe("unwrappedKey.algorithm.length", "256");
    90     shouldBe("unwrappedKey.usages", "['encrypt', 'decrypt']");
     90    shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']");
    9191
    9292    debug("Exporting it...");
  • trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt

    r160502 r160547  
    1414PASS unwrappedKey.algorithm.name is 'AES-CBC'
    1515PASS unwrappedKey.algorithm.length is 256
    16 PASS unwrappedKey.usages is ['encrypt', 'decrypt']
     16PASS unwrappedKey.usages is ['decrypt', 'encrypt']
    1717Exporting it...
    1818PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
     
    2626PASS unwrappedKey.algorithm.name is 'AES-CBC'
    2727PASS unwrappedKey.algorithm.length is 256
    28 PASS unwrappedKey.usages is ['encrypt', 'decrypt']
     28PASS unwrappedKey.usages is ['decrypt', 'encrypt']
    2929Exporting it...
    3030PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
  • trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html

    r160502 r160547  
    6565    shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
    6666    shouldBe("unwrappedKey.algorithm.length", "256");
    67     shouldBe("unwrappedKey.usages", "['encrypt', 'decrypt']");
     67    shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']");
    6868
    6969    debug("Exporting it...");
     
    8888    shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
    8989    shouldBe("unwrappedKey.algorithm.length", "256");
    90     shouldBe("unwrappedKey.usages", "['encrypt', 'decrypt']");
     90    shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']");
    9191
    9292    debug("Exporting it...");
  • trunk/Source/WebCore/ChangeLog

    r160546 r160547  
     12013-12-13  Alexey Proskuryakov  <ap@apple.com>
     2
     3        WebCrypto Key.usages should be ordered alphabetically
     4        https://bugs.webkit.org/show_bug.cgi?id=125696
     5
     6        Reviewed by Darin Adler.
     7
     8        * crypto/CryptoKey.cpp: (WebCore::CryptoKey::usages): Do it.
     9
    1102013-12-13  Darin Adler  <darin@apple.com>
    211
  • trunk/Source/WebCore/crypto/CryptoKey.cpp

    r159390 r160547  
    6868Vector<String> CryptoKey::usages() const
    6969{
     70    // The result is ordered alphabetically.
    7071    Vector<String> result;
     72    if (m_usages & CryptoKeyUsageDecrypt)
     73        result.append(ASCIILiteral("decrypt"));
     74    if (m_usages & CryptoKeyUsageDeriveBits)
     75        result.append(ASCIILiteral("deriveBits"));
     76    if (m_usages & CryptoKeyUsageDeriveKey)
     77        result.append(ASCIILiteral("deriveKey"));
    7178    if (m_usages & CryptoKeyUsageEncrypt)
    7279        result.append(ASCIILiteral("encrypt"));
    73     if (m_usages & CryptoKeyUsageDecrypt)
    74         result.append(ASCIILiteral("decrypt"));
    7580    if (m_usages & CryptoKeyUsageSign)
    7681        result.append(ASCIILiteral("sign"));
     82    if (m_usages & CryptoKeyUsageUnwrapKey)
     83        result.append(ASCIILiteral("unwrapKey"));
    7784    if (m_usages & CryptoKeyUsageVerify)
    7885        result.append(ASCIILiteral("verify"));
    79     if (m_usages & CryptoKeyUsageDeriveKey)
    80         result.append(ASCIILiteral("deriveKey"));
    81     if (m_usages & CryptoKeyUsageDeriveBits)
    82         result.append(ASCIILiteral("deriveBits"));
    8386    if (m_usages & CryptoKeyUsageWrapKey)
    8487        result.append(ASCIILiteral("wrapKey"));
    85     if (m_usages & CryptoKeyUsageUnwrapKey)
    86         result.append(ASCIILiteral("unwrapKey"));
    8788
    8889    return result;
Note: See TracChangeset for help on using the changeset viewer.