mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Use proper types in sodium_crypto_stream_xchacha20_xor_ic()
Most importantly, `ic` needs to be of type `zend_long`, not `zend_long*`. Closes GH-8302.
This commit is contained in:
parent
2fe35cf807
commit
d03a94a0a6
1 changed files with 2 additions and 2 deletions
|
@ -1585,7 +1585,7 @@ PHP_FUNCTION(sodium_crypto_stream_xchacha20_xor_ic)
|
|||
unsigned char *key;
|
||||
unsigned char *msg;
|
||||
unsigned char *nonce;
|
||||
zend_long *ic;
|
||||
zend_long ic;
|
||||
|
||||
size_t ciphertext_len;
|
||||
size_t key_len;
|
||||
|
@ -1612,7 +1612,7 @@ PHP_FUNCTION(sodium_crypto_stream_xchacha20_xor_ic)
|
|||
ciphertext = zend_string_checked_alloc((size_t) ciphertext_len, 0);
|
||||
if (crypto_stream_xchacha20_xor_ic((unsigned char *) ZSTR_VAL(ciphertext), msg,
|
||||
(unsigned long long) msg_len, nonce,
|
||||
(unsigned long long) ic, key) != 0) {
|
||||
(uint64_t) ic, key) != 0) {
|
||||
zend_string_free(ciphertext);
|
||||
zend_throw_exception(sodium_exception_ce, "internal error", 0);
|
||||
RETURN_THROWS();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue