Lines Matching refs:salt

98 PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const char *salt, int salt_…  in php_crypt()  argument
103 if (salt[0] == '*' && (salt[1] == '0' || salt[1] == '1')) { in php_crypt()
113 if (salt[0]=='$' && salt[1]=='1' && salt[2]=='$') { in php_crypt()
116 out = php_md5_crypt_r(password, salt, output); in php_crypt()
121 } else if (salt[0]=='$' && salt[1]=='6' && salt[2]=='$') { in php_crypt()
125 crypt_res = php_sha512_crypt_r(password, salt, output, PHP_MAX_SALT_LEN); in php_crypt()
136 } else if (salt[0]=='$' && salt[1]=='5' && salt[2]=='$') { in php_crypt()
140 crypt_res = php_sha256_crypt_r(password, salt, output, PHP_MAX_SALT_LEN); in php_crypt()
152 salt[0] == '$' && in php_crypt()
153 salt[1] == '2' && in php_crypt()
154 salt[3] == '$') { in php_crypt()
159 crypt_res = php_crypt_blowfish_rn(password, salt, output, sizeof(output)); in php_crypt()
172 if (salt[0] != '_') { in php_crypt()
174 if (!IS_VALID_SALT_CHARACTER(salt[0]) || !IS_VALID_SALT_CHARACTER(salt[1])) { in php_crypt()
185 crypt_res = _crypt_extended_r((const unsigned char *) password, salt, &buffer); in php_crypt()
186 if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) { in php_crypt()
196 …if (salt[0] != '$' && salt[0] != '_' && (!IS_VALID_SALT_CHARACTER(salt[0]) || !IS_VALID_SALT_CHARA… in php_crypt()
213 crypt_res = crypt_r(password, salt, &buffer); in php_crypt()
216 crypt_res = crypt(password, salt); in php_crypt()
222 if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) { in php_crypt()
236 char salt[PHP_MAX_SALT_LEN + 1]; in PHP_FUNCTION() local
247 salt[0] = salt[PHP_MAX_SALT_LEN] = '\0'; in PHP_FUNCTION()
251 memset(&salt[1], '$', PHP_MAX_SALT_LEN - 1); in PHP_FUNCTION()
254 memcpy(salt, salt_in, MIN(PHP_MAX_SALT_LEN, salt_in_len)); in PHP_FUNCTION()
260 if (!*salt) { in PHP_FUNCTION()
261 memcpy(salt, "$1$", 3); in PHP_FUNCTION()
262 php_random_bytes_throw(&salt[3], 8); in PHP_FUNCTION()
263 php_to64(&salt[3], 8); in PHP_FUNCTION()
264 strncpy(&salt[11], "$", PHP_MAX_SALT_LEN - 11); in PHP_FUNCTION()
265 salt_in_len = strlen(salt); in PHP_FUNCTION()
269 salt[salt_in_len] = '\0'; in PHP_FUNCTION()
271 if ((result = php_crypt(str, (int)str_len, salt, (int)salt_in_len, 0)) == NULL) { in PHP_FUNCTION()
272 if (salt[0] == '*' && salt[1] == '0') { in PHP_FUNCTION()