iliaa Fri Jan 31 17:15:56 2003 EDT Modified files: /php4/ext/openssl openssl.c Log: Fixed bug #21986 (openssl test failure). Index: php4/ext/openssl/openssl.c diff -u php4/ext/openssl/openssl.c:1.63 php4/ext/openssl/openssl.c:1.64 --- php4/ext/openssl/openssl.c:1.63 Sat Jan 18 14:41:38 2003 +++ php4/ext/openssl/openssl.c Fri Jan 31 17:15:55 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: openssl.c,v 1.63 2003/01/18 19:41:38 iliaa Exp $ */ +/* $Id: openssl.c,v 1.64 2003/01/31 22:15:55 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1726,27 +1726,22 @@ } } 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 { - 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); + in = BIO_new_mem_buf(Z_STRVAL_PP(val), +Z_STRLEN_PP(val)); + } + + 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