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

Commit

Permalink
Merge branch 'master' into no
Browse files Browse the repository at this point in the history
  • Loading branch information
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Rsa.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
*/
namespace Zend\Crypt;

use Zend\Crypt\Exception;

/**
* @uses Zend\Crypt\Rsa\PrivateKey
* @uses Zend\Crypt\Rsa\PublicKey
Expand Down Expand Up @@ -211,7 +213,7 @@ public function generateKeys(array $configargs = null)
$publicKey = null;
$resource = openssl_pkey_new($config);
// above fails on PHP 5.3

openssl_pkey_export($resource, $private, $passPhrase);

$privateKey = new Rsa\PrivateKey($private, $passPhrase);
Expand Down Expand Up @@ -268,7 +270,7 @@ public function setHashAlgorithm($name)
// check if md2 digest is enabled on openssl just for backwards compatibility
$digests = openssl_get_md_methods();
if (!in_array(strtoupper($name), $digests)) {
throw new Zend\Crypt\Exception('Openssl md2 digest is not enabled (deprecated)');
throw new Exception('Openssl md2 digest is not enabled (deprecated)');
}
$this->_hashAlgorithm = OPENSSL_ALGO_MD2;
break;
Expand Down

0 comments on commit f4c706f

Please sign in to comment.