Skip to content

Commit 4a92a5c

Browse files
committed
Review
1 parent 89a25b0 commit 4a92a5c

10 files changed

+43
-43
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/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

ext/openssl/openssl.stub.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function openssl_x509_export_to_file(OpenSSLCertificate|string $certificate, str
1919
/** @param string $output */
2020
function openssl_x509_export(OpenSSLCertificate|string $certificate, &$output, bool $no_text = true): bool {}
2121

22-
function openssl_x509_fingerprint(OpenSSLCertificate|string $certificate, string $digest_algorithm = "sha1", bool $raw_output = false): string|false {}
22+
function openssl_x509_fingerprint(OpenSSLCertificate|string $certificate, string $digest_algo = "sha1", bool $raw_output = false): string|false {}
2323

2424
/** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key */
2525
function openssl_x509_check_private_key(OpenSSLCertificate|string $certificate, $private_key): bool {}
@@ -103,12 +103,12 @@ function openssl_get_privatekey($private_key, ?string $passphrase = null): OpenS
103103

104104
function openssl_pkey_get_details(OpenSSLAsymmetricKey $key): array|false {}
105105

106-
function openssl_pbkdf2(string $passphrase, string $salt, int $key_length, int $iterations, string $digest_algorithm = "sha1"): string|false {}
106+
function openssl_pbkdf2(string $passphrase, string $salt, int $key_length, int $iterations, string $digest_algo = "sha1"): string|false {}
107107

108108
function openssl_pkcs7_verify(string $input_filename, int $flags, ?string $signers_certificates_filename = null, array $ca_info = [], ?string $untrusted_certificates_filename = null, ?string $content = null, ?string $output_filename = null): bool|int {}
109109

110110
/** @param OpenSSLCertificate|array|string $certificate */
111-
function openssl_pkcs7_encrypt(string $input_filename, string $output_filename, $certificate, ?array $headers, int $flags = 0, int $cipher_algorithm = OPENSSL_CIPHER_RC2_40): bool {}
111+
function openssl_pkcs7_encrypt(string $input_filename, string $output_filename, $certificate, ?array $headers, int $flags = 0, int $cipher_algo = OPENSSL_CIPHER_RC2_40): bool {}
112112

113113
/** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key */
114114
function openssl_pkcs7_sign(string $input_filename, string $output_filename, OpenSSLCertificate|string $certificate, $private_key, ?array $headers, int $flags = PKCS7_DETACHED, ?string $untrusted_certificates_filename = null): bool {}
@@ -125,7 +125,7 @@ function openssl_pkcs7_read(string $input_filename, &$certificates): bool {}
125125
function openssl_cms_verify(string $input_filename, int $flags = 0, ?string $certificates = null, array $ca_info = [], ?string $untrusted_certificates_filename = null, ?string $content = null, ?string $pk7 = null, ?string $sigfile = null, int $encoding = OPENSSL_ENCODING_SMIME): bool {}
126126

127127
/** @param OpenSSLCertificate|array|string $certificate */
128-
function openssl_cms_encrypt(string $input_filename, string $output_filename, $certificate, ?array $headers, int $flags = 0, int $encoding = OPENSSL_ENCODING_SMIME, int $cipher_algorithm = OPENSSL_CIPHER_RC2_40): bool {}
128+
function openssl_cms_encrypt(string $input_filename, string $output_filename, $certificate, ?array $headers, int $flags = 0, int $encoding = OPENSSL_ENCODING_SMIME, int $cipher_algo = OPENSSL_CIPHER_RC2_40): bool {}
129129

130130
/** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key */
131131
function openssl_cms_sign(string $input_filename, string $output_filename, OpenSSLCertificate|string $certificate, $private_key, ?array $headers, int $flags = 0, int $encoding = OPENSSL_ENCODING_SMIME, ?string $untrusted_certificates_filename = null): bool {}
@@ -179,13 +179,13 @@ function openssl_verify(string $data, string $signature, $public_key, string|int
179179
* @param array $encrypted_keys
180180
* @param string $iv
181181
*/
182-
function openssl_seal(string $data, &$sealed_data, &$encrypted_keys, array $public_key, string $cipher_algorithm, &$iv = null): int|false {}
182+
function openssl_seal(string $data, &$sealed_data, &$encrypted_keys, array $public_key, string $cipher_algo, &$iv = null): int|false {}
183183

184184
/**
185185
* @param string $output
186186
* @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key
187187
*/
188-
function openssl_open(string $data, &$output, string $encrypted_key, $private_key, string $cipher_algorithm, ?string $iv = null): bool {}
188+
function openssl_open(string $data, &$output, string $encrypted_key, $private_key, string $cipher_algo, ?string $iv = null): bool {}
189189

190190
function openssl_get_md_methods(bool $aliases = false): array {}
191191

@@ -195,14 +195,14 @@ function openssl_get_cipher_methods(bool $aliases = false): array {}
195195
function openssl_get_curve_names(): array|false {}
196196
#endif
197197

198-
function openssl_digest(string $data, string $digest_algorithm, bool $raw_output = false): string|false {}
198+
function openssl_digest(string $data, string $digest_algo, bool $raw_output = false): string|false {}
199199

200200
/** @param string $tag */
201-
function openssl_encrypt(string $data, string $cipher_algorithm, string $passphrase, int $options = 0, string $iv = "", &$tag = null, string $aad = "", int $tag_length = 16): string|false {}
201+
function openssl_encrypt(string $data, string $cipher_algo, string $passphrase, int $options = 0, string $iv = "", &$tag = null, string $aad = "", int $tag_length = 16): string|false {}
202202

203-
function openssl_decrypt(string $data, string $cipher_algorithm, string $passphrase, int $options = 0, string $iv = "", string $tag = "", string $aad = ""): string|false {}
203+
function openssl_decrypt(string $data, string $cipher_algo, string $passphrase, int $options = 0, string $iv = "", string $tag = "", string $aad = ""): string|false {}
204204

205-
function openssl_cipher_iv_length(string $cipher_algorithm): int|false {}
205+
function openssl_cipher_iv_length(string $cipher_algo): int|false {}
206206

207207
function openssl_dh_compute_key(string $public_key, OpenSSLAsymmetricKey $private_key): string|false {}
208208

@@ -215,7 +215,7 @@ function openssl_pkey_derive($public_key, $private_key, int $key_length = 0): st
215215
/** @param bool $strong_result */
216216
function openssl_random_pseudo_bytes(int $length, &$strong_result = null): string {}
217217

218-
function openssl_spki_new(OpenSSLAsymmetricKey $private_key, string $challenge, int $digest_algorithm = OPENSSL_ALGO_MD5): string|false {}
218+
function openssl_spki_new(OpenSSLAsymmetricKey $private_key, string $challenge, int $digest_algo = OPENSSL_ALGO_MD5): string|false {}
219219

220220
function openssl_spki_verify(string $spki): bool {}
221221

0 commit comments

Comments
 (0)