Skip to content

Releases: vapor/jwt-kit

Fix ECDSA signature size

21 Feb 18:37
77553e6
Compare
Choose a tag to compare
Pre-release

Correctly serializes ECDSA signature R / S values according to elliptic curve.

Before this patch, the code assumes R / S values will be 32 bytes. This is true for P-256 and P-384 keys, but is not true for P-521 keys. P-521 keys result in 66 byte R / S values.

From https://tools.ietf.org/html/rfc7515#appendix-A.3:

Section on ES256

We need to split the 64 member octet sequence of the JWS Signature

Section on ES512

We need to split the 132-member octet sequence of the JWS Signature into two 66-octet sequences

Note that the curve name (i.e., P-521) is different than the JWT algorithm name (i.e., ES512). The 512 in ES512 refers to SHA512. Also note that P-521 != 512, that's not a typo.

In order to support the different key curves dynamically, the signer now gets the curve name from the key during signing and verification. This curve is used to determine how wide the R / S values should be.

Remove OpenSSL

21 Feb 17:36
1183373
Compare
Choose a tag to compare
Remove OpenSSL Pre-release
Pre-release

Removes OpenSSL and migrates calls to our own vendored BoringSSL (#14, #13).

BoolClaim handles strings

18 Feb 00:18
b644574
Compare
Choose a tag to compare
Pre-release

BoolClaim wasn't properly handling "true" and "false" as strings.

Apple/Google identity tokens

15 Feb 18:24
a52a592
Compare
Choose a tag to compare
Pre-release

Adds commonly used AppleIdentityToken and GoogleIdentityToken structs. This includes code necessary to validate the apple/google provided identity data against their respective JWKS elements.

This patch also restructures the project a bit to move classes into their own files with hierarchical folders to make it easier to find the items you're looking for.

JWKS.find

13 Feb 21:11
53f4ab9
Compare
Choose a tag to compare
JWKS.find Pre-release
Pre-release

Adds new methods for finding JWKs from by identifier and type (#10).

let jwks: JWKS = ...
let signInWithApple = jwks.find(identifier: "AIDOPK1", type: .rsa)

Fix Payload Verification

07 Jan 18:10
01c623f
Compare
Choose a tag to compare
Pre-release

JWT verification using JWTSigner and JWTSigners now correctly invokes JWTPayload's optional verify method. (#6)

JWTKit 4.0.0 Beta 2.1

10 Dec 02:33
Compare
Choose a tag to compare
JWTKit 4.0.0 Beta 2.1 Pre-release
Pre-release
  • Replaced all fatalErrors with Swift errors.

JWTKit 4.0.0 Beta 2

09 Dec 16:40
2c5ffd2
Compare
Choose a tag to compare
JWTKit 4.0.0 Beta 2 Pre-release
Pre-release
  • Separated from vapor/jwt into new repo
  • Removed JWT type and split functionality into JWTSigner and JWTSigners
  • New internal JWTParser and JWTSerializer types to reduce code dupe