Skip to content

Commit ad3040a

Browse files
committed
Support unknown attestation statement formats
1 parent ca5b624 commit ad3040a

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

NEWS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
== Version 1.7.0 (unreleased) ==
2+
3+
Changes:
4+
5+
* Fixed crash on unknown attestation statement formats
6+
** Unless `RelyingParty.allowUntrustedAttestation` is set to `false`, unknown
7+
attestation statements will now pass as untrusted attestations, instead of
8+
throwing an IllegalArgumentException.
9+
10+
111
== Version 1.6.4 ==
212

313
* Changed dependency declarations to version ranges

webauthn-server-core/src/main/java/com/yubico/webauthn/FinishRegistrationSteps.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ public AttestationType attestationType() {
463463
return AttestationType.ECDAA;
464464
}
465465
default:
466-
throw new IllegalArgumentException("Failed to resolve attestation type; unknown attestation statement format: " + attestation.getFormat());
466+
return AttestationType.UNKNOWN;
467467
}
468468
}
469469
} catch (IOException | CoseException | CertificateException e) {
@@ -509,6 +509,7 @@ public Optional<AttestationTrustResolver> trustResolver() {
509509
switch (attestationType) {
510510
case NONE:
511511
case SELF_ATTESTATION:
512+
case UNKNOWN:
512513
return Optional.empty();
513514

514515
case ATTESTATION_CA:
@@ -562,6 +563,10 @@ public void validate() {
562563
assure(allowUntrustedAttestation, "No attestation is not allowed.");
563564
break;
564565

566+
case UNKNOWN:
567+
assure(allowUntrustedAttestation, "Unknown attestation statement formats are not allowed.");
568+
break;
569+
565570
default:
566571
throw new UnsupportedOperationException("Attestation type not implemented: " + attestationType);
567572
}
@@ -574,8 +579,9 @@ public Step17 nextStep() {
574579

575580
public boolean attestationTrusted() {
576581
switch (attestationType) {
577-
case SELF_ATTESTATION:
578582
case NONE:
583+
case SELF_ATTESTATION:
584+
case UNKNOWN:
579585
return false;
580586

581587
case ATTESTATION_CA:

0 commit comments

Comments
 (0)