Skip to content

Commit 9239a79

Browse files
committed
Review
1 parent 89a25b0 commit 9239a79

12 files changed

+72
-72
lines changed

ext/hash/hash.stub.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
/** @generate-function-entries */
44

5-
function hash(string $algorithm, string $data, bool $binary_output = false): string|false {}
5+
function hash(string $algo, string $data, bool $binary = false): string|false {}
66

7-
function hash_file(string $algorithm, string $filename, bool $binary_output = false): string|false {}
7+
function hash_file(string $algo, string $filename, bool $binary = false): string|false {}
88

9-
function hash_hmac(string $algorithm, string $data, string $key, bool $binary_output = false): string|false {}
9+
function hash_hmac(string $algo, string $data, string $key, bool $binary = false): string|false {}
1010

11-
function hash_hmac_file(string $algorithm, string $data, string $key, bool $binary_output = false): string|false {}
11+
function hash_hmac_file(string $algo, string $data, string $key, bool $binary = false): string|false {}
1212

13-
function hash_init(string $algorithm, int $options = 0, string $key = ""): HashContext {}
13+
function hash_init(string $algo, int $options = 0, string $key = ""): HashContext {}
1414

1515
function hash_update(HashContext $context, string $data): bool {}
1616

@@ -20,30 +20,30 @@ function hash_update_stream(HashContext $context, $handle, int $length = -1): in
2020
/** @param resource|null $stream_context */
2121
function hash_update_file(HashContext $context, string $filename, $stream_context = null): bool {}
2222

23-
function hash_final(HashContext $context, bool $binary_output = false): string {}
23+
function hash_final(HashContext $context, bool $binary = false): string {}
2424

2525
function hash_copy(HashContext $context): HashContext {}
2626

2727
function hash_algos(): array {}
2828

2929
function hash_hmac_algos(): array {}
3030

31-
function hash_pbkdf2(string $algorithm, string $password, string $salt, int $iterations, int $length = 0, bool $binary_output = false): string {}
31+
function hash_pbkdf2(string $algo, string $password, string $salt, int $iterations, int $length = 0, bool $binary = false): string {}
3232

3333
function hash_equals(string $known_string, string $user_string): bool {}
3434

35-
function hash_hkdf(string $algorithm, string $key, int $length = 0, string $info = "", string $salt = ""): string {}
35+
function hash_hkdf(string $algo, string $key, int $length = 0, string $info = "", string $salt = ""): string {}
3636

3737
#ifdef PHP_MHASH_BC
38-
function mhash_get_block_size(int $algorithm): int|false {}
38+
function mhash_get_block_size(int $algo): int|false {}
3939

40-
function mhash_get_hash_name(int $algorithm): string|false {}
40+
function mhash_get_hash_name(int $algo): string|false {}
4141

42-
function mhash_keygen_s2k(int $algorithm, string $password, string $salt, int $bytes): string|false {}
42+
function mhash_keygen_s2k(int $algo, string $password, string $salt, int $length): string|false {}
4343

4444
function mhash_count(): int {}
4545

46-
function mhash(int $algorithm, string $data, ?string $key = null): string|false {}
46+
function mhash(int $algo, string $data, ?string $key = null): string|false {}
4747
#endif
4848

4949
final class HashContext

ext/hash/hash_arginfo.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: fa9f8e9c190a8f572a0241877ddb07ccf022fd56 */
2+
* Stub hash: 7c6e5ae7967feee2438ed44d2e5c88b3a74b21fb */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hash, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
5-
ZEND_ARG_TYPE_INFO(0, algorithm, IS_STRING, 0)
5+
ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
66
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
7-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary_output, _IS_BOOL, 0, "false")
7+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false")
88
ZEND_END_ARG_INFO()
99

1010
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hash_file, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
11-
ZEND_ARG_TYPE_INFO(0, algorithm, IS_STRING, 0)
11+
ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
1212
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
13-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary_output, _IS_BOOL, 0, "false")
13+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false")
1414
ZEND_END_ARG_INFO()
1515

1616
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hash_hmac, 0, 3, MAY_BE_STRING|MAY_BE_FALSE)
17-
ZEND_ARG_TYPE_INFO(0, algorithm, IS_STRING, 0)
17+
ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
1818
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
1919
ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
20-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary_output, _IS_BOOL, 0, "false")
20+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false")
2121
ZEND_END_ARG_INFO()
2222

2323
#define arginfo_hash_hmac_file arginfo_hash_hmac
2424

2525
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_hash_init, 0, 1, HashContext, 0)
26-
ZEND_ARG_TYPE_INFO(0, algorithm, IS_STRING, 0)
26+
ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
2727
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0")
2828
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, key, IS_STRING, 0, "\"\"")
2929
ZEND_END_ARG_INFO()
@@ -47,7 +47,7 @@ ZEND_END_ARG_INFO()
4747

