iliaa Fri Jan 31 17:27:27 2003 EDT
Modified files: (Branch: PHP_4_3)
/php4/ext/openssl openssl.c
Log:
MFH
Index: php4/ext/openssl/openssl.c
diff -u php4/ext/openssl/openssl.c:1.52.2.6 php4/ext/openssl/openssl.c:1.52.2.7
--- php4/ext/openssl/openssl.c:1.52.2.6 Tue Dec 31 11:35:05 2002
+++ php4/ext/openssl/openssl.c Fri Jan 31 17:27:27 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: openssl.c,v 1.52.2.6 2002/12/31 16:35:05 sebastian Exp $ */
+/* $Id: openssl.c,v 1.52.2.7 2003/01/31 22:27:27 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1728,27 +1728,23 @@
}
else {
/* we want the private key */
+ BIO *in;
+
if (filename) {
- BIO *in;
if (php_openssl_safe_mode_chk(filename TSRMLS_CC)) {
return NULL;
}
in = BIO_new_file(filename, "r");
- if (in == NULL)
- return NULL;
- key = PEM_read_bio_PrivateKey(in, NULL,NULL,
passphrase);
- BIO_free(in);
+ } else {
+ in = BIO_new_mem_buf(Z_STRVAL_PP(val),
+Z_STRLEN_PP(val));
}
- else {
- BIO * b = BIO_new_mem_buf(Z_STRVAL_PP(val),
Z_STRLEN_PP(val));
- if (b == NULL)
- return NULL;
- key = (EVP_PKEY *) PEM_ASN1_read_bio((char
*(*)())d2i_PrivateKey,
- PEM_STRING_EVP_PKEY, b,
- NULL, NULL, passphrase);
- BIO_free(b);
+ if (in == NULL) {
+ return NULL;
}
+
+ key = PEM_read_bio_PrivateKey(in, NULL,NULL, passphrase);
+ BIO_free(in);
}
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php