[php-src] PHP-8.5: Merge branch 'PHP-8.4' into PHP-8.5
| From: | Tim Düsterhus | Date: | Tue, 10 Nov 2026 11:55:09 +0000 |
| Subject: | [php-src] PHP-8.5: Merge branch 'PHP-8.4' into PHP-8.5 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-143526@lists.php.net to get a copy of this message | ||
Author: Tim Düsterhus (TimWolla)
Date: 2026-11-10T12:54:59+01:00
Commit: https://github.com/php/php-src/commit/268ebcbead3b4039bc295105f6db29c01fca2680
Raw diff: https://github.com/php/php-src/commit/268ebcbead3b4039bc295105f6db29c01fca2680.diff
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
Fix argument number in sodium_crypto_stream_xchacha20_xor_ic() key length error (#25363)
Changed paths:
M ext/sodium/libsodium.c
M ext/sodium/tests/crypto_stream_xchacha20.phpt
Diff:
diff --git a/ext/sodium/libsodium.c b/ext/sodium/libsodium.c
index d1afbccc26e8..208ea5a69f6a 100644
--- a/ext/sodium/libsodium.c
+++ b/ext/sodium/libsodium.c
@@ -1391,7 +1391,7 @@ PHP_FUNCTION(sodium_crypto_stream_xchacha20_xor_ic)
RETURN_THROWS();
}
if (key_len != crypto_stream_xchacha20_KEYBYTES) {
- zend_argument_error(sodium_exception_ce, 3, "must be SODIUM_CRYPTO_STREAM_XCHACHA20_KEYBYTES
bytes long");
+ zend_argument_error(sodium_exception_ce, 4, "must be SODIUM_CRYPTO_STREAM_XCHACHA20_KEYBYTES
bytes long");
RETURN_THROWS();
}
ciphertext_len = msg_len;
diff --git a/ext/sodium/tests/crypto_stream_xchacha20.phpt
b/ext/sodium/tests/crypto_stream_xchacha20.phpt
index 466734853d70..08d81b0ed18b 100644
--- a/ext/sodium/tests/crypto_stream_xchacha20.phpt
+++ b/ext/sodium/tests/crypto_stream_xchacha20.phpt
@@ -75,6 +75,11 @@ try {
} catch (SodiumException $ex) {
echo $ex->getMessage(), "\n";
}
+try {
+ sodium_crypto_stream_xchacha20_xor_ic($stream, $nonce, 0, substr($key, 1));
+} catch (Throwable $ex) {
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
+}
?>
--EXPECT--
@@ -94,3 +99,4 @@ sodium_crypto_stream_xchacha20(): Argument #2 ($nonce) must be SODIUM_CRYPTO_STR
sodium_crypto_stream_xchacha20(): Argument #3 ($key) must be
SODIUM_CRYPTO_STREAM_XCHACHA20_KEYBYTES bytes long
sodium_crypto_stream_xchacha20_xor(): Argument #2 ($nonce) must be
SODIUM_CRYPTO_STREAM_XCHACHA20_NONCEBYTES bytes long
sodium_crypto_stream_xchacha20_xor(): Argument #3 ($key) must be
SODIUM_CRYPTO_STREAM_XCHACHA20_KEYBYTES bytes long
+SodiumException: sodium_crypto_stream_xchacha20_xor_ic(): Argument #4 ($key) must be
SODIUM_CRYPTO_STREAM_XCHACHA20_KEYBYTES bytes long