Skip to content

Commit

Permalink
crypto: run more of webcrypto WPT
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Jun 14, 2022
1 parent 43efe4a commit fa1454e
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 65 deletions.
167 changes: 102 additions & 65 deletions test/wpt/status/WebCryptoAPI.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,89 +2,126 @@
"algorithm-discards-context.https.window.js": {
"fail": "document is not defined"
},
"derive_bits_keys/hkdf.https.any.js": {
"fail": "location is not defined"
},
"derive_bits_keys/pbkdf2.https.any.js": {
"fail": "location is not defined"
"historical.any.js": {
"fail": "expected (undefined) undefined but got..."
},
"digest/digest.https.any.js": {
"fail": "Expected NotSupportedError but got TypeError"
"generateKey/failures_AES-CTR.https.any.js": {
"fail": {
"unexpected": [
"assert_equals: Bad algorithm property not supported expected \"OperationError\" but got \"TypeError\"",
"assert_equals: Bad algorithm property not supported expected \"OperationError\" but got \"SyntaxError\""
]
}
},
"encrypt_decrypt/aes_cbc.https.any.js": {
"fail": "Expected OperationError but got Error"
"generateKey/failures_ECDH.https.any.js": {
"fail": {
"unexpected": [
"assert_equals: Bad algorithm property not supported expected \"NotSupportedError\" but got \"TypeError\"",
"assert_equals: Bad algorithm property not supported expected \"NotSupportedError\" but got \"SyntaxError\""
]
}
},
"encrypt_decrypt/rsa_oaep.https.any.js": {
"fail": "Expected OperationError but got Error"
"generateKey/failures_ECDSA.https.any.js": {
"fail": {
"unexpected": [
"assert_equals: Bad algorithm property not supported expected \"NotSupportedError\" but got \"TypeError\"",
"assert_equals: Bad algorithm property not supported expected \"NotSupportedError\" but got \"SyntaxError\""
]
}
},
"generateKey/failures_AES-CBC.https.any.js": {
"fail": "Expected OperationError but got TypeError"
},
"generateKey/failures_AES-CTR.https.any.js": {
"fail": "Expected OperationError but got TypeError"
"fail": {
"unexpected": [
"assert_equals: Bad algorithm property not supported expected \"OperationError\" but got \"TypeError\"",
"assert_equals: Bad algorithm property not supported expected \"OperationError\" but got \"SyntaxError\""
]
}
},
"generateKey/failures_AES-GCM.https.any.js": {
"fail": "Expected OperationError but got TypeError"
"fail": {
"unexpected": [
"assert_equals: Bad algorithm property not supported expected \"OperationError\" but got \"TypeError\"",
"assert_equals: Bad algorithm property not supported expected \"OperationError\" but got \"SyntaxError\""
]
}
},
"generateKey/failures_AES-KW.https.any.js": {
"fail": "Expected OperationError but got TypeError"
},
"generateKey/failures_ECDH.https.any.js": {
"fail": "Expected NotSupportedError but got TypeError"
},
"generateKey/failures_ECDSA.https.any.js": {
"fail": "Expected NotSupportedError but got TypeError"
},
"generateKey/failures_HMAC.https.any.js": {
"fail": "Operation succeeded, but should not have Reached unreachable code"
},
"generateKey/failures_RSA-OAEP.https.any.js": {
"fail": "Operation succeeded, but should not have Reached unreachable code"
"fail": {
"unexpected": [
"assert_unreached: Operation succeeded, but should not have Reached unreachable code",
"assert_equals: Bad algorithm property not supported expected \"OperationError\" but got \"TypeError\"",
"assert_equals: Bad algorithm property not supported expected \"OperationError\" but got \"SyntaxError\""
]
}
},
"generateKey/failures_RSA-PSS.https.any.js": {
"fail": "Operation succeeded, but should not have Reached unreachable code"
"fail": {
"unexpected": [
"assert_equals: Bad algorithm property not supported expected \"OperationError\" but got \"SyntaxError\""
]
}
},
"generateKey/failures_RSASSA-PKCS1-v1_5.https.any.js": {
"fail": "Operation succeeded, but should not have Reached unreachable code"
"fail": {
"unexpected": [
"assert_equals: Bad algorithm property not supported expected \"OperationError\" but got \"SyntaxError\""
]
}
},
"generateKey/successes_AES-CBC.https.any.js": {
"fail": "location is not defined"
},
"generateKey/successes_AES-CTR.https.any.js": {
"fail": "location is not defined"
},
"generateKey/successes_AES-GCM.https.any.js": {
"fail": "location is not defined"
},
"generateKey/successes_AES-KW.https.any.js": {
"fail": "location is not defined"
},
"generateKey/successes_ECDH.https.any.js": {
"fail": "location is not defined"
},
"generateKey/successes_ECDSA.https.any.js": {
"fail": "location is not defined"
},
"generateKey/successes_HMAC.https.any.js": {
"fail": "location is not defined"
},
"generateKey/successes_RSA-OAEP.https.any.js": {
"fail": "location is not defined"
"idlharness.https.any.js": {
"fail": "Various non-IDL-compliant things"
},
"generateKey/successes_RSA-PSS.https.any.js": {
"fail": "location is not defined"
"encrypt_decrypt/aes_cbc.https.any.js": {
"fail": {
"unexpected": [
"assert_equals: Should throw an OperationError instead of error:1C800064:Provider routines::bad decrypt expected \"OperationError\" but got \"Error\""
]
}
},
"generateKey/successes_RSASSA-PKCS1-v1_5.https.any.js": {
"fail": "location is not defined"
"derive_bits_keys/hkdf.https.any.js": {
"fail": {
"unexpected": [
"assert_equals: deriveBits with null length correctly threw OperationError: The \"length\" argument must be of type number. Received null expected \"OperationError\" but got \"TypeError\"",
"assert_unreached: deriveBits failed with error TypeError: The \"baseKey\" argument must be an instance of CryptoKey. Received null Reached unreachable code",
"assert_equals: deriveBits with 0 length correctly threw OperationError: The \"baseKey\" argument must be an instance of CryptoKey. Received null expected \"OperationError\" but got \"TypeError\"",
"assert_unreached: deriveKey failed with error TypeError: The \"baseKey\" argument must be an instance of CryptoKey. Received null Reached unreachable code",
"assert_equals: deriveKey with missing deriveKey usage correctly threw InvalidAccessError: The \"baseKey\" argument must be an instance of CryptoKey. Received null expected \"InvalidAccessError\" but got \"TypeError\"",
"assert_equals: deriveBits with null length correctly threw OperationError: The \"baseKey\" argument must be an instance of CryptoKey. Received null expected \"OperationError\" but got \"TypeError\"",
"assert_equals: deriveBits with non-multiple of 8 length correctly threw OperationError: The \"baseKey\" argument must be an instance of CryptoKey. Received null expected \"OperationError\" but got \"TypeError\"",
"assert_equals: deriveBits with missing deriveBits usage correctly threw InvalidAccessError: The \"baseKey\" argument must be an instance of CryptoKey. Received null expected \"InvalidAccessError\" but got \"TypeError\""
]
}
},
"getRandomValues.any.js": {
"fail": "The data argument must be an integer-type TypedArray"
"derive_bits_keys/pbkdf2.https.any.js": {
"fail": {
"unexpected": [
"assert_equals: deriveBits with null length correctly threw OperationError: The \"length\" argument must be of type number. Received null expected \"OperationError\" but got \"TypeError\"",
"assert_equals: deriveBits with 0 iterations correctly threw OperationError: The value of \"algorithm.iterations\" is out of range. It must be >= 1 && <= 9007199254740991. Received 0 expected \"OperationError\" but got \"RangeError\"",
"assert_equals: derivekey with 0 iterations correctly threw OperationError: The value of \"algorithm.iterations\" is out of range. It must be >= 1 && <= 9007199254740991. Received 0 expected \"OperationError\" but got \"RangeError\"",
"assert_unreached: deriveBits failed with error TypeError: The \"baseKey\" argument must be an instance of CryptoKey. Received null Reached unreachable code",
"assert_unreached: deriveKey failed with error TypeError: The \"baseKey\" argument must be an instance of CryptoKey. Received null Reached unreachable code",
"assert_equals: deriveKey with missing deriveKey usage correctly threw InvalidAccessError: The \"baseKey\" argument must be an instance of CryptoKey. Received null expected \"InvalidAccessError\" but got \"TypeError\"",
"assert_equals: deriveBits with null length correctly threw OperationError: The \"baseKey\" argument must be an instance of CryptoKey. Received null expected \"OperationError\" but got \"TypeError\"",
"assert_equals: deriveBits with 0 length correctly threw OperationError: The \"baseKey\" argument must be an instance of CryptoKey. Received null expected \"OperationError\" but got \"TypeError\"",
"assert_equals: deriveBits with non-multiple of 8 length correctly threw OperationError: The \"baseKey\" argument must be an instance of CryptoKey. Received null expected \"OperationError\" but got \"TypeError\"",
"assert_equals: deriveBits with missing deriveBits usage correctly threw InvalidAccessError: The \"baseKey\" argument must be an instance of CryptoKey. Received null expected \"InvalidAccessError\" but got \"TypeError\"",
"assert_equals: deriveBits with 0 iterations correctly threw OperationError: The \"baseKey\" argument must be an instance of CryptoKey. Received null expected \"OperationError\" but got \"TypeError\"",
"assert_equals: derivekey with 0 iterations correctly threw OperationError: The \"baseKey\" argument must be an instance of CryptoKey. Received null expected \"OperationError\" but got \"TypeError\""
]
}
},
"historical.any.js": {
"fail": "expected (undefined) undefined but got..."
"generateKey/failures_RSA-OAEP.https.any.js": {
"fail": {
"unexpected": [
"assert_equals: Bad algorithm property not supported expected \"OperationError\" but got \"SyntaxError\""
]
}
},
"idlharness.https.any.js": {
"fail": "Various non-IDL-compliant things"
"encrypt_decrypt/rsa_oaep.https.any.js": {
"fail": {
"unexpected": [
"assert_equals: Should throw OperationError instead of error:0200006E:rsa routines::data too large for key size expected \"OperationError\" but got \"Error\""
]
}
}
}

4 changes: 4 additions & 0 deletions test/wpt/test-webcrypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ const runner = new WPTRunner('WebCryptoAPI');
// Set Node.js flags required for the tests.
runner.setFlags(['--experimental-global-webcrypto']);

runner.setInitScript(`
global.location = {};
`);

runner.runJsTests();

0 comments on commit fa1454e

Please sign in to comment.