jose 1.28.0 → 1.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,7 +1,14 @@
1
- # Change Log
1
+ # Changelog
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.28.1](https://github.com/panva/jose/compare/v1.28.0...v1.28.1) (2021-04-09)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * defer AES CBC w/ HMAC decryption after tag verification passes ([08e1bc5](https://github.com/panva/jose/commit/08e1bc5ce7120eac78377577acba2f811c3a0b2b))
11
+
5
12
  # [1.28.0](https://github.com/panva/jose/compare/v1.27.3...v1.28.0) (2020-08-10)
6
13
 
7
14
 
@@ -44,13 +44,17 @@ const decrypt = (size, sign, { [KEYOBJECT]: keyObject }, ciphertext, { iv, tag =
44
44
  const expectedTag = sign({ [KEYOBJECT]: macKey }, macData, tag).slice(0, keySize)
45
45
  const macCheckPassed = timingSafeEqual(tag, expectedTag)
46
46
 
47
+ if (!macCheckPassed) {
48
+ throw new JWEDecryptionFailed()
49
+ }
50
+
47
51
  let cleartext
48
52
  try {
49
53
  const cipher = createDecipheriv(`aes-${size}-cbc`, encKey, iv)
50
54
  cleartext = Buffer.concat([cipher.update(ciphertext), cipher.final()])
51
55
  } catch (err) {}
52
56
 
53
- if (!cleartext || !macCheckPassed) {
57
+ if (!cleartext) {
54
58
  throw new JWEDecryptionFailed()
55
59
  }
56
60
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jose",
3
- "version": "1.28.0",
3
+ "version": "1.28.1",
4
4
  "description": "JSON Web Almost Everything - JWA, JWS, JWE, JWK, JWT, JWKS for Node.js with minimal dependencies",
5
5
  "keywords": [
6
6
  "access token",