Lines Matching refs:salt

108 PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const char *salt, int salt_…  in php_crypt()  argument
118 if (salt[0]=='$' && salt[1]=='1' && salt[2]=='$') { in php_crypt()
121 out = php_md5_crypt_r(password, salt, output); in php_crypt()
126 } else if (salt[0]=='$' && salt[1]=='6' && salt[2]=='$') { in php_crypt()
130 crypt_res = php_sha512_crypt_r(password, salt, output, PHP_MAX_SALT_LEN); in php_crypt()
141 } else if (salt[0]=='$' && salt[1]=='5' && salt[2]=='$') { in php_crypt()
145 crypt_res = php_sha256_crypt_r(password, salt, output, PHP_MAX_SALT_LEN); in php_crypt()
157 salt[0] == '$' && in php_crypt()
158 salt[1] == '2' && in php_crypt()
159 salt[3] == '$') { in php_crypt()
164 crypt_res = php_crypt_blowfish_rn(password, salt, output, sizeof(output)); in php_crypt()
173 } else if (salt[0] == '*' && (salt[1] == '0' || salt[1] == '1')) { in php_crypt()
179 if (salt[0] != '_') { in php_crypt()
181 if (!IS_VALID_SALT_CHARACTER(salt[0]) || !IS_VALID_SALT_CHARACTER(salt[1])) { in php_crypt()
192 crypt_res = _crypt_extended_r(password, salt, &buffer); in php_crypt()
193 if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) { in php_crypt()
203 …if (salt[0] != '$' && salt[0] != '_' && (!IS_VALID_SALT_CHARACTER(salt[0]) || !IS_VALID_SALT_CHARA… in php_crypt()
220 crypt_res = crypt_r(password, salt, &buffer); in php_crypt()
223 crypt_res = crypt(password, salt); in php_crypt()
229 if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) { in php_crypt()
243 char salt[PHP_MAX_SALT_LEN + 1]; in PHP_FUNCTION() local
252 salt[0] = salt[PHP_MAX_SALT_LEN] = '\0'; in PHP_FUNCTION()
256 memset(&salt[1], '$', PHP_MAX_SALT_LEN - 1); in PHP_FUNCTION()
259 memcpy(salt, salt_in, MIN(PHP_MAX_SALT_LEN, salt_in_len)); in PHP_FUNCTION()
265 if (!*salt) { in PHP_FUNCTION()
266 strncpy(salt, "$1$", 3); in PHP_FUNCTION()
267 php_random_bytes_throw(&salt[3], 8); in PHP_FUNCTION()
268 php_to64(&salt[3], 8); in PHP_FUNCTION()
269 strncpy(&salt[11], "$", PHP_MAX_SALT_LEN - 11); in PHP_FUNCTION()
270 salt_in_len = strlen(salt); in PHP_FUNCTION()
274 salt[salt_in_len] = '\0'; in PHP_FUNCTION()
276 if ((result = php_crypt(str, (int)str_len, salt, (int)salt_in_len, 0)) == NULL) { in PHP_FUNCTION()
277 if (salt[0] == '*' && salt[1] == '0') { in PHP_FUNCTION()