File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
webauthn-server-core/src/main/java/com/yubico/webauthn Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change 30
30
import COSE .CoseException ;
31
31
import com .upokecenter .cbor .CBORObject ;
32
32
import com .yubico .internal .util .CertificateParser ;
33
+ import com .yubico .internal .util .OptionalUtil ;
33
34
import com .yubico .webauthn .attestation .AttestationTrustSource ;
34
35
import com .yubico .webauthn .attestation .AttestationTrustSource .TrustRootsResult ;
35
36
import com .yubico .webauthn .data .AttestationObject ;
@@ -476,25 +477,22 @@ private Optional<AttestationTrustSource.TrustRootsResult> findTrustRoots() {
476
477
atp ->
477
478
attestationTrustSource .findTrustRoots (
478
479
atp ,
479
- Optional . ofNullable (
480
+ OptionalUtil . orElseOptional (
480
481
Optional .of (
481
482
attestation
482
483
.getAuthenticatorData ()
483
484
.getAttestedCredentialData ()
484
485
.get ()
485
486
.getAaguid ())
486
- .filter (aaguid -> !aaguid .equals (ZERO_AAGUID ))
487
- .orElseGet (
488
- () -> {
489
- if (!atp .isEmpty ()) {
490
- return CertificateParser .parseFidoAaguidExtension (
491
- atp .get (0 ))
492
- .map (ByteArray ::new )
493
- .orElse (null );
494
- } else {
495
- return null ;
496
- }
497
- })))));
487
+ .filter (aaguid -> !aaguid .equals (ZERO_AAGUID )),
488
+ () -> {
489
+ if (!atp .isEmpty ()) {
490
+ return CertificateParser .parseFidoAaguidExtension (atp .get (0 ))
491
+ .map (ByteArray ::new );
492
+ } else {
493
+ return Optional .empty ();
494
+ }
495
+ }))));
498
496
}
499
497
}
500
498
You can’t perform that action at this time.
0 commit comments