4848
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_final, 0, 1, IS_STRING, 0)
4949
ZEND_ARG_OBJ_INFO(0, context, HashContext, 0)
50-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary_output, _IS_BOOL, 0, "false")
50+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false")
5151
ZEND_END_ARG_INFO()
5252

5353
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_hash_copy, 0, 1, HashContext, 0)
@@ -60,12 +60,12 @@ ZEND_END_ARG_INFO()
6060
#define arginfo_hash_hmac_algos arginfo_hash_algos
6161

6262
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_pbkdf2, 0, 4, IS_STRING, 0)
63-
ZEND_ARG_TYPE_INFO(0, algorithm, IS_STRING, 0)
63+
ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
6464
ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
6565
ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0)
6666
ZEND_ARG_TYPE_INFO(0, iterations, IS_LONG, 0)
6767
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0")
68-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary_output, _IS_BOOL, 0, "false")
68+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false")
6969
ZEND_END_ARG_INFO()
7070

7171
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_equals, 0, 2, _IS_BOOL, 0)
@@ -74,7 +74,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_equals, 0, 2, _IS_BOOL, 0)
7474
ZEND_END_ARG_INFO()
7575

7676
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_hkdf, 0, 2, IS_STRING, 0)
77-
ZEND_ARG_TYPE_INFO(0, algorithm, IS_STRING, 0)
77+
ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
7878
ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
7979
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0")
8080
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, info, IS_STRING, 0, "\"\"")
@@ -83,22 +83,22 @@ ZEND_END_ARG_INFO()
8383

8484
#if defined(PHP_MHASH_BC)
8585
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mhash_get_block_size, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
86-
ZEND_ARG_TYPE_INFO(0, algorithm, IS_LONG, 0)
86+
ZEND_ARG_TYPE_INFO(0, algo, IS_LONG, 0)
8787
ZEND_END_ARG_INFO()
8888
#endif
8989

9090
#if defined(PHP_MHASH_BC)
9191
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mhash_get_hash_name, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
92-
ZEND_ARG_TYPE_INFO(0, algorithm, IS_LONG, 0)
92+
ZEND_ARG_TYPE_INFO(0, algo, IS_LONG, 0)
9393
ZEND_END_ARG_INFO()
9494
#endif
9595

9696
#if defined(PHP_MHASH_BC)
9797
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mhash_keygen_s2k, 0, 4, MAY_BE_STRING|MAY_BE_FALSE)
98-
ZEND_ARG_TYPE_INFO(0, algorithm, IS_LONG, 0)
98+
ZEND_ARG_TYPE_INFO(0, algo, IS_LONG, 0)
9999
ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
100100
ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0)
101-
ZEND_ARG_TYPE_INFO(0, bytes, IS_LONG, 0)
101+
ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0)
102102
ZEND_END_ARG_INFO()
103103
#endif
104104

@@ -109,7 +109,7 @@ ZEND_END_ARG_INFO()
109109

110110
#if defined(PHP_MHASH_BC)
111111
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mhash, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
112-
ZEND_ARG_TYPE_INFO(0, algorithm, IS_LONG, 0)
112+
ZEND_ARG_TYPE_INFO(0, algo, IS_LONG, 0)
113113
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
114114
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, key, IS_STRING, 1, "null")
115115
ZEND_END_ARG_INFO()

