Skip to content

Use proper types in sodium_crypto_stream_xchacha20_xor_ic() #8302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ext/sodium/libsodium.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down