This commit is contained in:
Jonas Roussel
2024-02-11 18:26:13 +01:00
parent 093661afe2
commit c59770c06a
4 changed files with 9 additions and 5 deletions

View File

@ -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)

View File

@ -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;
}

View File

@ -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) {
@ -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,

View File

@ -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