Skip to content

Commit

Permalink
Correct the argument names for ext/sodium functions
Browse files Browse the repository at this point in the history
Closes GH-6969.
  • Loading branch information
paragonie-security authored and nikic committed May 10, 2021
1 parent 7fbfcfa commit 0c57ebb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
6 changes: 3 additions & 3 deletions ext/sodium/libsodium.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

Expand Down Expand Up @@ -142,7 +142,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 {}

Expand Down Expand Up @@ -170,7 +170,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 {}

Expand Down
13 changes: 5 additions & 8 deletions ext/sodium/libsodium_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: b34401e98646f1e85a8dd292477cac68c6e4ac97 */
* Stub hash: 1d75807de20b87cd274e6073ef9c9392a34f7279 */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_aes256gcm_is_available, 0, 0, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -320,7 +320,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()

Expand Down Expand Up @@ -367,15 +367,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()
Expand Down

0 comments on commit 0c57ebb

Please sign in to comment.