Skip to content

Commit bb0107b

Browse files
vjardinnikic
authored andcommitted
openssl_pkcs7_read: input is data not filename
The argument should be an input string and not a filename. Fix: php/doc-en#559 Suggested-by: George Peter Banyard <girgias@php.net> Closes phpGH-6942.
1 parent f020d53 commit bb0107b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

ext/openssl/openssl.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function openssl_pkcs7_sign(string $input_filename, string $output_filename, Ope
120120
function openssl_pkcs7_decrypt(string $input_filename, string $output_filename, $certificate, $private_key = null): bool {}
121121

122122
/** @param array $certificates */
123-
function openssl_pkcs7_read(string $input_filename, &$certificates): bool {}
123+
function openssl_pkcs7_read(string $data, &$certificates): bool {}
124124

125125
function openssl_cms_verify(string $input_filename, int $flags = 0, ?string $certificates = null, array $ca_info = [], ?string $untrusted_certificates_filename = null, ?string $content = null, ?string $pk7 = null, ?string $sigfile = null, int $encoding = OPENSSL_ENCODING_SMIME): bool {}
126126

ext/openssl/openssl_arginfo.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: d4f73f86e6f16a74ab5b60bb79c4a9f29e9bc4fb */
2+
* Stub hash: b58bd453ee5bedc500fe0e81c00c6a8e0eca85a0 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_x509_export_to_file, 0, 2, _IS_BOOL, 0)
55
ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL)
@@ -195,7 +195,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_pkcs7_decrypt, 0, 3, _IS
195195
ZEND_END_ARG_INFO()
196196

197197
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_pkcs7_read, 0, 2, _IS_BOOL, 0)
198-
ZEND_ARG_TYPE_INFO(0, input_filename, IS_STRING, 0)
198+
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
199199
ZEND_ARG_INFO(1, certificates)
200200
ZEND_END_ARG_INFO()
201201

@@ -240,7 +240,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_cms_decrypt, 0, 3, _IS_B
240240
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_LONG, 0, "OPENSSL_ENCODING_SMIME")
241241
ZEND_END_ARG_INFO()
242242

243-
#define arginfo_openssl_cms_read arginfo_openssl_pkcs7_read
243+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_cms_read, 0, 2, _IS_BOOL, 0)
244+
ZEND_ARG_TYPE_INFO(0, input_filename, IS_STRING, 0)
245+
ZEND_ARG_INFO(1, certificates)
246+
ZEND_END_ARG_INFO()
244247

245248
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_private_encrypt, 0, 3, _IS_BOOL, 0)
246249
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)

0 commit comments

Comments
 (0)