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

Unified Diff: chrome/test/data/extensions/api_test/enterprise_platform_keys/basic.js

Issue 298073009: Reuse WebCrypto's normalizeCryptoAlgorithm in enterprise.platformKeys. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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: chrome/test/data/extensions/api_test/enterprise_platform_keys/basic.js
diff --git a/chrome/test/data/extensions/api_test/enterprise_platform_keys/basic.js b/chrome/test/data/extensions/api_test/enterprise_platform_keys/basic.js
index 557ae680c4cf2d22d441f75f4426449e1c7d161d..a9374e7a91cc3586a0e3dbc3102e925a40ae049d 100644
--- a/chrome/test/data/extensions/api_test/enterprise_platform_keys/basic.js
+++ b/chrome/test/data/extensions/api_test/enterprise_platform_keys/basic.js
@@ -358,6 +358,47 @@ function runTests(userToken) {
]);
},
+ // Call generate key with invalid algorithm parameter, missing
+ // modulusLength.
+ function algorithmParameterMissingModulusLength() {
+ var algorithm = {
+ name: "RSASSA-PKCS1-v1_5",
+ publicExponent:
+ new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
+ hash: {
+ name: "SHA-1",
+ }
+ };
+ userToken.subtleCrypto.generateKey(algorithm, false, ['sign']).then(
+ function(keyPair) {
+ assertTrue(false, 'generateKey was expected to fail');
+ },
+ callbackPass(function(error) {
+ assertEq(
+ new Error('Error: A required parameter was missing our out-of-range'),
+ error);
+ }));
+ },
+
+ // Call generate key with invalid algorithm parameter, missing hash.
+ function algorithmParameterMissingHash() {
+ var algorithm = {
+ name: 'RSASSA-PKCS1-v1_5',
+ modulusLength: 512,
+ publicExponent:
+ new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
+ };
+ userToken.subtleCrypto.generateKey(algorithm, false, ['sign']).then(
+ function(keyPair) {
+ assertTrue(false, 'generateKey was expected to fail');
+ },
+ callbackPass(function(error) {
+ assertEq(
+ new Error('Error: A required parameter was missing our out-of-range'),
+ error);
+ }));
+ },
+
// Imports a certificate for which now private key was imported/generated
// before.
function missingPrivateKey() {

Powered by Google App Engine
This is Rietveld 408576698