Skip to content

Commit

Permalink
Inverted logic introduced since 2.0.15
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-security committed Jul 4, 2018
1 parent 0b57539 commit fe5213f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/random_bytes_libsodium.php
Expand Up @@ -74,7 +74,7 @@ function random_bytes($bytes)
$buf = \Sodium\randombytes_buf($bytes);
}

if (!is_string($buf)) {
if (is_string($buf)) {
if (RandomCompat_strlen($buf) === $bytes) {
return (string) $buf;
}
Expand Down

0 comments on commit fe5213f

Please sign in to comment.