From: marci at balabit dot hu
Operating system: linux
PHP version: 5CVS-2006-09-06 (CVS)
PHP Bug Type: OpenSSL related
Bug description: openssl_pkey_new does not support DSA key generation
Description:
------------
It does not support DSA key generation, and it is not mentioned in the
documentation. Also it misses some other DSA related functionality...
patch against Revision 1.98.2.5.2.17
--- openssl.c-orig 2006-09-06 11:36:26.000000000 +0200
+++ openssl.c 2006-09-06 11:39:32.000000000 +0200
@@ -2033,6 +2033,22 @@
if (EVP_PKEY_assign_RSA(req->priv_key,
RSA_generate_key(req->priv_key_bits, 0x10001, NULL, NULL)))
return_val = req->priv_key;
break;
+#ifndef NO_DSA
+ case OPENSSL_KEYTYPE_DSA:
+ {
+ DSA *dsapar =
DSA_generate_parameters(req->priv_key_bits, NULL, 0, NULL, NULL, NULL,
NULL);
+ if (dsapar) {
+ DSA_set_method(dsapar,
DSA_get_default_method());
+ if
(DSA_generate_key(dsapar)) {
+ if
(EVP_PKEY_assign_DSA(req->priv_key, dsapar))
+ return_val
= req->priv_key;
+ } else {
+ DSA_free(dsapar);
+ }
+ }
+ }
+ break;
+#endif
default:
php_error_docref(NULL TSRMLS_CC,
E_WARNING, "Unsupported private key type");
}
--
Edit bug report at http://bugs.php.net/?id=38731&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=38731&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=38731&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=38731&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38731&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=38731&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38731&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38731&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38731&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38731&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38731&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=38731&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=38731&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38731&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38731&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38731&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38731&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38731&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38731&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38731&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38731&r=mysqlcfg