1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-12-04 18:48:24 +01:00

EC: don't call loadCurveByParams if params is null

This commit is contained in:
terrafrost 2020-01-02 05:43:27 -06:00
parent a7b1d031bb
commit c4e07725aa

View File

@ -106,6 +106,9 @@ abstract class PKCS8 extends Progenitor
$decoded = ASN1::decodeBER($key[$type . 'Algorithm']['parameters']->element);
$params = ASN1::asn1map($decoded[0], Maps\ECParameters::MAP);
if (!$params) {
throw new \RuntimeException('Unable to decode the parameters using Maps\ECParameters');
}
$components = [];
$components['curve'] = self::loadCurveByParam($params);