Lines Matching refs:salt

148 PHPAPI int php_crypt(const char *password, const int pass_len, const char *salt, int salt_len, char…  in php_crypt()  argument
157 if (salt[0]=='$' && salt[1]=='1' && salt[2]=='$') { in php_crypt()
160 out = php_md5_crypt_r(password, salt, output); in php_crypt()
166 } else if (salt[0]=='$' && salt[1]=='6' && salt[2]=='$') { in php_crypt()
170 crypt_res = php_sha512_crypt_r(password, salt, output, PHP_MAX_SALT_LEN); in php_crypt()
181 } else if (salt[0]=='$' && salt[1]=='5' && salt[2]=='$') { in php_crypt()
185 crypt_res = php_sha256_crypt_r(password, salt, output, PHP_MAX_SALT_LEN); in php_crypt()
197 salt[0] == '$' && in php_crypt()
198 salt[1] == '2' && in php_crypt()
199 salt[3] == '$' && in php_crypt()
200 salt[4] >= '0' && salt[4] <= '3' && in php_crypt()
201 salt[5] >= '0' && salt[5] <= '9' && in php_crypt()
202 salt[6] == '$') { in php_crypt()
207 crypt_res = php_crypt_blowfish_rn(password, salt, output, sizeof(output)); in php_crypt()
220 crypt_res = _crypt_extended_r(password, salt, &buffer); in php_crypt()
221 if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) { in php_crypt()
241 crypt_res = crypt_r(password, salt, &buffer); in php_crypt()
242 if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) { in php_crypt()
259 char salt[PHP_MAX_SALT_LEN + 1]; in PHP_FUNCTION() local
262 salt[0] = salt[PHP_MAX_SALT_LEN] = '\0'; in PHP_FUNCTION()
266 memset(&salt[1], '$', PHP_MAX_SALT_LEN - 1); in PHP_FUNCTION()
273 memcpy(salt, salt_in, MIN(PHP_MAX_SALT_LEN, salt_in_len)); in PHP_FUNCTION()
277 if (!*salt) { in PHP_FUNCTION()
279 strncpy(salt, "$1$", PHP_MAX_SALT_LEN); in PHP_FUNCTION()
280 php_to64(&salt[3], PHP_CRYPT_RAND, 4); in PHP_FUNCTION()
281 php_to64(&salt[7], PHP_CRYPT_RAND, 4); in PHP_FUNCTION()
282 strncpy(&salt[11], "$", PHP_MAX_SALT_LEN - 11); in PHP_FUNCTION()
284 php_to64(&salt[0], PHP_CRYPT_RAND, 2); in PHP_FUNCTION()
285 salt[2] = '\0'; in PHP_FUNCTION()
287 salt_in_len = strlen(salt); in PHP_FUNCTION()
291 salt[salt_in_len] = '\0'; in PHP_FUNCTION()
293 if (php_crypt(str, str_len, salt, salt_in_len, &result) == FAILURE) { in PHP_FUNCTION()
294 if (salt[0] == '*' && salt[1] == '0') { in PHP_FUNCTION()