Skip to content

Commit 643cf62

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: ext/sodium: use correct constants and error messages (#20852)
2 parents 5472cac + a04fa6c commit 643cf62

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/sodium/libsodium.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2603,7 +2603,7 @@ PHP_FUNCTION(sodium_crypto_scalarmult)
26032603
RETURN_THROWS();
26042604
}
26052605
if (p_len != crypto_scalarmult_BYTES) {
2606-
zend_argument_error(sodium_exception_ce, 2, "must be SODIUM_CRYPTO_SCALARMULT_SCALARBYTES bytes long");
2606+
zend_argument_error(sodium_exception_ce, 2, "must be SODIUM_CRYPTO_SCALARMULT_BYTES bytes long");
26072607
RETURN_THROWS();
26082608
}
26092609
q = zend_string_alloc(crypto_scalarmult_BYTES, 0);
@@ -2674,7 +2674,7 @@ PHP_FUNCTION(sodium_crypto_scalarmult_ristretto255_base)
26742674
zend_argument_error(sodium_exception_ce, 1, "must not be zero", 0);
26752675
RETURN_THROWS();
26762676
}
2677-
ZSTR_VAL(q)[crypto_scalarmult_BYTES] = 0;
2677+
ZSTR_VAL(q)[crypto_scalarmult_ristretto255_BYTES] = 0;
26782678

26792679
RETURN_NEW_STR(q);
26802680
}
@@ -3214,7 +3214,7 @@ PHP_FUNCTION(sodium_crypto_kdf_derive_from_key)
32143214
RETURN_THROWS();
32153215
}
32163216
if (key_len != crypto_kdf_KEYBYTES) {
3217-
zend_argument_error(sodium_exception_ce, 4, "must be SODIUM_CRYPTO_KDF_BYTES_MIN bytes long");
3217+
zend_argument_error(sodium_exception_ce, 4, "must be SODIUM_CRYPTO_KDF_KEYBYTES bytes long");
32183218
RETURN_THROWS();
32193219
}
32203220
memcpy(ctx_padded, ctx, crypto_kdf_CONTEXTBYTES);

0 commit comments

Comments
 (0)