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

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

Issue 24467004: [webcrypto] Remove MockWebCrypto. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove some unused params 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
Index: LayoutTests/crypto/resources/common.js
diff --git a/LayoutTests/crypto/resources/common.js b/LayoutTests/crypto/resources/common.js
index a8e2e300a92d8ea5ce448b1e258ed371dd210759..36ffeb61441f1882e2dcc3e7a9f100fcc6caa76a 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.every(hmacPromise, rsaSsaPromise, aesCbcPromise, aesCbcJustDecrypt).then(function(results) {
+ return Promise.every(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 = [];

Powered by Google App Engine
This is Rietveld 408576698