sodium-friends / sodium-javascript

Pure Javascript version of sodium-native
MIT License
92 stars 24 forks source link

Fix crypto_secretbox return value #38

Open christianbundy opened 4 years ago

christianbundy commented 4 years ago

Problem: This doesn't cause a bug, when crypto_secretbox returns an integer (0) then the check on line 97 always fails because it checks whether the return value triple-equals false.

Solution: Change crypto_secretbox so that it returns booleans rather than integers, which gives us the ability to make the check on line 97 fail (if we ever return anything other than true).