Skip to content

Commit 49a0f98

Browse files
committed
Bug 1990581 [wpt PR 55048] - Update JWT contents for DBSC, a=testonly
Automatic update from web-platform-tests 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 <druberychromium.org> Reviewed-by: thefrog <thefrogchromium.org> Cr-Commit-Position: refs/heads/main{#1520715} -- wpt-commits: 5ca066a68da1ca0bccbc955d2725d922bb699405 wpt-pr: 55048 UltraBlame original commit: 7bc605a49417ce338e2717352bf664792fe9c1e3
1 parent 9573f60 commit 49a0f98

File tree

3 files changed

+246
-28
lines changed

3 files changed

+246
-28
lines changed

testing/web-platform/tests/device-bound-session-credentials/jwt_helper.py

Lines changed: 244 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,12 @@
198198

199199
key
200200
=
201-
decoded_payload
201+
decoded_header
202202
.
203203
get
204204
(
205205
'
206-
key
206+
jwk
207207
'
208208
)
209209

@@ -587,3 +587,245 @@
587587
encoded_data
588588
)
589589
)
590+
def
591+
thumbprint_for_jwk
592+
(
593+
jwk
594+
)
595+
:
596+
597+
filtered_jwk
598+
=
599+
None
600+
601+
if
602+
jwk
603+
[
604+
'
605+
kty
606+
'
607+
]
608+
=
609+
=
610+
'
611+
RSA
612+
'
613+
:
614+
615+
filtered_jwk
616+
=
617+
dict
618+
(
619+
)
620+
621+
filtered_jwk
622+
[
623+
'
624+
kty
625+
'
626+
]
627+
=
628+
jwk
629+
[
630+
'
631+
kty
632+
'
633+
]
634+
635+
filtered_jwk
636+
[
637+
'
638+
n
639+
'
640+
]
641+
=
642+
jwk
643+
[
644+
'
645+
n
646+
'
647+
]
648+
649+
filtered_jwk
650+
[
651+
'
652+
e
653+
'
654+
]
655+
=
656+
jwk
657+
[
658+
'
659+
e
660+
'
661+
]
662+
663+
elif
664+
jwk
665+
[
666+
'
667+
kty
668+
'
669+
]
670+
=
671+
=
672+
'
673+
EC
674+
'
675+
:
676+
677+
filtered_jwk
678+
=
679+
dict
680+
(
681+
)
682+
683+
filtered_jwk
684+
[
685+
'
686+
kty
687+
'
688+
]
689+
=
690+
jwk
691+
[
692+
'
693+
kty
694+
'
695+
]
696+
697+
filtered_jwk
698+
[
699+
'
700+
crv
701+
'
702+
]
703+
=
704+
jwk
705+
[
706+
'
707+
crv
708+
'
709+
]
710+
711+
filtered_jwk
712+
[
713+
'
714+
x
715+
'
716+
]
717+
=
718+
jwk
719+
[
720+
'
721+
x
722+
'
723+
]
724+
725+
filtered_jwk
726+
[
727+
'
728+
y
729+
'
730+
]
731+
=
732+
jwk
733+
[
734+
'
735+
y
736+
'
737+
]
738+
739+
else
740+
:
741+
742+
return
743+
None
744+
745+
serialized_jwk
746+
=
747+
json
748+
.
749+
dumps
750+
(
751+
filtered_jwk
752+
sort_keys
753+
=
754+
True
755+
separators
756+
=
757+
(
758+
'
759+
'
760+
'
761+
:
762+
'
763+
)
764+
)
765+
766+
digest
767+
=
768+
hashes
769+
.
770+
Hash
771+
(
772+
hashes
773+
.
774+
SHA256
775+
(
776+
)
777+
)
778+
779+
digest
780+
.
781+
update
782+
(
783+
serialized_jwk
784+
.
785+
encode
786+
(
787+
"
788+
utf
789+
-
790+
8
791+
"
792+
)
793+
)
794+
795+
thumbprint_base64
796+
=
797+
base64
798+
.
799+
b64encode
800+
(
801+
digest
802+
.
803+
finalize
804+
(
805+
)
806+
altchars
807+
=
808+
b
809+
"
810+
-
811+
_
812+
"
813+
)
814+
.
815+
rstrip
816+
(
817+
b
818+
"
819+
=
820+
"
821+
)
822+
823+
return
824+
thumbprint_base64
825+
.
826+
decode
827+
(
828+
'
829+
ascii
830+
'
831+
)

testing/web-platform/tests/device-bound-session-credentials/refresh_session.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -341,30 +341,6 @@
341341
challenge
342342
:
343343

344-
return
345-
(
346-
400
347-
response
348-
.
349-
headers
350-
"
351-
"
352-
)
353-
354-
if
355-
jwt_payload
356-
.
357-
get
358-
(
359-
"
360-
sub
361-
"
362-
)
363-
!
364-
=
365-
session_id_header
366-
:
367-
368344
return
369345
(
370346
400

testing/web-platform/tests/device-bound-session-credentials/start_session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@
148148
set_session_key
149149
(
150150
session_id
151-
jwt_payload
151+
jwt_header
152152
.
153153
get
154154
(
155155
'
156-
key
156+
jwk
157157
'
158158
)
159159
)

0 commit comments

Comments
 (0)