mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-27 03:42:40 +00:00
EC: don't call loadCurveByParams if params is null
This commit is contained in:
parent
a7b1d031bb
commit
c4e07725aa
@ -106,6 +106,9 @@ abstract class PKCS8 extends Progenitor
|
|||||||
|
|
||||||
$decoded = ASN1::decodeBER($key[$type . 'Algorithm']['parameters']->element);
|
$decoded = ASN1::decodeBER($key[$type . 'Algorithm']['parameters']->element);
|
||||||
$params = ASN1::asn1map($decoded[0], Maps\ECParameters::MAP);
|
$params = ASN1::asn1map($decoded[0], Maps\ECParameters::MAP);
|
||||||
|
if (!$params) {
|
||||||
|
throw new \RuntimeException('Unable to decode the parameters using Maps\ECParameters');
|
||||||
|
}
|
||||||
|
|
||||||
$components = [];
|
$components = [];
|
||||||
$components['curve'] = self::loadCurveByParam($params);
|
$components['curve'] = self::loadCurveByParam($params);
|
||||||
|
Loading…
Reference in New Issue
Block a user