Skip to content

Commit c86d46f

Browse files
committed
fix encrypt engine choice bug
1 parent f893220 commit c86d46f

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-rsa",
3-
"version": "0.2.20",
3+
"version": "0.2.21",
44
"description": "Node.js RSA library",
55
"main": "src/NodeRSA.js",
66
"scripts": {

src/encryptEngines/encryptEngines.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ var crypt = require('crypto');
22

33
module.exports = {
44
getEngine: function (keyPair, options) {
5-
var engine;
6-
if (options.environment === 'browser') {
7-
engine = require('./js.js');
8-
} else {
5+
var engine = require('./js.js');
6+
if (options.environment === 'node') {
97
if (typeof crypt.publicEncrypt === 'function' && typeof crypt.privateDecrypt === 'function') {
108
if (typeof crypt.privateEncrypt === 'function' && typeof crypt.publicDecrypt === 'function') {
119
engine = require('./io.js');

0 commit comments

Comments
 (0)