mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2026-03-17 13:54:55 +00:00
Don't use Node symmetric crypto when !config.use_native
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user