Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Little config settings #327

Closed
wants to merge 1 commit into from
Closed

Conversation

z3nth10n
Copy link

@z3nth10n z3nth10n commented May 11, 2018

In some cases the following error occurs:

Warning: openssl_pkey_export() [function.openssl-pkey-export]: cannot get key from parameter 1 in C:\wamp\www\opensslsample\index.php on line 18

Warning: openssl_pkey_get_details() expects parameter 1 to be resource, boolean given in C:\wamp\www\opensslsample\index.php on line 21

Extracted from: https://stackoverflow.com/a/50257146/3286975

I cannot reproduce right now, but in some cases it occurs.

I also added autoload for non POO projects, I can divide this commit into two if you don't to add it.

Oh... I didn't want to put those lines:

$privatekey = call_user_func_array(array($this, '_convertPrivateKey'), array_values($this->_parseKey($privatekey, self::PRIVATE_FORMAT_PKCS1)));
$publickey = call_user_func_array(array($this, '_convertPublicKey'), array_values($this->_parseKey($publickey, self::PUBLIC_FORMAT_PKCS1)));

They are from the on-going investigation issue. Sorry 馃槥

@Spomky
Copy link
Member

Spomky commented May 15, 2018

Hi @z3nth10n,

I am sorry but I cannot accept this PR.
I don't want to add any autoloader in this project as it is already PSR-4 compliant and better autoloaders exist (ex. https://www.php-fig.org/psr/psr-4/examples/).

Regarding the OpenSSL configuration, it is a platform adn I cannot set any configuration here that may impact an existing config.
Another way could be to add a new optional parameter to the desired configuration file.
Same should be done for EC keys.

@Spomky Spomky closed this May 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants