Skip to content

Commit 58eb32e

Browse files
committed
use correct key
1 parent 3e10b18 commit 58eb32e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/mcapi/crypto/jwe-crypto.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ function JweCrypto(config) {
133133
decryptionEncoding = "AES-256-GCM";
134134
break;
135135
case "A128CBC-HS256":
136-
decryptionEncoding = "AES-128-CBC";
137-
secretKey = secretKey.slice(16, 32);
138-
gcmMode = false;
139136
if(this.enableHmacVerification) {
140137
verifyCbcHmac(jweTokenParts[0], iv, encryptedText, authTag, secretKey);
141138
}
139+
decryptionEncoding = "AES-128-CBC";
140+
secretKey = secretKey.slice(16, 32);
141+
gcmMode = false;
142142
break;
143143
default:
144144
throw new Error(

0 commit comments

Comments
 (0)