intelephense

1.14.41.16.1
lib/stub/openssl/openssl.php
lib/stub/openssl/openssl.php
+33−5
Index: package/lib/stub/openssl/openssl.php
===================================================================
--- package/lib/stub/openssl/openssl.php
+++ package/lib/stub/openssl/openssl.php
@@ -37,8 +37,9 @@
  * Gets an exportable representation of a key into a string
  * @link https://php.net/manual/en/function.openssl-pkey-export.php
  * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $key
  * @param string &$output
+ * @param-out string $output
  * @param string|null $passphrase [optional] <p>
  * The key is optionally protected by <i>passphrase</i>.
  * </p>
  * @param array|null $options [optional] <p>
@@ -415,8 +416,9 @@
  * @param OpenSSLCertificate|string|resource $certificate
  * @param string &$output <p>
  * On success, this will hold the PEM.
  * </p>
+ * @param-out string $output
  * @param bool $no_text [optional]
  * @return bool true on success or false on failure.
  */
 function openssl_x509_export(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, &$output, bool $no_text = true): bool {}
@@ -452,8 +454,9 @@
  * @param OpenSSLCertificate|string|resource $certificate
  * @param string &$output <p>
  * On success, this will hold the PKCS#12.
  * </p>
+ * @param-out string $output
  * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key <p>
  * Private key component of PKCS#12 file.
  * </p>
  * @param string $passphrase <p>
@@ -497,8 +500,9 @@
  * @param string $pkcs12
  * @param array &$certificates <p>
  * On success, this will hold the Certificate Store Data.
  * </p>
+ * @param-out array $certificates
  * @param string $passphrase <p>
  * Encryption password for unlocking the PKCS#12 file.
  * </p>
  * @return bool true on success or false on failure.
@@ -613,8 +617,9 @@
  * Exports a CSR as a string
  * @link https://php.net/manual/en/function.openssl-csr-export.php
  * @param OpenSSLCertificateSigningRequest|string|resource $csr
  * @param string &$output
