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

Unified Diff: LayoutTests/crypto/resources/common.js

Issue 24467004: [webcrypto] Remove MockWebCrypto. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 3 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
« no previous file with comments | « LayoutTests/crypto/importKey-expected.txt ('k') | LayoutTests/crypto/sign-verify.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/crypto/resources/common.js
diff --git a/LayoutTests/crypto/resources/common.js b/LayoutTests/crypto/resources/common.js
index f003e53c0e97ab50bf134be76e7a0a0af27a2a04..17a2effe2be84154ab6ef1598f21486428cb9131 100644
--- a/LayoutTests/crypto/resources/common.js
+++ b/LayoutTests/crypto/resources/common.js
@@ -1,21 +1,19 @@
function importTestKeys()
{
- var keyFormat = "spki";
- var data = new Uint8Array([]);
+ var keyFormat = "raw";
+ var data = asciiToArrayBuffer("16 bytes of key!");
var extractable = true;
var keyUsages = ['encrypt', 'decrypt', 'sign', 'verify'];
var hmacPromise = crypto.subtle.importKey(keyFormat, data, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, keyUsages);
- var rsaSsaPromise = crypto.subtle.importKey(keyFormat, data, {name: 'RSASSA-PKCS1-v1_5', hash: {name: 'sha-1'}}, extractable, keyUsages);
var aesCbcPromise = crypto.subtle.importKey(keyFormat, data, {name: 'AES-CBC'}, extractable, keyUsages);
var aesCbcJustDecrypt = crypto.subtle.importKey(keyFormat, data, {name: 'AES-CBC'}, false, ['decrypt']);
- return Promise.all([hmacPromise, rsaSsaPromise, aesCbcPromise, aesCbcJustDecrypt]).then(function(results) {
+ return Promise.all([hmacPromise, aesCbcPromise, aesCbcJustDecrypt]).then(function(results) {
return {
hmacSha1: results[0],
- rsaSsaSha1: results[1],
- aesCbc: results[2],
- aesCbcJustDecrypt: results[3],
+ aesCbc: results[1],
+ aesCbcJustDecrypt: results[2],
};
});
}
@@ -37,6 +35,11 @@ function byteArrayToHexString(bytes)
return "[" + hexBytes.join(" ") + "]";
}
+function arrayBufferToHexString(buffer)
+{
+ return byteArrayToHexString(new Uint8Array(buffer));
+}
+
function asciiToArrayBuffer(str)
{
var chars = [];
« no previous file with comments | « LayoutTests/crypto/importKey-expected.txt ('k') | LayoutTests/crypto/sign-verify.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698