Skip to content

Commit 437f993

Browse files
committed
Change VerifyJwsObjectFun return type to KmmResult
1 parent 85f60c3 commit 437f993

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# Changelog
22

33
Release 5.10.0 (Unreleased)
4-
- Make `VerifyJwsObject` return `Result<Unit>` and propagate verification failures with descriptive errors across OAuth/OID flows and validators
5-
- StatusListToken:
4+
- Make `VerifyJwsObject` return `KmmResult<Unit>` and propagate verification failures with descriptive errors
65
- Remove `StatusTokenValidator`
76
- Remove `StatusTokenIntegrityValidator` class
87
- Refactor `StatusListToken.StatusListJwt` to `StatusListJwt`
98
- Refactor `StatusListToken.StatusListCwt` to `StatusListCwt`
10-
- Add `VerifyStatusListTokenHAIP` and related resolver/tests to enforce HAIP D05 certificate chain rules for status list JWTs
9+
- Add `VerifyStatusListTokenHAIP` and related resolver/tests to enforce HAIP d04 certificate chain rules for status list JWTs
1110
- OAuth 2.0:
1211
- Use correct path for metadata retrieval (inserting strings between host component and path component)
1312
- Support reading resource-server provided nonce for [OAuth 2.0 Demonstrating Proof of Possession (DPoP)](https://datatracker.ietf.org/doc/html/rfc9449)

vck/src/commonMain/kotlin/at/asitplus/wallet/lib/jws/JwsService.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package at.asitplus.wallet.lib.jws
22

33
import at.asitplus.KmmResult
44
import at.asitplus.catching
5-
import at.asitplus.catchingUnwrapped
65
import at.asitplus.signum.indispensable.CryptoPublicKey
76
import at.asitplus.signum.indispensable.Digest
87
import at.asitplus.signum.indispensable.KeyAgreementPrivateValue
@@ -570,7 +569,7 @@ class VerifyStatusListTokenHAIP(
570569
val trustStoreLookup: TrustStoreLookup = TrustStoreLookup { null },
571570
) : VerifyJwsObjectFun {
572571

573-
override suspend operator fun invoke(jwsObject: JwsSigned<*>) = catchingUnwrapped {
572+
override suspend operator fun invoke(jwsObject: JwsSigned<*>) = catching {
574573
val trustStore: Set<X509Certificate>? = trustStoreLookup(jwsObject)
575574
val certChain: CertificateChain? = jwsObject.header.certificateChain
576575
val signingCert: X509Certificate = certChain?.first() ?: throw Exception("Certificate Chain MUST not be empty")
@@ -611,7 +610,7 @@ class VerifyStatusListTokenHAIP(
611610
fun interface VerifyJwsObjectFun {
612611
suspend operator fun invoke(
613612
jwsObject: JwsSigned<*>,
614-
): Result<Unit>
613+
): KmmResult<Unit>
615614
}
616615

617616
class VerifyJwsObject(
@@ -624,7 +623,7 @@ class VerifyJwsObject(
624623
/** Need to implement if valid keys for JWS are transported somehow out-of-band, e.g. provided by a trust store */
625624
val publicKeyLookup: PublicJsonWebKeyLookup = PublicJsonWebKeyLookup { null },
626625
) : VerifyJwsObjectFun {
627-
override suspend operator fun invoke(jwsObject: JwsSigned<*>) = catchingUnwrapped {
626+
override suspend operator fun invoke(jwsObject: JwsSigned<*>) = catching {
628627
require(jwsObject.loadPublicKeys().any { verifyJwsSignature(jwsObject, it).isSuccess }) {
629628
"Invalid Signature"
630629
}

0 commit comments

Comments
 (0)