Skip to content

Commit

Permalink
fix: #41 - NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
maduvena committed Sep 21, 2022
1 parent 01a0537 commit 58c13e4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,12 @@ private Pair<ArrayNode, String> prepareAllowedCredentials(String documentDomain,
allowedFido2Registrations.forEach((value) -> {
log.debug("attestation request:" + value.getRegistrationData().getAttenstationRequest());
});

// f.getRegistrationData().getAttenstationRequest() null check is added to maintain backward compatiblity with U2F devices when U2F devices are migrated to the FIDO2 server
List<JsonNode> allowedFido2Keys = allowedFido2Registrations.parallelStream()
.map(f -> dataMapperService.convertValue(new PublicKeyCredentialDescriptor(f.getRegistrationData().getType(),
(f.getRegistrationData().getAttestationType().equalsIgnoreCase(AttestationFormat.apple.getFmt()) || f
.getRegistrationData().getAttenstationRequest().contains(AuthenticatorAttachment.PLATFORM.getAttachment()))
((f.getRegistrationData().getAttestationType().equalsIgnoreCase(AttestationFormat.apple.getFmt())) || ( f.getRegistrationData().getAttenstationRequest() != null &&
f.getRegistrationData().getAttenstationRequest().contains(AuthenticatorAttachment.PLATFORM.getAttachment())))

? new String[] { "internal" }
: new String[] { "usb", "ble", "nfc" },
Expand Down

0 comments on commit 58c13e4

Please sign in to comment.