Fix critical bug in Crypto::unencapsulate

- The direction of the sub-function has been corrected
pull/8879/head
Hypolite Petovan 2020-07-14 09:35:06 -04:00
rodzic acb9e8d356
commit 291f11a8bb
1 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -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);
}
/**