diff options
author | Alex Aubuchon <alex@aub.dev> | 2019-05-28 14:11:45 -0700 |
---|---|---|
committer | Ali Ijaz Sheikh <ofrobots@google.com> | 2019-06-05 11:37:33 -0700 |
commit | 56d338305d24c29a8898486bd30752665cedb913 (patch) | |
tree | e6d0733607047969521e6afdfb24439f41faef02 /test/parallel/test-crypto.js | |
parent | ee00111f2062ffe67d18de04a178ac39ed58f503 (diff) | |
download | android-node-v8-56d338305d24c29a8898486bd30752665cedb913.tar.gz android-node-v8-56d338305d24c29a8898486bd30752665cedb913.tar.bz2 android-node-v8-56d338305d24c29a8898486bd30752665cedb913.zip |
test: move rsa keypairs to fixtures/keys/
Also adds make'd signatures for use in tests of signing/verification.
All of the moved keys can be regenerated at will without breaking tests
now.
PR-URL: https://github.com/nodejs/node/pull/27962
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test/parallel/test-crypto.js')
-rw-r--r-- | test/parallel/test-crypto.js | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js index 1952f8908a..86c617815f 100644 --- a/test/parallel/test-crypto.js +++ b/test/parallel/test-crypto.js @@ -224,17 +224,12 @@ assert.throws(function() { }); assert.throws(function() { - // The correct header inside `test_bad_rsa_privkey.pem` should have been + // The correct header inside `rsa_private_pkcs8_bad.pem` should have been // -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- // instead of // -----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY----- - // It is generated in this way: - // $ openssl genrsa -out mykey.pem 512; - // $ openssl pkcs8 -topk8 -inform PEM -outform PEM -in mykey.pem \ - // -out private_key.pem -nocrypt; - // Then open private_key.pem and change its header and footer. - const sha1_privateKey = fixtures.readSync('test_bad_rsa_privkey.pem', - 'ascii'); + const sha1_privateKey = fixtures.readKey('rsa_private_pkcs8_bad.pem', + 'ascii'); // This would inject errors onto OpenSSL's error stack crypto.createSign('sha1').sign(sha1_privateKey); }, (err) => { |