CarbonCopy Posted August 24, 2009 Share Posted August 24, 2009 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 Quote Link to comment Share on other sites More sharing options...
modchr00t Posted August 24, 2009 Share Posted August 24, 2009 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. Quote Link to comment Share on other sites More sharing options...
CarbonCopy Posted August 24, 2009 Author Share Posted August 24, 2009 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? Quote Link to comment Share on other sites More sharing options...
CarbonCopy Posted August 24, 2009 Author Share Posted August 24, 2009 Fixed the problem, for any further googlers, I used mknod /chroot/dev/random c 1 8 to recreate the required files in my chroot jail. Quote Link to comment Share on other sites More sharing options...
CarbonCopy Posted August 28, 2009 Author Share Posted August 28, 2009 I've created urandom and random, but this problem still occurs. But only randomly. It works the majority of times but if I keep refreshing the page I get the error every now and then Quote Link to comment Share on other sites More sharing options...
CarbonCopy Posted August 28, 2009 Author Share Posted August 28, 2009 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 />"; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.