php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #52356
Patch openssl_pkcs7_mem_functions revision 2014-01-13 15:05 UTC by php at kriegt dot es
Patch openssl_pkcs7_sign.patch revision 2010-07-16 08:10 UTC by jille at quis dot cx

Patch openssl_pkcs7_sign.patch for OpenSSL related Bug #52356

Patch version 2010-07-16 08:10 UTC

Return to Bug #52356 | Download this patch
Patch Revisions:

Developer: jille@quis.cx

Index: openssl.c
===================================================================
--- openssl.c	(revision 14)
+++ openssl.c	(working copy)
@@ -3514,12 +3514,12 @@
 	uint strindexlen;
 	HashPosition hpos;
 	char * strindex;
-	char * infilename;	int infilename_len;
+	char * infiledata;	int infiledata_len;
 	char * outfilename;	int outfilename_len;
 	char * extracertsfilename = NULL; int extracertsfilename_len;
 
 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssZZa!|ls",
-				&infilename, &infilename_len, &outfilename, &outfilename_len,
+				&infiledata, &infiledata_len, &outfilename, &outfilename_len,
 				&zcert, &zprivkey, &zheaders, &flags, &extracertsfilename,
 				&extracertsfilename_len) == FAILURE) {
 		return;
@@ -3546,13 +3546,13 @@
 		goto clean_exit;
 	}
 
-	if (php_openssl_safe_mode_chk(infilename TSRMLS_CC) || php_openssl_safe_mode_chk(outfilename TSRMLS_CC)) {
+	if (php_openssl_safe_mode_chk(outfilename TSRMLS_CC)) {
 		goto clean_exit;
 	}
 
-	infile = BIO_new_file(infilename, "r");
+	infile = BIO_new_mem_buf(infiledata, infiledata_len);
 	if (infile == NULL) {
-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening input file %s!", infilename);
+		php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening memory input!");
 		goto clean_exit;
 	}
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 10:01:30 2024 UTC