+ * @param-out string $output
  * @param bool $no_text [optional]
  * @return bool true on success or false on failure.
  */
 function openssl_csr_export(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificateSigningRequest|string"], default: "resource|string")] $csr, &$output, bool $no_text = true): bool {}
@@ -735,8 +740,9 @@
  * @param string $iv [optional] <p>
  * A non-NULL Initialization Vector.
  * </p>
  * @param string &$tag [optional] <p>The authentication tag passed by reference when using AEAD cipher mode (GCM or CCM).</p>
+ * @param-out string $tag
  * @param string $aad [optional] <p>Additional authentication data.</p>
  * @param int $tag_length [optional] <p>
  * The length of the authentication tag. Its value can be between 4 and 16 for GCM mode.
  * </p>
@@ -816,8 +822,9 @@
  * @param string &$signature <p>
  * If the call was successful the signature is returned in
  * <i>signature</i>.
  * </p>
+ * @param-out string $signature
  * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key
  * @param string|int $algorithm [optional] <p>
  * For more information see the list of Signature Algorithms.
  * </p>
@@ -826,9 +833,10 @@
 function openssl_sign(
     string $data,
     &$signature,
     #[LanguageLevelTypeAware(['8.0' => 'OpenSSLAsymmetricKey|OpenSSLCertificate|array|string'], default: 'resource|array|string')] $private_key,
-    string|int $algorithm = OPENSSL_ALGO_SHA1
+    string|int $algorithm = OPENSSL_ALGO_SHA1,
+    #[StubsElementAvailable(from: '8.5')] int $padding = 0
 ): bool {}
 
 /**
  * Verify signature
@@ -845,20 +853,24 @@
 function openssl_verify(
     string $data,
     string $signature,
     #[LanguageLevelTypeAware(['8.0' => 'OpenSSLAsymmetricKey|OpenSSLCertificate|array|string'], default: 'resource|array|string')] $public_key,
-    string|int $algorithm = OPENSSL_ALGO_SHA1
+    string|int $algorithm = OPENSSL_ALGO_SHA1,
+    #[StubsElementAvailable(from: '8.5')] int $padding = 0
 ): int|false {}
 
 /**
  * Seal (encrypt) data
  * @link https://php.net/manual/en/function.openssl-seal.php
  * @param string $data
  * @param string &$sealed_data
+ * @param-out string $sealed_data
  * @param array &$encrypted_keys
+ * @param-out array $encrypted_keys
  * @param array $public_key
  * @param string $cipher_algo
  * @param string &$iv
+ * @param-out string $iv
  * @return int|false the length of the sealed data on success, or false on error.
  * If successful the sealed data is returned in
  * <i>sealed_data</i>, and the envelope keys in
  * <i>env_keys</i>.
@@ -880,8 +892,9 @@
  * @param string &$output <p>
  * If the call is successful the opened data is returned in this
  * parameter.
  * </p>
+ * @param-out string $output
  * @param string $encrypted_key
  * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key
  * @param string $cipher_algo The cipher method.
  * @param string|null $iv [optional] The initialization vector.
@@ -1048,8 +1061,9 @@
  * Encrypts data with private key
  * @link https://php.net/manual/en/function.openssl-private-encrypt.php
  * @param string $data
  * @param string &$encrypted_data
+ * @param-out string $encrypted_data
  * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key
  * @param int $padding [optional] <p>
  * <i>padding</i> can be one of
  * <b>OPENSSL_PKCS1_PADDING</b>,
@@ -1068,8 +1082,9 @@
  * Decrypts data with private key
  * @link https://php.net/manual/en/function.openssl-private-decrypt.php
  * @param string $data
  * @param string &$decrypted_data
+ * @param-out string $decrypted_data
  * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key <p>
  * <i>key</i> must be the private key corresponding that
  * was used to encrypt the data.
  * </p>
@@ -1085,9 +1100,10 @@
 function openssl_private_decrypt(
     string $data,
     &$decrypted_data,
     #[LanguageLevelTypeAware(['8.0' => 'OpenSSLAsymmetricKey|OpenSSLCertificate|array|string'], default: 'resource|array|string')] $private_key,
-    int $padding = OPENSSL_PKCS1_PADDING
+    int $padding = OPENSSL_PKCS1_PADDING,
+    #[StubsElementAvailable(from: '8.5')] ?string $digest_algo = null
 ): bool {}
 
 /**
  * Encrypts data with public key
@@ -1095,8 +1111,9 @@
  * @param string $data
  * @param string &$encrypted_data <p>
  * This will hold the result of the encryption.
  * </p>
+ * @param-out string $encrypted_data
  * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $public_key <p>
  * The public key.
  * </p>
  * @param int $padding [optional] <p>
@@ -1111,16 +1128,18 @@
 function openssl_public_encrypt(
     string $data,
     &$encrypted_data,
     #[LanguageLevelTypeAware(['8.0' => 'OpenSSLAsymmetricKey|OpenSSLCertificate|array|string'], default: 'resource|array|string')] $public_key,
-    int $padding = OPENSSL_PKCS1_PADDING
+    int $padding = OPENSSL_PKCS1_PADDING,
+    #[StubsElementAvailable(from: '8.5')] ?string $digest_algo = null
 ): bool {}
 
 /**
  * Decrypts data with public key
  * @link https://php.net/manual/en/function.openssl-public-decrypt.php
  * @param string $data
  * @param string &$decrypted_data
+ * @param-out string $decrypted_data
  * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $public_key <p>
  * <i>key</i> must be the public key corresponding that
  * was used to encrypt the data.
  * </p>
@@ -1200,8 +1219,9 @@
  * If passed into the function, this will hold a boolean value that determines
  * if the algorithm used was "cryptographically strong", e.g., safe for usage with GPG,
  * passwords, etc. true if it did, otherwise false
  * </p>
+ * @param-out bool $strong_result
  * @return string|false the generated string of bytes on success, or false on failure.
  */
 #[LanguageLevelTypeAware(["7.4" => "string"], default: "string|false")]
 function openssl_random_pseudo_bytes(int $length, &$strong_result) {}
@@ -1245,8 +1265,9 @@
 
 /**
  * @param string $data
  * @param array &$certificates
+ * @param-out array $certificates
  * @return bool
  * @since 7.2
  */
 function openssl_pkcs7_read(string $data, &$certificates): bool {}
@@ -1278,9 +1299,9 @@
  * @param int $cipher_algo
  * @return bool
  * @since 8.0
  */
-function openssl_cms_encrypt(string $input_filename, string $output_filename, $certificate, ?array $headers, int $flags = 0, int $encoding = OPENSSL_ENCODING_SMIME, int $cipher_algo = OPENSSL_CIPHER_AES_128_CBC): bool {}
+function openssl_cms_encrypt(string $input_filename, string $output_filename, $certificate, ?array $headers, int $flags = 0, int $encoding = OPENSSL_ENCODING_SMIME, #[LanguageLevelTypeAware(['8.5' => 'int|string'], default: 'int')] $cipher_algo = OPENSSL_CIPHER_AES_128_CBC): bool {}
 
 /**
  * Signs the MIME message in the file with a cert and key and output the result to the supplied file.
  * @param string $input_filename
@@ -1311,8 +1332,9 @@
 /**
  * Exports the CMS file to an array of PEM certificates.
  * @param string $input_filename
  * @param array &$certificates
+ * @param-out array $certificates
  * @return bool
  * @since 8.0
  */
 function openssl_cms_read(string $input_filename, &$certificates): bool {}
@@ -1541,8 +1563,14 @@
  * @since 8.3
  */
 define('OPENSSL_CMS_OLDMIMETYPE', 1024);
 
+define('PKCS7_NOSMIMECAP', '512');
+define('PKCS7_CRLFEOL', 2048);
+define('PKCS7_NOCRL', 8192);
+define('PKCS7_NO_DUAL_CONTENT', 65536);
+define('OPENSSL_PKCS1_PSS_PADDING', 6);
+define('CURLOPT_INFILESIZE_LARGE', 30115);
 /**
  * @since 8.0
  */
 final class OpenSSLCertificate