Skip to content

Commit 7da44b5

Browse files
committed
Fix integration test nonce handling to use URL-safe base64 consistently
The integration test generators were incorrectly converting from URL-safe base64 to standard base64, which causes nonce freshness validation to fail when the verification API now consistently uses URL-safe base64 encoding. This removes the erroneous conversions for both PSA and CCA schemes, ensuring consistent URL-safe base64 usage throughout the system. Signed-off-by: Kallal Mukherjee <[email protected]>
1 parent 80d6f95 commit 7da44b5

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

integration-tests/utils/generators.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,20 +128,18 @@ def generate_evidence(scheme, evidence, nonce, signing, outname):
128128

129129
if scheme == 'psa' and nonce:
130130
claims_file = f'{GENDIR}/claims/{scheme}.{evidence}.json'
131-
# convert nonce from base64url to base64
132-
translated_nonce = nonce.replace('-', '+').replace('_', '/')
131+
# Use nonce directly as URL-safe base64 to match verification API
133132
update_json(
134133
f'data/claims/{scheme}.{evidence}.json',
135-
{f'{scheme}-nonce': translated_nonce},
134+
{f'{scheme}-nonce': nonce},
136135
claims_file,
137136
)
138137
elif scheme == 'cca' and nonce:
139138
claims_file = f'{GENDIR}/claims/{scheme}.{evidence}.json'
140-
# convert nonce from base64url to base64
141-
translated_nonce = nonce.replace('-', '+').replace('_', '/')
139+
# Use nonce directly as URL-safe base64 to match verification API
142140
update_json(
143141
f'data/claims/{scheme}.{evidence}.json',
144-
{'cca-realm-delegated-token': {f'cca-realm-challenge': translated_nonce}},
142+
{'cca-realm-delegated-token': {f'cca-realm-challenge': nonce}},
145143
claims_file,
146144
)
147145
else:

0 commit comments

Comments
 (0)