diff --git a/lib/core.js b/lib/core.js index a740eec..9ba2066 100644 --- a/lib/core.js +++ b/lib/core.js @@ -80,8 +80,6 @@ module.exports.create = function (gl) { } return utils.testEmail(args.email).then(function () { - var keypairOpts = { public: true, pem: true }; - var promise = gl.store.accounts.checkKeypairAsync(args).then(function (keypair) { if (keypair) { return RSA.import(keypair); @@ -91,7 +89,8 @@ module.exports.create = function (gl) { return gl.store.accounts.setKeypairAsync(args, RSA.import(args.accountKeypair)); } - return RSA.generateKeypairAsync(args.rsaKeySize, 65537, keypairOpts).then(function (keypair) { + var keypairOpts = { bitlen: args.rsaKeySize, exp: 65537, public: true, pem: true }; + return RSA.generateKeypairAsync(keypairOpts).then(function (keypair) { keypair.privateKeyPem = RSA.exportPrivatePem(keypair); keypair.publicKeyPem = RSA.exportPublicPem(keypair); keypair.privateKeyJwk = RSA.exportPrivateJwk(keypair); @@ -253,8 +252,8 @@ module.exports.create = function (gl) { return gl.store.certificates.setKeypairAsync(args, RSA.import(args.domainKeypair)); } - var keypairOpts = { public: true, pem: true }; - return RSA.generateKeypairAsync(args.rsaKeySize, 65537, keypairOpts).then(function (keypair) { + var keypairOpts = { bitlen: args.rsaKeySize, exp: 65537, public: true, pem: true }; + return RSA.generateKeypairAsync(keypairOpts).then(function (keypair) { keypair.privateKeyPem = RSA.exportPrivatePem(keypair); keypair.publicKeyPem = RSA.exportPublicPem(keypair); keypair.privateKeyJwk = RSA.exportPrivateJwk(keypair); diff --git a/package.json b/package.json index 3b55719..c2b6a1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "greenlock", - "version": "2.3.7", + "version": "2.3.8", "description": "Let's Encrypt for node.js on npm", "main": "index.js", "files": [ @@ -62,7 +62,7 @@ "le-store-certbot": "^2.1.7", "node.extend": "^1.1.5", "pkijs": "^1.3.27", - "rsa-compat": "^1.4.0" + "rsa-compat": "^1.5.0" }, "engines": { "node": ">=4.5"