[php-src] master: Merge branch 'PHP-8.6'
| From: | Tim Düsterhus | Date: | Tue, 10 Nov 2026 11:56:08 +0000 |
| Subject: | [php-src] master: Merge branch 'PHP-8.6' | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-143528@lists.php.net to get a copy of this message | ||
Author: Tim Düsterhus (TimWolla)
Date: 2026-11-10T12:56:01+01:00
Commit: https://github.com/php/php-src/commit/5a9305470262a79ca052819e7cf454f5241c3560
Raw diff: https://github.com/php/php-src/commit/5a9305470262a79ca052819e7cf454f5241c3560.diff
Merge branch 'PHP-8.6'
* PHP-8.6:
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 07c88d4497b0..907709ba9e72 100644
--- a/ext/sodium/libsodium.c
+++ b/ext/sodium/libsodium.c
@@ -1570,7 +1570,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 0db0a4a487c4..110aa143c17b 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::class, ': ', $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 @@ SodiumException: sodium_crypto_stream_xchacha20(): Argument #2 ($nonce) must be
SodiumException: sodium_crypto_stream_xchacha20(): Argument #3 ($key) must be
SODIUM_CRYPTO_STREAM_XCHACHA20_KEYBYTES bytes long
SodiumException: sodium_crypto_stream_xchacha20_xor(): Argument #2 ($nonce) must be
SODIUM_CRYPTO_STREAM_XCHACHA20_NONCEBYTES bytes long
SodiumException: 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