Skip to content

Commit 7b2bf15

Browse files
authored
Merge pull request #190 from IABTechLab/tjm-UID2-2808-allow-null-userdata
Allow for empty user_data
2 parents 64effc9 + 263e9d9 commit 7b2bf15

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/com/uid2/shared/secure/NitroCoreAttestationService.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ private AttestationResult attestInternal(byte[] publicKey, AttestationRequest aR
5656
}
5757

5858
String givenAttestationUrl = aDoc.getUserDataString();
59-
if (!UrlEquivalenceValidator.areUrlsEquivalent(this.attestationUrl, givenAttestationUrl, LOGGER)) {
60-
return new AttestationResult(AttestationFailure.UNKNOWN_ATTESTATION_URL);
59+
if (givenAttestationUrl != null && !givenAttestationUrl.isEmpty()) {
60+
if (!UrlEquivalenceValidator.areUrlsEquivalent(this.attestationUrl, givenAttestationUrl, LOGGER)) {
61+
return new AttestationResult(AttestationFailure.UNKNOWN_ATTESTATION_URL);
62+
}
6163
}
6264

6365
NitroEnclaveIdentifier id = NitroEnclaveIdentifier.fromRaw(aDoc.getPcr(0));

0 commit comments

Comments
 (0)