Ver código fonte

Use random_bytes() to generate IV where available (PHP 7.x)

pull/102/head
Kitty Cat 7 anos atrás
pai
commit
f978c1b83e
1 arquivos alterados com 5 adições e 1 exclusões
  1. +5
    -1
      inc/mod/auth.php

+ 5
- 1
inc/mod/auth.php Ver arquivo

@@ -70,7 +70,11 @@ function test_password($password, $salt, $test) {

function generate_salt() {
// 128 bits of entropy
return strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');
if (function_exists('random_bytes')) {
return strtr(base64_encode(random_bytes(16)), '+', '.');
} else {
return strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');
}
}

function login($username, $password) {


Carregando…
Cancelar
Salvar