@@ -1611,11 +1611,11 @@ PHP_FUNCTION(sodium_crypto_pwhash)
1611
1611
RETURN_THROWS ();
1612
1612
}
1613
1613
if (hash_len >= 0xffffffff ) {
1614
- zend_argument_error (sodium_exception_ce , 1 , "must be less than the maximum allowed value " );
1614
+ zend_argument_error (sodium_exception_ce , 1 , "is too long " );
1615
1615
RETURN_THROWS ();
1616
1616
}
1617
1617
if (passwd_len >= 0xffffffff ) {
1618
- zend_argument_error (sodium_exception_ce , 2 , "must be shorter than the maximum allowed length " );
1618
+ zend_argument_error (sodium_exception_ce , 2 , "is too long " );
1619
1619
RETURN_THROWS ();
1620
1620
}
1621
1621
if (opslimit <= 0 ) {
@@ -1698,7 +1698,7 @@ PHP_FUNCTION(sodium_crypto_pwhash_str)
1698
1698
RETURN_THROWS ();
1699
1699
}
1700
1700
if (passwd_len >= 0xffffffff ) {
1701
- zend_argument_error (sodium_exception_ce , 1 , "must be shorter than the maximum allowed length " );
1701
+ zend_argument_error (sodium_exception_ce , 1 , "is too long " );
1702
1702
RETURN_THROWS ();
1703
1703
}
1704
1704
if (passwd_len <= 0 ) {
@@ -1736,8 +1736,6 @@ PHP_FUNCTION(sodium_crypto_pwhash_str_needs_rehash)
1736
1736
1737
1737
if (zend_parse_parameters (ZEND_NUM_ARGS (), "sll" ,
1738
1738
& hash_str , & hash_str_len , & opslimit , & memlimit ) == FAILURE ) {
1739
- // TODO: what's this error message here?
1740
- zend_throw_exception (sodium_exception_ce , "a PHP string is required" , 0 );
1741
1739
RETURN_THROWS ();
1742
1740
}
1743
1741
if (crypto_pwhash_str_needs_rehash (hash_str , opslimit , memlimit ) == 0 ) {
@@ -1761,7 +1759,7 @@ PHP_FUNCTION(sodium_crypto_pwhash_str_verify)
1761
1759
RETURN_THROWS ();
1762
1760
}
1763
1761
if (passwd_len >= 0xffffffff ) {
1764
- zend_argument_error (sodium_exception_ce , 2 , "must be shorter than the maximum allowed length " );
1762
+ zend_argument_error (sodium_exception_ce , 2 , "is too long " );
1765
1763
RETURN_THROWS ();
1766
1764
}
1767
1765
if (passwd_len <= 0 ) {
@@ -2014,7 +2012,7 @@ PHP_FUNCTION(sodium_crypto_aead_aes256gcm_decrypt)
2014
2012
RETURN_FALSE ;
2015
2013
}
2016
2014
if (ciphertext_len - crypto_aead_aes256gcm_ABYTES > 16ULL * ((1ULL << 32 ) - 2ULL )) {
2017
- zend_argument_error (sodium_exception_ce , 1 , "must be shorter than the maximum allowed length " );
2015
+ zend_argument_error (sodium_exception_ce , 1 , "is too long " );
2018
2016
RETURN_THROWS ();
2019
2017
}
2020
2018
msg_len = ciphertext_len ;
@@ -3106,7 +3104,7 @@ PHP_FUNCTION(sodium_pad)
3106
3104
RETURN_THROWS ();
3107
3105
}
3108
3106
if (blocksize > SIZE_MAX ) {
3109
- zend_argument_error (sodium_exception_ce , 2 , "must be less than or equal to the maximum allowed value " );
3107
+ zend_argument_error (sodium_exception_ce , 2 , "is too large " );
3110
3108
RETURN_THROWS ();
3111
3109
}
3112
3110
xpadlen = blocksize - 1U ;
@@ -3179,7 +3177,7 @@ PHP_FUNCTION(sodium_unpad)
3179
3177
RETURN_THROWS ();
3180
3178
}
3181
3179
if (blocksize > SIZE_MAX ) {
3182
- zend_argument_error (sodium_exception_ce , 2 , "must be less than or equal to the maximum allowed value " );
3180
+ zend_argument_error (sodium_exception_ce , 2 , "is too large " );
3183
3181
RETURN_THROWS ();
3184
3182
}
3185
3183
if (padded_len < blocksize ) {
@@ -3291,7 +3289,7 @@ PHP_FUNCTION(sodium_crypto_secretstream_xchacha20poly1305_push)
3291
3289
state = (unsigned char * ) Z_STRVAL (* state_zv );
3292
3290
state_len = Z_STRLEN (* state_zv );
3293
3291
if (state_len != sizeof (crypto_secretstream_xchacha20poly1305_state )) {
3294
- zend_argument_error (sodium_exception_ce , 1 , "to have a correct length" );
3292
+ zend_argument_error (sodium_exception_ce , 1 , "must have a correct length" );
3295
3293
RETURN_THROWS ();
3296
3294
}
3297
3295
if (msg_len > crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX ||
0 commit comments