diff --git a/generated/curl.php b/generated/curl.php index 11d4c6e1..3c135f0b 100644 --- a/generated/curl.php +++ b/generated/curl.php @@ -3109,6 +3109,17 @@ function curl_multi_setopt(\CurlMultiHandle $multi_handle, int $option, $value): * * * + * CURLOPT_XFERINFOFUNCTION + * + * A callback accepting two parameters. + * Has a similar purpose as CURLOPT_PROGRESSFUNCTION but is more modern + * and the preferred option from cURL. + * + * + * Added in 7.32.0. Available as of PHP 8.2.0. + * + * + * * * * @@ -3274,3 +3285,29 @@ function curl_unescape(\CurlHandle $handle, string $string): string } return $safeResult; } + + +/** + * Available if built against libcurl >= 7.62.0. + * + * Some protocols have "connection upkeep" mechanisms. + * These mechanisms usually send some traffic on existing connections in order to keep them alive; + * this can prevent connections from being closed due to overzealous firewalls, for example. + * + * Connection upkeep is currently available only for HTTP/2 connections. + * A small amount of traffic is usually sent to keep a connection alive. + * HTTP/2 maintains its connection by sending a HTTP/2 PING frame. + * + * @param \CurlHandle $handle A cURL handle returned by + * curl_init. + * @throws CurlException + * + */ +function curl_upkeep(\CurlHandle $handle): void +{ + error_clear_last(); + $safeResult = \curl_upkeep($handle); + if ($safeResult === false) { + throw CurlException::createFromPhpError($handle); + } +} diff --git a/generated/functionsList.php b/generated/functionsList.php index 8d853952..7ead69b0 100644 --- a/generated/functionsList.php +++ b/generated/functionsList.php @@ -106,6 +106,7 @@ 'curl_share_errno', 'curl_share_setopt', 'curl_unescape', + 'curl_upkeep', 'date', 'date_parse', 'date_parse_from_format', @@ -638,6 +639,7 @@ 'opendir', 'openlog', 'openssl_cipher_iv_length', + 'openssl_cipher_key_length', 'openssl_cms_decrypt', 'openssl_cms_encrypt', 'openssl_cms_read', @@ -954,6 +956,7 @@ 'sodium_crypto_secretbox_open', 'sodium_crypto_sign_open', 'sodium_crypto_sign_verify_detached', + 'sodium_crypto_stream_xchacha20_xor_ic', 'solr_get_version', 'spl_autoload_register', 'spl_autoload_unregister', diff --git a/generated/ldap.php b/generated/ldap.php index 5a322a87..867a074f 100644 --- a/generated/ldap.php +++ b/generated/ldap.php @@ -511,7 +511,7 @@ function ldap_get_entries($ldap, $result): array * * * LDAP_OPT_DIAGNOSTIC_MESSAGE - * int + * string * * * diff --git a/generated/openssl.php b/generated/openssl.php index 8d58d467..d3205ce9 100644 --- a/generated/openssl.php +++ b/generated/openssl.php @@ -23,6 +23,25 @@ function openssl_cipher_iv_length(string $cipher_algo): int } +/** + * Gets the cipher key length. + * + * @param string $cipher_algo The cipher method, see openssl_get_cipher_methods for a list of potential values. + * @return Returns the cipher length on success. + * @throws OpensslException + * + */ +function openssl_cipher_key_length(string $cipher_algo) +{ + error_clear_last(); + $safeResult = \openssl_cipher_key_length($cipher_algo); + if ($safeResult === false) { + throw OpensslException::createFromPhpError(); + } + return $safeResult; +} + + /** * Decrypts a CMS message. * diff --git a/generated/sodium.php b/generated/sodium.php index 08cf8873..b2ad105b 100644 --- a/generated/sodium.php +++ b/generated/sodium.php @@ -324,3 +324,27 @@ function sodium_crypto_sign_verify_detached(string $signature, string $message, throw SodiumException::createFromPhpError(); } } + + +/** + * The function is similar to sodium_crypto_stream_xchacha20_xor + * but adds the ability to set the initial value of the block counter to a non-zero value. + * This permits direct access to any block without having to compute the previous ones. + * + * @param string $message The message to encrypt. + * @param string $nonce 24-byte nonce. + * @param int $counter The initial value of the block counter. + * @param string $key Key, possibly generated from sodium_crypto_stream_xchacha20_keygen. + * @return string Encrypted message. + * @throws SodiumException + * + */ +function sodium_crypto_stream_xchacha20_xor_ic(string $message, string $nonce, int $counter, string $key): string +{ + error_clear_last(); + $safeResult = \sodium_crypto_stream_xchacha20_xor_ic($message, $nonce, $counter, $key); + if ($safeResult === false) { + throw SodiumException::createFromPhpError(); + } + return $safeResult; +} diff --git a/rector-migrate.php b/rector-migrate.php index 2204db68..9f712a7a 100644 --- a/rector-migrate.php +++ b/rector-migrate.php @@ -113,6 +113,7 @@ 'curl_share_errno' => 'Safe\curl_share_errno', 'curl_share_setopt' => 'Safe\curl_share_setopt', 'curl_unescape' => 'Safe\curl_unescape', + 'curl_upkeep' => 'Safe\curl_upkeep', 'date' => 'Safe\date', 'date_parse' => 'Safe\date_parse', 'date_parse_from_format' => 'Safe\date_parse_from_format', @@ -645,6 +646,7 @@ 'opendir' => 'Safe\opendir', 'openlog' => 'Safe\openlog', 'openssl_cipher_iv_length' => 'Safe\openssl_cipher_iv_length', + 'openssl_cipher_key_length' => 'Safe\openssl_cipher_key_length', 'openssl_cms_decrypt' => 'Safe\openssl_cms_decrypt', 'openssl_cms_encrypt' => 'Safe\openssl_cms_encrypt', 'openssl_cms_read' => 'Safe\openssl_cms_read', @@ -961,6 +963,7 @@ 'sodium_crypto_secretbox_open' => 'Safe\sodium_crypto_secretbox_open', 'sodium_crypto_sign_open' => 'Safe\sodium_crypto_sign_open', 'sodium_crypto_sign_verify_detached' => 'Safe\sodium_crypto_sign_verify_detached', + 'sodium_crypto_stream_xchacha20_xor_ic' => 'Safe\sodium_crypto_stream_xchacha20_xor_ic', 'solr_get_version' => 'Safe\solr_get_version', 'spl_autoload_register' => 'Safe\spl_autoload_register', 'spl_autoload_unregister' => 'Safe\spl_autoload_unregister',