aboutsummaryrefslogblamecommitdiffstats
path: root/library/sodium-plus/build/pre-build.patch
blob: d6304bf65c54e3ba3b3e10b807073a604b7e5668 (plain) (tree)
























































                                                                          
diff --git a/lib/backend/sodiumnative.js b/lib/backend/sodiumnative.js
index a592b10..f268085 100644
--- a/lib/backend/sodiumnative.js
+++ b/lib/backend/sodiumnative.js
@@ -1,12 +1,5 @@
 let loaded = false;
-let _sodium;
-/* istanbul ignore next */
-try {
-    _sodium = require('sodium-native');
-    loaded = true;
-} catch (e) {
-    _sodium = {};
-}
+let _sodium = {};
 const Backend = require('../backend');
 const CryptographyKey = require('../cryptography-key');
 const SodiumError = require('../sodium-error');
diff --git a/lib/sodiumplus.js b/lib/sodiumplus.js
index a592b10..f268085 100644
--- a/lib/sodiumplus.js
+++ b/lib/sodiumplus.js
@@ -4,7 +4,6 @@
 const Ed25519PublicKey = require('./keytypes/ed25519pk');
 const LibsodiumWrappersBackend = require('./backend/libsodium-wrappers');
 const SodiumError = require('./sodium-error');
-const SodiumNativeBackend = require('./backend/sodiumnative');
 const X25519PublicKey = require('./keytypes/x25519pk');
 const X25519SecretKey = require('./keytypes/x25519sk');
 const Util = require('./util');
@@ -41,7 +40,7 @@
      * @return {boolean}
      */
     isSodiumNative() {
-        return (this.backend instanceof SodiumNativeBackend);
+        return false;
     }
 
     /**
@@ -60,16 +59,7 @@
      * @return {Promise<SodiumPlus>}
      */
     static async auto() {
-        let backend;
-        try {
-            backend = await SodiumNativeBackend.init();
-        } catch (e) {
-            backend = await LibsodiumWrappersBackend.init();
-        }
-        /* istanbul ignore if */
-        if (!backend) {
-            backend = await LibsodiumWrappersBackend.init();
-        }
+        let backend = await LibsodiumWrappersBackend.init();
         Util.populateConstants(backend);
         return new SodiumPlus(backend);
     }