From b756d35b8ff1f71f9f39fe89bf62b1980fc88d3e Mon Sep 17 00:00:00 2001 From: Sanjana Rajan <srajan1@stanford.edu> Date: Wed, 20 Sep 2017 18:28:37 +0200 Subject: [PATCH] use hash param in rsa key gen with webkit subtle --- src/crypto/public_key/rsa.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/crypto/public_key/rsa.js b/src/crypto/public_key/rsa.js index 89510f49..e87eb904 100644 --- a/src/crypto/public_key/rsa.js +++ b/src/crypto/public_key/rsa.js @@ -153,7 +153,10 @@ export default function RSA() { keyGenOpt = { name: 'RSA-OAEP', modulusLength: B, // the specified keysize in bits - publicExponent: Euint8.subarray(0, 3) // take three bytes (max 65537) + publicExponent: Euint8.subarray(0, 3), // take three bytes (max 65537) + hash: { + name: 'SHA-1' // not required for actual RSA keys, but for crypto api 'sign' and 'verify' + } }; keys = webCrypto.generateKey(keyGenOpt, true, ['encrypt', 'decrypt']); }