Jump to content

openssl_pkcs7_sign() error creating PKCS7 structure!


CarbonCopy

Recommended Posts

I am building my own shopping cart that has to work in a situation where all shell functions are disabled and Apache is in a chroot environment (Created with mod_chroot). Everything works great for PHP and the shopping cart EXCEPT for the encryption standards. I found a really nice script that had been working before the chroot jail, and now it is broken. I do not know what the error means or how to fix it. Any ideas people?

 

Warning: openssl_pkcs7_sign() [function.openssl-pkcs7-sign]: error creating PKCS7 structure! in /www/developers.northernlightstechnology.ca/sandbox/clients/1212532950/wordpress/wp-cart/openssl/openssl.php on line 186

 

The nice script for encryption i am using can be found at the below link:

 

http://developer.paypal-portal.com/pdn/attachments/pdn/ewp/87/1/paypalewp.php

I am building my own shopping cart that has to work in a situation where all shell functions are disabled and Apache is in a chroot environment (Created with mod_chroot). Everything works great for PHP and the shopping cart EXCEPT for the encryption standards. I found a really nice script that had been working before the chroot jail, and now it is broken. I do not know what the error means or how to fix it. Any ideas people?

 

Warning: openssl_pkcs7_sign() [function.openssl-pkcs7-sign]: error creating PKCS7 structure! in /www/developers.northernlightstechnology.ca/sandbox/clients/1212532950/wordpress/wp-cart/openssl/openssl.php on line 186

 

Either the temporary dir used by the script or /dev/{u,}random, are not available within the jail.

Well open_basedir has restricted access outside of the website directory, but I moved the tmp folder to /chroot/www/domain.tld/.tmp which is owned by apache:apache and chmod'd to 700. No idea about the dev thing, I definitely didn't create it. How could i do it?

When the error occurs the following "debug" code produces no output

 

ini_set("display_errors","on");
error_reporting( E_ALL );

for ($i = 0; $i < 100; $i++) {
openssl_public_encrypt ("BBBBBBBBBBBBBBBBBBBBBB",$strong,file_get_contents($MY_CERT_FILE));	
openssl_private_decrypt($strong,$dec,file_get_contents($MY_KEY_FILE));
echo $dec . "<br />";
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.