Skip to content

Commit 0c57ebb

Browse files
paragonie-securitynikic
authored andcommitted
Correct the argument names for ext/sodium functions
Closes GH-6969.
1 parent 7fbfcfa commit 0c57ebb

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

ext/sodium/libsodium.stub.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function sodium_crypto_box_publickey(string $key_pair): string {}
5252

5353
function sodium_crypto_box_publickey_from_secretkey(string $secret_key): string {}
5454

55-
function sodium_crypto_box_seal(string $message, string $key_pair): string {}
55+
function sodium_crypto_box_seal(string $message, string $public_key): string {}
5656

5757
function sodium_crypto_box_seal_open(string $ciphertext, string $key_pair): string|false {}
5858

@@ -142,7 +142,7 @@ function sodium_crypto_sign_keypair(): string {}
142142

143143
function sodium_crypto_sign_keypair_from_secretkey_and_publickey(string $secret_key, string $public_key): string {}
144144

145-
function sodium_crypto_sign_open(string $ciphertext, string $public_key): string|false {}
145+
function sodium_crypto_sign_open(string $signed_message, string $public_key): string|false {}
146146

147147
function sodium_crypto_sign_publickey(string $key_pair): string {}
148148

@@ -170,7 +170,7 @@ function sodium_memcmp(string $string1, string $string2): int {}
170170

171171
function sodium_memzero(string &$string): void {}
172172

173-
function sodium_pad(string $string, int $length): string {}
173+
function sodium_pad(string $string, int $block_size): string {}
174174

175175
function sodium_unpad(string $string, int $block_size): string {}
176176

ext/sodium/libsodium_arginfo.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: b34401e98646f1e85a8dd292477cac68c6e4ac97 */
2+
* Stub hash: 1d75807de20b87cd274e6073ef9c9392a34f7279 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_aes256gcm_is_available, 0, 0, _IS_BOOL, 0)
55
ZEND_END_ARG_INFO()
@@ -119,7 +119,7 @@ ZEND_END_ARG_INFO()
119119

120120
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_box_seal, 0, 2, IS_STRING, 0)
121121
ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
122-
ZEND_ARG_TYPE_INFO(0, key_pair, IS_STRING, 0)
122+
ZEND_ARG_TYPE_INFO(0, public_key, IS_STRING, 0)
123123
ZEND_END_ARG_INFO()
124124

125125
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_box_seal_open, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
@@ -320,7 +320,7 @@ ZEND_END_ARG_INFO()
320320
#define arginfo_sodium_crypto_sign_keypair_from_secretkey_and_publickey arginfo_sodium_crypto_box_keypair_from_secretkey_and_publickey
321321

322322
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_sign_open, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
323-
ZEND_ARG_TYPE_INFO(0, ciphertext, IS_STRING, 0)
323+
ZEND_ARG_TYPE_INFO(0, signed_message, IS_STRING, 0)
324324
ZEND_ARG_TYPE_INFO(0, public_key, IS_STRING, 0)
325325
ZEND_END_ARG_INFO()
326326

@@ -367,15 +367,12 @@ ZEND_END_ARG_INFO()
367367
#define arginfo_sodium_memzero arginfo_sodium_increment
368368

369369
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_pad, 0, 2, IS_STRING, 0)
370-
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
371-
ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0)
372-
ZEND_END_ARG_INFO()
373-
374-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_unpad, 0, 2, IS_STRING, 0)
375370
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
376371
ZEND_ARG_TYPE_INFO(0, block_size, IS_LONG, 0)
377372
ZEND_END_ARG_INFO()
378373

374+
#define arginfo_sodium_unpad arginfo_sodium_pad
375+
379376
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_bin2hex, 0, 1, IS_STRING, 0)
380377
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
381378
ZEND_END_ARG_INFO()

0 commit comments

Comments
 (0)