Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: LayoutTests/crypto/rsa-oaep-generateKey-parseAlgorithm-failures.html

Issue 289073005: [webcrypto] Hook up parameter normalization for RSA-OAEP. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/crypto/rsa-oaep-generateKey-parseAlgorithm-failures.html
diff --git a/LayoutTests/crypto/rsa-oaep-generateKey-parseAlgorithm-failures.html b/LayoutTests/crypto/rsa-oaep-generateKey-parseAlgorithm-failures.html
new file mode 100644
index 0000000000000000000000000000000000000000..cb46504cc1778d8ac7ef076c71ea78c1cdb020e8
--- /dev/null
+++ b/LayoutTests/crypto/rsa-oaep-generateKey-parseAlgorithm-failures.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../resources/js-test.js"></script>
+<script src="resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Tests generateKey() with bad RSA-OAEP parameters.");
+jsTestIsAsync = true;
+
+extractable = true;
+keyUsages = ['sign', 'verify'];
+
+Promise.resolve(null).then(function() {
+ return crypto.subtle.generateKey({name: 'RSA-OAEP', hash: {name: 'sha-1'}, modulusLength: -30}, extractable , keyUsages);
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
+
+ return crypto.subtle.generateKey({name: 'RSA-OAEP', hash: {name: 'sha-1'}, modulusLength: NaN}, extractable , keyUsages);
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
+
+ return crypto.subtle.generateKey({name: 'RSA-OAEP', hash: {name: 'sha-1'}}, extractable, keyUsages);
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
+
+ return crypto.subtle.generateKey({name: 'RSA-OAEP', hash: {name: 'sha-1'}, modulusLength: 10}, extractable , keyUsages);
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
+
+ return crypto.subtle.generateKey({name: 'RSA-OAEP', hash: {name: 'sha-1'}, modulusLength: 10, publicExponent: 10}, extractable , keyUsages);
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
+
+ return crypto.subtle.generateKey({name: 'RSA-OAEP', hash: {name: 'sha-1'}, modulusLength: 10, publicExponent: null}, extractable , keyUsages);
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
+
+ return crypto.subtle.generateKey({name: 'RSA-OAEP', hash: {name: 'NOT-A-HASH'}, modulusLength: 10, publicExponent: new Uint8Array(3)}, extractable , keyUsages);
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
+
+ return crypto.subtle.generateKey({name: 'RSA-OAEP', hash: {name: 'sha-1'}, modulusLength: 10, publicExponent: new Uint8Array(3)}, extractable , keyUsages);
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
+}).then(finishJSTest, failAndFinishJSTest);
+
+</script>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698