From 3ba4baa2b3075ee5213efcda8cc3c029d1426283 Mon Sep 17 00:00:00 2001 From: Kelvin Mo Date: Sat, 6 Jul 2024 12:40:05 +1000 Subject: [PATCH] Fix issue with null $alg in constructor --- src/SimpleJWT/Crypt/KeyManagement/AESGCMKeyWrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SimpleJWT/Crypt/KeyManagement/AESGCMKeyWrap.php b/src/SimpleJWT/Crypt/KeyManagement/AESGCMKeyWrap.php index 6de8d26..f5fa7d8 100644 --- a/src/SimpleJWT/Crypt/KeyManagement/AESGCMKeyWrap.php +++ b/src/SimpleJWT/Crypt/KeyManagement/AESGCMKeyWrap.php @@ -52,7 +52,7 @@ class AESGCMKeyWrap extends BaseAlgorithm implements KeyEncryptionAlgorithm { private $aesgcm; public function __construct(?string $alg) { - $this->aesgcm = new AESGCM(substr($alg, 0, -2)); + $this->aesgcm = new AESGCM(($alg == null) ? null : substr($alg, 0, -2)); parent::__construct($alg); }