Skip to content

Commit 5019b8e

Browse files
committed
manual generation of cbor diagnost output
1 parent 8d096a3 commit 5019b8e

File tree

5 files changed

+46
-5
lines changed

5 files changed

+46
-5
lines changed

draft-ietf-oauth-status-list.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ The following example illustrates the CBOR representation of the Status List:
229229
The following is the CBOR diagnostic output of the example above:
230230

231231
~~~~~~~~~~
232-
{::include ./examples/status_list_encoding_cbor_diag}
232+
{::include ./example/status_list_encoding_cbor_diag}
233233
~~~~~~~~~~
234234

235235
# Status List Token {#status-list-token}
@@ -305,7 +305,7 @@ The following is a non-normative example for a Status List Token in CWT format (
305305
The following is the CBOR diagnostic output of the example above:
306306

307307
~~~~~~~~~~
308-
{::include ./examples/status_list_cwt_diag}
308+
{::include ./example/status_list_cwt_diag}
309309
~~~~~~~~~~
310310

311311
# Referenced Token {#referenced-token}

example/status_list_cwt_diag

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
d2 # tag(18)
2+
84 # array(4)
3+
53 # bytes(19)
4+
a20126106e7374617475736c # "¢\x01&\x10nstatusl"
5+
6973742b637774 # "ist+cwt"
6+
a1 # map(1)
7+
04 # uint(4)
8+
42 # bytes(2)
9+
3132 # "12"
10+
58 60 # bytes(96)
11+
a502782168747470733a2f2f # "¥\x02x!https://"
12+
6578616d706c652e636f6d2f # "example.com/"
13+
7374617475736c697374732f # "statuslists/"
14+
31017368747470733a2f2f65 # "1\x01shttps://e"
15+
78616d706c652e636f6d061a # "xample.com\x06\x1a"
16+
648c3fca041a8898c3ca19ff # "d\x8c?Ê\x04\x1a\x88\x98ÃÊ\x19ÿ"
17+
fe56a2646269747301636c73 # "þV¢dbits\x01cls"
18+
744a78dadbb918000217015d # "tJxÚÛ¹\x18\x00\x02\x17\x01]"
19+
58 40 # bytes(64)
20+
3fd60a6d10eb4b4131f1f6c1 # "?Ö\x0am\x10ëKA1ñöÁ"
21+
2fb365ae27b969e8e8df0b4f # "/³e®'¹ièèß\x0bO"
22+
4029815b679cb1051c1c9eb3 # "@)\x81[g\x9c±\x05\x1c\x1c\x9e³"
23+
6aa72f6f17bcfdb5ed443bdf # "j§/o\x17¼ýµíD;ß"
24+
c2339568ab42949169b413e7 # "Â3\x95h«B\x94\x91i´\x13ç"
25+
02ae1e6a # "\x02®\x1ej"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
a2 # map(2)
2+
64 # string(4)
3+
62697473 # "bits"
4+
02 # uint(2)
5+
63 # string(3)
6+
6c7374 # "lst"
7+
4b # bytes(11)
8+
78da3be9f2130003df0207 # "xÚ;éò\x13\x00\x03ß\x02\x07"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
a2 # map(2)
2+
64 # string(4)
3+
62697473 # "bits"
4+
01 # uint(1)
5+
63 # string(3)
6+
6c7374 # "lst"
7+
4a # bytes(10)
8+
78dadbb918000217015d # "xÚÛ¹\x18\x00\x02\x17\x01]"

src/status_token.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from jwcrypto import jwk, jwt
2-
from cwt import COSE, COSEKey, CWTClaims
2+
from cwt import COSE, COSEKey, CWTClaims, COSEHeaders
33
from status_list import StatusList
44
from datetime import datetime
55
from typing import Dict
@@ -139,8 +139,8 @@ def buildCWT(
139139
unprotected_header = {}
140140

141141
if self._key.key_id:
142-
unprotected_header[4] = self._key.key_id
143-
protected_header[1] = self._alg
142+
unprotected_header[COSEHeaders.KID] = self._key.key_id.encode('utf-8')
143+
protected_header[COSEHeaders.ALG] = self._alg
144144
protected_header[16] = STATUS_LIST_TYP_CWT
145145

146146
key = COSEKey.from_jwk(self._key)

0 commit comments

Comments
 (0)