Skip to content

Commit

Permalink
v2.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasroussel committed Feb 11, 2024
1 parent 093661a commit c59770c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.13.0

- Fix invalid ECDSA signature for keys that are not a multiple of 8 (e.g. secp521r1) (https://github.com/jonasroussel/dart_jsonwebtoken/issues/51)

## 2.12.2

- Add testable date times (https://github.com/jonasroussel/dart_jsonwebtoken/issues/50)
Expand Down
4 changes: 2 additions & 2 deletions lib/src/algorithms.dart
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ class ECDSAAlgorithm extends JWTAlgorithm {
final len = privateKey.size;
final bytes = Uint8List(len * 2);

bytes.setRange(0, len, rBytes.reversed);
bytes.setRange(len, len * 2, sBytes.reversed);
bytes.setRange(len - rBytes.length, len, rBytes.reversed);
bytes.setRange((len * 2) - sBytes.length, len * 2, sBytes.reversed);

return bytes;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/keys.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ECPrivateKey extends JWTKey {
}

key = _key;
size = (_params.curve.fieldSize / 8).round();
size = (_params.curve.fieldSize / 8).ceil();
}

ECPrivateKey.raw(pc.ECPrivateKey _key) {
Expand All @@ -86,7 +86,7 @@ class ECPrivateKey extends JWTKey {
}

key = _key;
size = (_params.curve.fieldSize / 8).round();
size = (_params.curve.fieldSize / 8).ceil();
}
ECPrivateKey.clone(ECPrivateKey _key)
: key = _key.key,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: dart_jsonwebtoken
description: A dart implementation of the famous javascript library 'jsonwebtoken' (JWT).
version: 2.12.2
version: 2.13.0
repository: https://github.com/jonasroussel/dart_jsonwebtoken
homepage: https://github.com/jonasroussel/dart_jsonwebtoken#readme

Expand Down

0 comments on commit c59770c

Please sign in to comment.