/PHP-7.1/ext/standard/ |
H A D | crypt.c | 118 if (salt[0]=='$' && salt[1]=='1' && salt[2]=='$') { in php_crypt() 126 } else if (salt[0]=='$' && salt[1]=='6' && salt[2]=='$') { in php_crypt() 141 } else if (salt[0]=='$' && salt[1]=='5' && salt[2]=='$') { in php_crypt() 157 salt[0] == '$' && in php_crypt() 173 } else if (salt[0] == '*' && (salt[1] == '0' || salt[1] == '1')) { 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() 229 if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) { in php_crypt() 252 salt[0] = salt[PHP_MAX_SALT_LEN] = '\0'; in PHP_FUNCTION() 265 if (!*salt) { in PHP_FUNCTION() [all …]
|
H A D | config.m4 | 124 char salt[15], answer[40]; 127 salt[0]='$'; salt[1]='1'; salt[2]='$'; 128 salt[3]='r'; salt[4]='a'; salt[5]='s'; 129 salt[6]='m'; salt[7]='u'; salt[8]='s'; 130 salt[9]='l'; salt[10]='e'; salt[11]='$'; 131 salt[12]='\0'; 132 strcpy(answer,salt); 162 …salt[0]='$'; salt[1]='2'; salt[2]='a'; salt[3]='$'; salt[4]='0'; salt[5]='7'; salt[6]='$'; salt[7]… 164 strcpy(answer,salt); 195 strcpy(answer, salt); [all …]
|
H A D | php_crypt_r.h | 51 extern char * php_md5_crypt_r(const char *pw, const char *salt, char *out); 52 extern char * php_sha512_crypt_r (const char *key, const char *salt, char *buffer, int buflen); 53 extern char * php_sha256_crypt_r (const char *key, const char *salt, char *buffer, int buflen);
|
H A D | password.c | 263 char hash_format[8], *hash, *salt, *password; in PHP_FUNCTION() local 336 salt = safe_emalloc(required_salt_len, 1, 1); in PHP_FUNCTION() 338 efree(salt); in PHP_FUNCTION() 345 salt = safe_emalloc(required_salt_len, 1, 1); in PHP_FUNCTION() 346 memcpy(salt, ZSTR_VAL(buffer), required_salt_len); in PHP_FUNCTION() 351 salt = safe_emalloc(required_salt_len, 1, 1); in PHP_FUNCTION() 352 if (php_password_make_salt(required_salt_len, salt) == FAILURE) { in PHP_FUNCTION() 353 efree(salt); in PHP_FUNCTION() 359 salt[salt_len] = 0; in PHP_FUNCTION() 362 sprintf(hash, "%s%s", hash_format, salt); in PHP_FUNCTION() [all …]
|
H A D | crypt_sha256.c | 369 salt += sizeof(sha256_salt_prefix) - 1; in php_sha256_crypt_r() 377 salt = endp + 1; in php_sha256_crypt_r() 383 salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX); in php_sha256_crypt_r() 391 if ((salt - (char *) 0) % __alignof__(uint32_t) != 0) { in php_sha256_crypt_r() 393 salt = copied_salt = in php_sha256_crypt_r() 407 sha256_process_bytes(salt, salt_len, &ctx); in php_sha256_crypt_r() 418 sha256_process_bytes(salt, salt_len, &alt_ctx); in php_sha256_crypt_r() 469 sha256_process_bytes(salt, salt_len, &alt_ctx); in php_sha256_crypt_r() 603 + (int)strlen(salt) + 1 + 43 + 1); in php_sha256_crypt() 615 return php_sha256_crypt_r(key, salt, buffer, buflen); in php_sha256_crypt() [all …]
|
H A D | crypt_sha512.c | 402 salt += sizeof(sha512_salt_prefix) - 1; in php_sha512_crypt_r() 411 salt = endp + 1; in php_sha512_crypt_r() 417 salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX); in php_sha512_crypt_r() 428 …salt = copied_salt = memcpy(tmp + __alignof__(uint64_t) - (tmp - (char *) 0) % __alignof__(uint64_… in php_sha512_crypt_r() 441 sha512_process_bytes(salt, salt_len, &ctx); in php_sha512_crypt_r() 452 sha512_process_bytes(salt, salt_len, &alt_ctx); in php_sha512_crypt_r() 504 sha512_process_bytes(salt, salt_len, &alt_ctx); in php_sha512_crypt_r() 641 php_sha512_crypt(const char *key, const char *salt) { in php_sha512_crypt() argument 650 + strlen(salt) + 1 + 86 + 1); in php_sha512_crypt() 662 return php_sha512_crypt_r (key, salt, buffer, buflen); in php_sha512_crypt() [all …]
|
H A D | crypt_blowfish.c | 669 BF_word salt[4]; in BF_crypt() member 702 BF_swap(data.binary.salt, 4); in BF_crypt() 711 L ^= data.binary.salt[i & 2]; in BF_crypt() 712 R ^= data.binary.salt[(i & 2) + 1]; in BF_crypt() 721 L ^= data.binary.salt[(BF_N + 2) & 3]; in BF_crypt() 722 R ^= data.binary.salt[(BF_N + 3) & 3]; in BF_crypt() 727 L ^= data.binary.salt[(BF_N + 4) & 3]; in BF_crypt() 749 tmp1 = data.binary.salt[0]; in BF_crypt() 750 tmp2 = data.binary.salt[1]; in BF_crypt() 751 tmp3 = data.binary.salt[2]; in BF_crypt() [all …]
|
H A D | crypt_freesec.c | 355 setup_salt(uint32_t salt, struct php_crypt_extended_data *data) in setup_salt() argument 360 if (salt == data->old_salt) in setup_salt() 362 data->old_salt = salt; in setup_salt() 368 if (salt & saltbit) in setup_salt() 580 des_cipher(const char *in, char *out, uint32_t salt, int count, in des_cipher() argument 586 setup_salt(salt, data); in des_cipher() 618 uint32_t count, salt, l, r0, r1, keybuf[2]; in _crypt_extended_r() local 652 for (i = 5, salt = 0; i < 9; i++) { in _crypt_extended_r() 656 salt |= value << (i - 5) * 6; in _crypt_extended_r() 690 salt = (ascii_to_bin(setting[1]) << 6) in _crypt_extended_r() [all …]
|
H A D | php_crypt_r.c | 127 char * php_md5_crypt_r(const char *pw, const char *salt, char *out) { in php_md5_crypt_r() argument 136 const char *sp = salt; in php_md5_crypt_r() 137 const char *ep = salt; in php_md5_crypt_r() 150 sp = salt; in php_md5_crypt_r() 319 char * php_md5_crypt_r(const char *pw, const char *salt, char *out) in php_md5_crypt_r() argument 332 sp = salt; in php_md5_crypt_r()
|
H A D | php_crypt.h | 26 PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const char *salt, int salt_…
|
/PHP-7.1/ext/standard/tests/strings/ |
H A D | bug73058.phpt | 2 Bug #73058 crypt broken when salt is 'too' long 13 $salt = '$2y$07$usesomesillystringforsalt$'; 14 var_dump(crypt($pass, $salt)); 16 $salt = '$2y$07$usesomesillystringforsaltzzzzzzzzzzzzz$'; 17 var_dump(crypt($pass, $salt)); 19 $salt = '$2y$07$usesomesillystringforx'; 20 var_dump(crypt($pass, $salt));
|
H A D | bug50052.phpt | 5 $salt = '$1$f+uslYF01$'; 7 echo $salt . "\n"; 8 echo crypt($password,$salt) . "\n";
|
H A D | crypt_blowfish_variation1.phpt | 20 foreach($salts as $i=>$salt) { 21 $crypt = crypt(b'U*U', $salt);
|
H A D | crypt.phpt | 38 Notice: crypt(): No salt parameter was specified. You must use a randomly generated salt and a stro…
|
/PHP-7.1/ext/standard/tests/password/ |
H A D | password_bcrypt_errors.phpt | 11 var_dump(password_hash("foo", PASSWORD_BCRYPT, array("salt" => "foo"))); 13 var_dump(password_hash("foo", PASSWORD_BCRYPT, array("salt" => "123456789012345678901"))); 15 var_dump(password_hash("foo", PASSWORD_BCRYPT, array("salt" => 123))); 27 Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in %s on line … 29 Warning: password_hash(): Provided salt is too short: 3 expecting 22 in %s on line %d 32 Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in %s on line … 34 Warning: password_hash(): Provided salt is too short: 21 expecting 22 in %s on line %d 37 Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in %s on line … 39 Warning: password_hash(): Provided salt is too short: 3 expecting 22 in %s on line %d
|
H A D | password_hash_error.phpt | 19 var_dump(password_hash("123", PASSWORD_BCRYPT, array("salt" => array()))); 21 /* Non-string salt, checking for memory leaks */ 22 var_dump(password_hash('123', PASSWORD_BCRYPT, array('salt' => 1234))); 44 Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in %s on line … 46 Warning: password_hash(): Non-string salt parameter supplied in %s on line %d 49 Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in %s on line … 51 Warning: password_hash(): Provided salt is too short: 4 expecting 22 in %s on line %d
|
H A D | password_deprecated_salts.phpt | 8 var_dump(password_hash("rasmuslerdorf", PASSWORD_BCRYPT, array("cost" => 7, "salt" => "usesomesilly… 10 var_dump(password_hash("test", PASSWORD_BCRYPT, array("salt" => "123456789012345678901" . chr(0)))); 15 Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in %s on line … 18 Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in %s on line …
|
/PHP-7.1/ext/hash/tests/ |
H A D | hash_pbkdf2_error.phpt | 8 /* {{{ proto string hash_pbkdf2(string algo, string password, string salt, int iterations [, int le… 9 Generate a PBKDF2 hash of the given password and salt 15 $salt = 'salt'; 24 var_dump(@hash_pbkdf2('crc32', $password, $salt)); 28 var_dump(@hash_pbkdf2('crc32', $password, $salt, 10, 10, true, 'extra arg')); 32 var_dump(@hash_pbkdf2('foo', $password, $salt, 1)); 36 var_dump(@hash_pbkdf2('md5', $password, $salt, 0)); 38 var_dump(@hash_pbkdf2('md5', $password, $salt, -1)); 42 var_dump(@hash_pbkdf2('md5', $password, $salt, 1, -1));
|
H A D | hash_pbkdf2_basic.phpt | 16 echo "sha1: " . hash_pbkdf2('sha1', 'password', 'salt', 1, 20)."\n"; 17 echo "sha1(no length): " . hash_pbkdf2('sha1', 'password', 'salt', 1)."\n"; 18 echo "sha1(raw): " . bin2hex(hash_pbkdf2('sha1', 'password', 'salt', 1, 20, TRUE))."\n"; 21 echo "sha256: " . hash_pbkdf2('sha256', 'password', 'salt', 1, 20)."\n"; 22 echo "sha256(no length): " . hash_pbkdf2('sha256', 'password', 'salt', 1)."\n"; 23 echo "sha256(raw): " . bin2hex(hash_pbkdf2('sha256', 'password', 'salt', 1, 20, TRUE))."\n";
|
H A D | bug64745.phpt | 7 $hash = hash_pbkdf2('sha1', 'password', 'salt', 1, 0); 8 $rawHash = hash_pbkdf2('sha1', 'password', 'salt', 1, 0, true);
|
H A D | mhash_003.phpt | 26 $salt = str_repeat($hash, 2); 27 $result = mhash_keygen_s2k(constant($hash), $passwd, $salt, 100);
|
H A D | hash_hkdf_rfc5869.phpt | 8 …g hkdf ( string $algo , string $ikm [, int $length , string $info = '' , string $salt = '' ] ) 30 echo "Test case 3 (SHA-256 with zero-length salt, info): ", 54 echo "Test case 6 (SHA-1 with zero-length salt, info): ", 62 echo "Test case 7 (SHA-1 with zero-length info, salt not provided): ", 75 Test case 3 (SHA-256 with zero-length salt, info): 8da4e775a563c18f715f802a063c5a31b8a11f5c5ee1879e… 78 Test case 6 (SHA-1 with zero-length salt, info): 0ac1af7002b3d761d1e55298da9d0506b9ae52057220a306e0… 79 Test case 7 (SHA-1 with zero-length info, salt not provided): 2c91117204d745f3500d636a62f64f0ab3bae…
|
/PHP-7.1/ext/standard/tests/crypt/ |
H A D | des_fallback_invalid_salt.phpt | 11 Deprecated: crypt(): Supplied salt is not valid for DES. Possible bug in provided salt format. in %… 14 Deprecated: crypt(): Supplied salt is not valid for DES. Possible bug in provided salt format. in %…
|
/PHP-7.1/ext/openssl/tests/ |
H A D | openssl_pbkdf2_basic.phpt | 8 var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 1))); 9 var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 2))); 10 var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 4096))); 14 var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 16777216)));
|
/PHP-7.1/ext/hash/ |
H A D | hash.c | 623 zend_string *returnval, *ikm, *algo, *info = NULL, *salt = NULL; in PHP_FUNCTION() local 630 …if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|lSS", &algo, &ikm, &length, &info, &salt) == FAILUR… in PHP_FUNCTION() 666 (unsigned char *) (salt ? ZSTR_VAL(salt) : ""), salt ? ZSTR_LEN(salt) : 0); in PHP_FUNCTION() 722 char *algo, *salt, *pass = NULL; in PHP_FUNCTION() local 785 memcpy(computed_salt, (unsigned char *) salt, salt_len); in PHP_FUNCTION() 1045 char *password, *salt; in PHP_FUNCTION() local 1049 …if (zend_parse_parameters(ZEND_NUM_ARGS(), "lssl", &algorithm, &password, &password_len, &salt, &s… in PHP_FUNCTION() 1061 memcpy(padded_salt, salt, salt_len); in PHP_FUNCTION() 1313 ZEND_ARG_INFO(0, salt) 1329 ZEND_ARG_INFO(0, salt) [all …]
|