ext/hash/tests/hash_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ try {
1717
*** Testing hash() : error conditions ***
1818

1919
-- Testing hash() function with invalid hash algorithm --
20-
hash(): Argument #1 ($algorithm) must be a valid hashing algorithm
20+
hash(): Argument #1 ($algo) must be a valid hashing algorithm

ext/hash/tests/hash_file_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ unlink( $filename );
3434
*** Testing hash_file() : error conditions ***
3535

3636
-- Testing hash_file() function with an unknown algorithm --
37-
hash_file(): Argument #1 ($algorithm) must be a valid hashing algorithm
37+
hash_file(): Argument #1 ($algo) must be a valid hashing algorithm
3838

3939
-- Testing hash_file() function with a non-existent file --
4040

ext/hash/tests/hash_hkdf_edges.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ Length < digestSize: 98b16391063ece
2626
Length % digestSize != 0: 98b16391063ecee006a3ca8ee5776b1e5f
2727
Algo name case-sensitivity: true
2828
Non-crypto algo name case-sensitivity:
29-
[Error] hash_hkdf(): Argument #1 ($algorithm) must be a valid cryptographic hashing algorithm
29+
[Error] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm

ext/hash/tests/hash_hkdf_error.phpt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ trycatch_dump(
4848
*** Testing hash_hkdf(): error conditions ***
4949

5050
-- Testing hash_hkdf() function with invalid hash algorithm --
51-
[ValueError] hash_hkdf(): Argument #1 ($algorithm) must be a valid cryptographic hashing algorithm
51+
[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
5252

5353
-- Testing hash_hkdf() function with non-cryptographic hash algorithm --
54-
[ValueError] hash_hkdf(): Argument #1 ($algorithm) must be a valid cryptographic hashing algorithm
55-
[ValueError] hash_hkdf(): Argument #1 ($algorithm) must be a valid cryptographic hashing algorithm
56-
[ValueError] hash_hkdf(): Argument #1 ($algorithm) must be a valid cryptographic hashing algorithm
57-
[ValueError] hash_hkdf(): Argument #1 ($algorithm) must be a valid cryptographic hashing algorithm
58-
[ValueError] hash_hkdf(): Argument #1 ($algorithm) must be a valid cryptographic hashing algorithm
59-
[ValueError] hash_hkdf(): Argument #1 ($algorithm) must be a valid cryptographic hashing algorithm
60-
[ValueError] hash_hkdf(): Argument #1 ($algorithm) must be a valid cryptographic hashing algorithm
61-
[ValueError] hash_hkdf(): Argument #1 ($algorithm) must be a valid cryptographic hashing algorithm
54+
[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
55+
[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
56+
[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
57+
[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
58+
[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
59+
[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
60+
[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
61+
[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
6262

6363
-- Testing hash_hkdf() function with invalid parameters --
6464
[ValueError] hash_hkdf(): Argument #2 ($key) cannot be empty

ext/hash/tests/hash_hmac_error.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ catch (\Error $e) {
3232
*** Testing hash_hmac() : error conditions ***
3333

3434
-- Testing hash_hmac() function with invalid hash algorithm --
35-
hash_hmac(): Argument #1 ($algorithm) must be a valid cryptographic hashing algorithm
35+
hash_hmac(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
3636

3737
-- Testing hash_hmac() function with non-cryptographic hash algorithm --
38-
hash_hmac(): Argument #1 ($algorithm) must be a valid cryptographic hashing algorithm
38+
hash_hmac(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm

ext/hash/tests/hash_hmac_file_error.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ catch (ValueError $e) {
3737
*** Testing hash() : error conditions ***
3838

3939
-- Testing hash_hmac_file() function with invalid hash algorithm --
40-
hash_hmac_file(): Argument #1 ($algorithm) must be a valid cryptographic hashing algorithm
40+
hash_hmac_file(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
4141

4242
-- Testing hash_hmac_file() function with non-cryptographic hash algorithm --
43-
hash_hmac_file(): Argument #1 ($algorithm) must be a valid cryptographic hashing algorithm
43+
hash_hmac_file(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
4444

4545
-- Testing hash_hmac_file() function with bad path --
4646
hash_hmac_file(): Argument #2 ($data) must not contain any null bytes

ext/hash/tests/hash_init_error.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ catch (\Error $e) {
4141
*** Testing hash_init(): error conditions ***
4242

4343
-- Testing hash_init() function with unknown algorithms --
44-
hash_init(): Argument #1 ($algorithm) must be a valid hashing algorithm
44+
hash_init(): Argument #1 ($algo) must be a valid hashing algorithm
4545

4646
-- Testing hash_init() function with HASH_HMAC and non-cryptographic algorithms --
47-
hash_init(): Argument #1 ($algorithm) must be a cryptographic hashing algorithm if HMAC is requested
47+
hash_init(): Argument #1 ($algo) must be a cryptographic hashing algorithm if HMAC is requested
4848

4949
-- Testing hash_init() function with HASH_HMAC and no key --
5050
hash_init(): Argument #3 ($key) cannot be empty when HMAC is requested

ext/hash/tests/hash_pbkdf2_error.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ catch (\Error $e) {
5656
*** Testing hash_pbkdf2() : error conditions ***
5757

5858
-- Testing hash_pbkdf2() function with invalid hash algorithm --
59-
hash_pbkdf2(): Argument #1 ($algorithm) must be a valid cryptographic hashing algorithm
59+
hash_pbkdf2(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
6060

6161
-- Testing hash_pbkdf2() function with non-cryptographic hash algorithm --
62-
hash_pbkdf2(): Argument #1 ($algorithm) must be a valid cryptographic hashing algorithm
62+
hash_pbkdf2(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
6363

6464
-- Testing hash_pbkdf2() function with invalid iterations --
6565
hash_pbkdf2(): Argument #4 ($iterations) must be greater than 0

0 commit comments

Comments
 (0)