Don't use Node symmetric crypto when !config.use_native
This commit is contained in:
parent
fc0052e35a
commit
801b44f2e7
|
@ -50,7 +50,7 @@ const nodeAlgos = {
|
|||
|
||||
export default {
|
||||
encrypt: function(algo, key, plaintext, iv) {
|
||||
if (nodeCrypto && nodeAlgos[algo]) { // Node crypto library.
|
||||
if (util.getNodeCrypto() && nodeAlgos[algo]) { // Node crypto library.
|
||||
return nodeEncrypt(algo, key, plaintext, iv);
|
||||
}
|
||||
if (algo.substr(0, 3) === 'aes') {
|
||||
|
@ -83,7 +83,7 @@ export default {
|
|||
},
|
||||
|
||||
decrypt: async function(algo, key, ciphertext, iv) {
|
||||
if (nodeCrypto && nodeAlgos[algo]) { // Node crypto library.
|
||||
if (util.getNodeCrypto() && nodeAlgos[algo]) { // Node crypto library.
|
||||
return nodeDecrypt(algo, key, ciphertext, iv);
|
||||
}
|
||||
if (algo.substr(0, 3) === 'aes') {
|
||||
|
|
Loading…
Reference in New Issue
Block a user