Skip to content

Commit 34b266e

Browse files
committed
[PNV] Update the aggregator allowlist to be list based
1 parent ebab30b commit 34b266e

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

app/src/main/assets/pnv.wasm

16 Bytes
Binary file not shown.

app/src/main/java/com/credman/cmwallet/pnv/PnvTokenRegistry.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ data class PnvTokenRegistry(
169169
val credJson = JSONObject()
170170
credJson.put(SHARED_ATTRIBUTE_DISPLAY_NAME, item.phoneNumberAttributeDisplayName)
171171
if (item.supportedAggregatorIssNames != null) {
172-
val issAllowlist = JSONObject()
172+
val issAllowlist = JSONArray()
173173
for (issName in item.supportedAggregatorIssNames) {
174-
issAllowlist.put(issName, JSONObject())
174+
issAllowlist.put(issName)
175175
}
176176
credJson.put(ISS_ALLOWLIST, issAllowlist)
177177
}

matcher/pnv/dcql.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ cJSON *MatchCredential(cJSON *credential, cJSON *credential_store)
6666
{
6767
return matched_credentials;
6868
}
69-
char *iss_value = cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(cred_auth_json, "iss"));
69+
cJSON *iss_value = cJSON_GetObjectItemCaseSensitive(cred_auth_json, "iss");
7070

7171
cJSON *vct_values_obj = cJSON_GetObjectItemCaseSensitive(meta, "vct_values");
7272
cJSON *cred_candidates = candidates;
@@ -83,9 +83,15 @@ cJSON *MatchCredential(cJSON *credential, cJSON *credential_store)
8383
{
8484
cJSON_AddItemReferenceToArray(candidates, curr_candidate);
8585
}
86-
else if (cJSON_GetObjectItemCaseSensitive(iss_allowlist, iss_value) != NULL)
87-
{
88-
cJSON_AddItemReferenceToArray(candidates, curr_candidate);
86+
else
87+
{
88+
cJSON *allowed_iss;
89+
cJSON_ArrayForEach(allowed_iss, iss_allowlist) {
90+
if (cJSON_Compare(allowed_iss, iss_value, cJSON_True)) {
91+
cJSON_AddItemReferenceToArray(candidates, curr_candidate);
92+
break;
93+
}
94+
}
8995
}
9096
}
9197
}

0 commit comments

Comments
 (0)