Skip to content

Commit

Permalink
couple libsodium related fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmunro committed Apr 11, 2017
1 parent a536cca commit 53a4971
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/crypt_sodium.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static function plaintext($string, $key) {
$crypt_string = substr($raw_string, 56);

if (\Sodium\crypto_auth_verify($hmac, $crypt_string, $crypt_key)) {
$res = Sodium\crypto_secretbox_open($crypt_string, $salt, $crypt_key);
$res = \Sodium\crypto_secretbox_open($crypt_string, $salt, $crypt_key);
}
if ($res === false) {
return parent::plaintext($string, $key);
Expand Down Expand Up @@ -68,7 +68,7 @@ public static function hash_password($password, $salt=false, $count=false, $algo
if (!LIBSODIUM) {
return parent::hash_password($password, $salt, $count, $algo, $type);
}
return Sodium\crypto_pwhash_str( $password,
return \Sodium\crypto_pwhash_str( $password,
\Sodium\CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE,
\Sodium\CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE
);
Expand Down
2 changes: 1 addition & 1 deletion lib/framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}

if (!defined('LIBSODIUM')) {
define('LIBSODIUM', extension_loaded('libsodium'));
define('LIBSODIUM', extension_loaded('libsodium') && function_exists('\Sodium\crypto_pwhash_str_verify'));
}

if (!class_exists('Hm_Functions')) {
Expand Down

0 comments on commit 53a4971

Please sign in to comment.