Edit report at https://bugs.php.net/bug.php?id=38917&edit=1
ID: 38917 Updated by: php-bugs@lists.php.net Reported by: zeph at purotesto dot it Summary: OpenSSL: signing function for spkac -Status: Feedback +Status: No Feedback Type: Feature/Change Request Package: OpenSSL related Operating System: Irrilevant PHP Version: trunk New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. Previous Comments: ------------------------------------------------------------------------ [2012-12-19 15:14:04] queenzeal at gmail dot com If you want SPKAC support in PHP without having to recompile it, try the latest Git version of phpseclib (http://phpseclib.sourceforge.net/). An example of how to use it: http://www.frostjedi.com/phpbb3/viewtopic.php?p=389618#p389618 ------------------------------------------------------------------------ [2012-01-10 10:38:37] jason dot gerfen at gmail dot com I have added the requested test case and it is included in the patch as 026.phpt. I have also performed the required testing against the Openssl 0.9.8x and 1.0.0x. It is attached to the original bug report #38917. In addition to attaching the proposed patch I have created a github repo to make maintenance on the patch simple for myself. The URL is https://github.com/jas-/SPKAC-PHP-OpenSSL. ------------------------------------------------------------------------ [2011-12-21 10:49:08] jason dot gerfen at gmail dot com Once again, please disregard the last message. After researching the documentation I found that where I had been using NULL with the openssl_csr_sign() function allows for a CA option as well as the SPKAC addition to the configargs optional array. The patch was updated last night to include the 026.phpt test script, as well as the five new functions to work with the SPKI provided by keygen tags. How do patch inclusions work besides posting them to the php internals list? ------------------------------------------------------------------------ [2011-12-14 22:10:52] jason dot gerfen at gmail dot com Please disregard my previous comment. I did a little more digging and am under the impression that adding the following to php_openssl_make_REQ() function should allow me to create a self signed certificate using the SPKAC NID like so? if (strcmp(strindex, "SPKAC") == 0) { if (!X509_NAME_add_entry_by_txt(subj, strindex, MBSTRING_ASC, (unsigned char*)Z_STRVAL_PP(item), -1, -1, 0)){ php_error_docref(NULL TSRMLS_CC, E_WARNING, "dn: add_entry_by_txt %s -> %s (failed)", strindex, Z_STRVAL_PP(item)); return FAILURE; } } Would you recommend another method? Please advise. ------------------------------------------------------------------------ [2011-12-14 19:40:20] jason dot gerfen at gmail dot com One other question about using SPKAC's when creating a x509. It seems the current method using openssl_csr_new() which in turn calls the php_openssl_make_REQ() to assign the specified DN attributes has no method of adding the SPKAC field. After digging around it seems logical to use the OBJ_create() and OBJ_* family of functions to add NID. Please forgive me if I am way off here but any direction you could point me in using the existing functions to output and sign a certificate similar to the following command? openssl ca -config /path/to/openssl.conf -days 180 -notext -batch \ -spkac /path/to/cert.pem -out /path/to/signed.pem -passin pass:'random' My assumption is that I will need to create one specifically for this purpose but would like your insight. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=38917 -- Edit this bug report at https://bugs.php.net/bug.php?id=38917&edit=1