Doc #80715 [NEW]: Incorrect documentation for certificate and private_key in openssl_cms_sign()
| From: | nyuszika7h at gmail dot com | Date: | Fri, 05 Feb 2021 22:22:52 +0000 |
| Subject: | Doc #80715 [NEW]: Incorrect documentation for certificate and private_key in openssl_cms_sign() | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-18510@lists.php.net to get a copy of this message | ||
From: nyuszika7h at gmail dot com
Operating system: Debian 10
PHP version: 8.0.2
Package: OpenSSL related
Bug Type: Documentation Problem
Bug description:Incorrect documentation for certificate and private_key in openssl_cms_sign()
Description:
------------
---
From manual page: https://php.net/function.openssl-cms-sign
---
The documentation states the following:
> certificate
> The name of the file containing the signing certificate.
>
> private_key
> The name of file containing the key associated with certificate.
This is incorrect and results in "PHP message: PHP Warning:
openssl_cms_sign(): Error getting private key in file.php". It actually
has to be formatted per
<https://www.php.net/manual/en/openssl.certparams.php>,
so for example
file://cert.pem.
Test script:
---------------
// Incorrect code (following documentation)
openssl_cms_sign('input.txt', 'output.txt', 'cert.pem',
'privkey.pem',
null, OPENSSL_CMS_BINARY, OPENSSL_ENCODING_DER, 'chain.pem');
// Correct code
openssl_cms_sign('input.txt', 'output.txt', 'file://cert.pem',
'file://privkey.pem', null, OPENSSL_CMS_BINARY, OPENSSL_ENCODING_DER,
'chain.pem');
--
Edit bug report at https://bugs.php.net/bug.php?id=80715&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80715&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80715&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80715&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80715&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80715&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80715&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80715&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80715&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80715&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80715&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80715&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80715&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80715&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80715&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80715&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80715&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80715&r=mysqlcfg