Fix critical bug in Crypto::unencapsulate

- The direction of the sub-function has been corrected
This commit is contained in:
Hypolite Petovan 2020-07-14 09:35:06 -04:00
parent acb9e8d356
commit 291f11a8bb

View file

@ -461,11 +461,12 @@ class Crypto
return;
}
$alg = ((array_key_exists('alg', $data)) ? $data['alg'] : 'aes256cbc');
$alg = $data['alg'] ?? 'aes256cbc';
if ($alg === 'aes256cbc') {
return self::encapsulateAes($data['data'], $prvkey);
return self::unencapsulateAes($data['data'], $prvkey);
}
return self::encapsulateOther($data['data'], $prvkey, $alg);
return self::unencapsulateOther($data, $prvkey, $alg);
}
/**