From d58df3938441e1fe9b09c2a9cd678ded0cb1e8cf Mon Sep 17 00:00:00 2001 From: Paragon Initiative Enterprises Date: Mon, 10 May 2021 10:49:35 -0400 Subject: [PATCH] Correct the argument names for ext/sodium functions --- ext/sodium/libsodium.stub.php | 6 +++--- ext/sodium/libsodium_arginfo.h | 13 +++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/ext/sodium/libsodium.stub.php b/ext/sodium/libsodium.stub.php index 5a49889e35ea..047dcced0bc4 100644 --- a/ext/sodium/libsodium.stub.php +++ b/ext/sodium/libsodium.stub.php @@ -52,7 +52,7 @@ function sodium_crypto_box_publickey(string $key_pair): string {} function sodium_crypto_box_publickey_from_secretkey(string $secret_key): string {} -function sodium_crypto_box_seal(string $message, string $key_pair): string {} +function sodium_crypto_box_seal(string $message, string $public_key): string {} function sodium_crypto_box_seal_open(string $ciphertext, string $key_pair): string|false {} @@ -176,7 +176,7 @@ function sodium_crypto_sign_keypair(): string {} function sodium_crypto_sign_keypair_from_secretkey_and_publickey(string $secret_key, string $public_key): string {} -function sodium_crypto_sign_open(string $ciphertext, string $public_key): string|false {} +function sodium_crypto_sign_open(string $signed_message, string $public_key): string|false {} function sodium_crypto_sign_publickey(string $key_pair): string {} @@ -212,7 +212,7 @@ function sodium_memcmp(string $string1, string $string2): int {} function sodium_memzero(string &$string): void {} -function sodium_pad(string $string, int $length): string {} +function sodium_pad(string $string, int $block_size): string {} function sodium_unpad(string $string, int $block_size): string {} diff --git a/ext/sodium/libsodium_arginfo.h b/ext/sodium/libsodium_arginfo.h index 7453650b39f8..34c0acced0fb 100644 --- a/ext/sodium/libsodium_arginfo.h +++ b/ext/sodium/libsodium_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 286436656e37c5d71de69ed6365b5202e0965f19 */ + * Stub hash: 7213518d1b2e9322194d677f13634f61c5f71af8 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_aes256gcm_is_available, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() @@ -119,7 +119,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_box_seal, 0, 2, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, key_pair, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, public_key, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_box_seal_open, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) @@ -396,7 +396,7 @@ ZEND_END_ARG_INFO() #define arginfo_sodium_crypto_sign_keypair_from_secretkey_and_publickey arginfo_sodium_crypto_box_keypair_from_secretkey_and_publickey ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_sign_open, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, ciphertext, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, signed_message, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, public_key, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -464,15 +464,12 @@ ZEND_END_ARG_INFO() #define arginfo_sodium_memzero arginfo_sodium_increment ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_pad, 0, 2, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_unpad, 0, 2, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, block_size, IS_LONG, 0) ZEND_END_ARG_INFO() +#define arginfo_sodium_unpad arginfo_sodium_pad + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_bin2hex, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_END_ARG_INFO()