bugfix: throw error when key gen entirely fails
This commit is contained in:
parent
be782fbdfa
commit
92463a6ec2
|
@ -48,11 +48,10 @@ module.exports = function (bitlen, exp) {
|
||||||
try {
|
try {
|
||||||
return require('./generate-privkey-forge.js')(bitlen, exp);
|
return require('./generate-privkey-forge.js')(bitlen, exp);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
if (e.code !== 'MODULE_NOT_FOUND') {
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
console.error("[ERROR] rsa-compat: could not generate a private key.");
|
console.error("[ERROR] rsa-compat: could not generate a private key.");
|
||||||
console.error("None of crypto.generateKeyPair, ursa, nor node-forge are present");
|
console.error("None of crypto.generateKeyPair, ursa, nor node-forge are present");
|
||||||
|
console.error("");
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "rsa-compat",
|
"name": "rsa-compat",
|
||||||
"version": "2.0.6",
|
"version": "2.0.7",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.12"
|
"node": ">=10.12"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue