Skip to content

Commit 5ca066a

Browse files
Daniel Ruberychromium-wpt-export-bot
authored andcommitted
Update JWT contents for DBSC
This CL splits the header and payload functions in session_binding_utils.h in order to allow for three different JWT schemas for DBSC: - OTFeedback disabled (both registration and refresh) - OTFeedback enabled, registration - OTFeedback enabled, refresh We can clean up the Legacy* functions when removing the OTFeedback flag. Fixed: 442623885 Change-Id: If6700157859aaa669d4fd7a7775687654b6d025a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6977530 Commit-Queue: Daniel Rubery <[email protected]> Reviewed-by: thefrog <[email protected]> Cr-Commit-Position: refs/heads/main@{#1520715}
1 parent 231c35a commit 5ca066a

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

device-bound-session-credentials/jwt_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def decode_jwt(token, key=None):
2222
# If there is a key passed in (for refresh), use that for checking the signature below.
2323
# Otherwise (for registration), use the key sent within the JWT to check the signature.
2424
if key == None:
25-
key = decoded_payload.get('key')
25+
key = decoded_header.get('jwk')
2626
public_key = serialization.load_pem_public_key(jwk_to_pem(key))
2727
# Verifying the signature will throw an exception if it fails.
2828
verify_rs256_signature(header, payload, signature, public_key)

device-bound-session-credentials/refresh_session.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,4 @@ def main(request, response):
4141
if not verified or jwt_payload.get("jti") != challenge:
4242
return (400, response.headers, "")
4343

44-
if jwt_payload.get("sub") != session_id_header:
45-
return (400, response.headers, "")
46-
4744
return test_session_manager.get_session_instructions_response(session_id, request)

device-bound-session-credentials/start_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def main(request, response):
1111

1212
jwt_header, jwt_payload, verified = jwt_helper.decode_jwt(request.headers.get("Secure-Session-Response").decode('utf-8'))
1313
session_id = test_session_manager.create_new_session()
14-
test_session_manager.set_session_key(session_id, jwt_payload.get('key'))
14+
test_session_manager.set_session_key(session_id, jwt_header.get('jwk'))
1515

1616
if not verified or jwt_payload.get("jti") != "login_challenge_value":
1717
return (400, response.headers, "")

0 commit comments

Comments
 (0)