Skip to content

Commit 3bc17eb

Browse files
authored
Merge branch 'main' into gen_art_review
2 parents 7bbb8c3 + 665a02c commit 3bc17eb

File tree

3 files changed

+51
-57
lines changed

3 files changed

+51
-57
lines changed

draft-ietf-oauth-status-list.md

Lines changed: 41 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ The following is a non-normative example of a Status List Token in JWT format:
445445

446446
## Status List Token in CWT Format {#status-list-token-cwt}
447447

448-
The Status List Token MUST be encoded as a "CBOR Web Token (CWT)" according to {{RFC8392}}.
448+
The Status List Token MUST be encoded as a "CBOR Web Token (CWT)" according to {{RFC8392}}. The Status List Token MUST not be tagged with the tags defined in section 6 of {{RFC8392}} or in section 2 of {{RFC9052}}.
449449

450450
The following content applies to the protected header of the CWT:
451451

@@ -463,11 +463,11 @@ The following additional rules apply:
463463

464464
1. The CWT MAY contain other claims.
465465

466-
2. The CWT MUST be secured using a cryptographic signature or MAC algorithm. Relying Parties MUST reject CWTs with an invalid signature.
466+
1. The CWT MUST be secured using a cryptographic signature or MAC algorithm. Relying Parties MUST reject CWTs with an invalid signature.
467467

468-
3. Relying Parties MUST reject CWTs that are not valid in all other respects per "CBOR Web Token (CWT)" {{RFC8392}}.
468+
1. Relying Parties MUST reject CWTs that are not valid in all other respects per "CBOR Web Token (CWT)" {{RFC8392}}.
469469

470-
4. Application of additional restrictions and policies are at the discretion of the Relying Party.
470+
1. Application of additional restrictions and policies are at the discretion of the Relying Party.
471471

472472
The following is a non-normative example of a Status List Token in CWT format in Hex:
473473

@@ -1042,7 +1042,7 @@ This malicious behavior can be detected by Relying Parties that request large am
10421042

10431043
## Observability of Relying Parties {#privacy-relying-party}
10441044

1045-
Once the Relying Party receives the Referenced Token, this enables them to request the Status List to validate its status through the provided `uri` parameter and look up the corresponding `index`. However, the Relying Party may persistently store the `uri` and `index` of the Referenced Token to request the Status List again at a later time. By doing so regularly, the Relying Party may create a profile of the Referenced Token's validity status. This behaviour may be intended as a feature, e.g. for an identity proofing (e.g. Know-Your-Customer process in finance industry) that requires regular validity checks, but might also be abused in cases where this is not intended and unknown to the Holder, e.g. profiling the suspension of a driving license or checking the employment status of an employee credential.
1045+
Once the Relying Party receives the Referenced Token, this enables them to request the Status List to validate its status through the provided `uri` parameter and look up the corresponding `index`. However, the Relying Party may persistently store the `uri` and `index` of the Referenced Token to request the Status List again at a later time. By doing so regularly, the Relying Party may create a profile of the Referenced Token's validity status. This behaviour may be intended as a feature, e.g. for an identity proofing (e.g. Know-Your-Customer process in finance industry) that requires regular validity checks, but might also be abused in cases where this is not intended and unknown to the Holder, e.g. profiling the suspension of an employee credential.
10461046

10471047
This behaviour could be mitigated by:
10481048

@@ -1094,8 +1094,6 @@ There are strong privacy concerns that have to be carefully taken into considera
10941094

10951095
As previously explained, there is the potential risk of observability by Relying Parties (see [](#privacy-relying-party)) and Outsiders (see [](#privacy-outsider)). That means that any Status Type that transports special information about a Referenced Token can leak information to other parties. This document defines one additional Status Type with "SUSPENDED" that conveys such additional information.
10961096

1097-
A concrete example for "SUSPENDED" would be a driver's license, where the digital driver's license might still be useful to prove other information about its holder, but suspended could signal that it should not be considered valid in the scope of being allowed to drive a car. This case could be solved by either introducing a special status type, or by revoking the Referenced Token and re-issuing with changed attributes. For such a case, the status type suspended might be dangerous as it would leak the information of a suspended driver's license even if the driver's license is used as a mean of identification and not in the context of driving a car. This could also allow for the unwanted collection of statistical data on the status of driver's licenses.
1098-
10991097
Ecosystems that want to use other Status Types than "VALID" and "INVALID" should consider the possible leakage of data and profiling possibilities before doing so and evaluate if revocation and re-issuance might a better fit for their use-case.
11001098

11011099
# Implementation Considerations {#implementation}
@@ -1502,41 +1500,7 @@ IANA is requested to register the following OID "1.3.6.1.5.5.7.3.TBD" in the "SM
15021500

15031501
IANA is requested to register the following OID "1.3.6.1.5.5.7.0.TBD" in the "SMI Security for PKIX Module Identifier" registry (1.3.6.1.5.5.7.0), this OID is defined in section [](#asn1-module).
15041502

1505-
# Appendix A. ASN.1 Module {#asn1-module}
1506-
{:numbered="false"}
1507-
1508-
The following module adheres to ASN.1 specifications {{X.680}} and {{X.690}}.
1509-
1510-
~~~
1511-
<CODE BEGINS>
1512-
1513-
OauthStatusSigning-EKU
1514-
{ iso(1) identified-organization(3) dod(6) internet(1)
1515-
security(5) mechanisms(5) pkix(7) id-mod(0)
1516-
id-mod-oauth-status-signing-eku (TBD) }
1517-
1518-
DEFINITIONS IMPLICIT TAGS ::=
1519-
BEGIN
1520-
1521-
-- OID Arc
1522-
1523-
id-kp OBJECT IDENTIFIER ::=
1524-
{ iso(1) identified-organization(3) dod(6) internet(1)
1525-
security(5) mechanisms(5) pkix(7) kp(3) }
1526-
1527-
-- OAuth Extended Key Usage
1528-
1529-
id-kp-oauthStatusSigning OBJECT IDENTIFIER ::= { id-kp TBD }
1530-
1531-
END
1532-
1533-
<CODE ENDS>
1534-
~~~
1535-
1536-
--- back
1537-
15381503
# Acknowledgments
1539-
{:numbered="false"}
15401504

15411505
We would like to thank
15421506
Andrii Deinega,
@@ -1565,13 +1529,43 @@ Torsten Lodderstedt
15651529

15661530
for their valuable contributions, discussions and feedback to this specification.
15671531

1532+
--- back
1533+
1534+
# ASN.1 Module {#asn1-module}
1535+
1536+
The following module adheres to ASN.1 specifications {{X.680}} and {{X.690}}.
1537+
1538+
~~~
1539+
<CODE BEGINS>
1540+
1541+
OauthStatusSigning-EKU
1542+
{ iso(1) identified-organization(3) dod(6) internet(1)
1543+
security(5) mechanisms(5) pkix(7) id-mod(0)
1544+
id-mod-oauth-status-signing-eku (TBD) }
1545+
1546+
DEFINITIONS IMPLICIT TAGS ::=
1547+
BEGIN
1548+
1549+
-- OID Arc
1550+
1551+
id-kp OBJECT IDENTIFIER ::=
1552+
{ iso(1) identified-organization(3) dod(6) internet(1)
1553+
security(5) mechanisms(5) pkix(7) kp(3) }
1554+
1555+
-- OAuth Extended Key Usage
1556+
1557+
id-kp-oauthStatusSigning OBJECT IDENTIFIER ::= { id-kp TBD }
1558+
1559+
END
1560+
1561+
<CODE ENDS>
1562+
~~~
1563+
15681564
# Size comparison {#size-comparison}
1569-
{:unnumbered}
15701565

15711566
The following tables show a size comparison for a Status List (compressed byte array as defined in [](#status-list-byte-array) and a compressed Byte Array of UUIDs (as an approximation for a Certificate Revocation List). Readers must be aware that these are not sizes for complete Status List Tokens in JSON/CBOR nor Certificate Revocation Lists (CRLs), as they don't contain metadata, certificates and signatures.
15721567

15731568
## Status List size for varying sizes and revocation rates
1574-
{:unnumbered}
15751569

15761570
| Size | 0.01% | 0.1% | 1% | 2% | 5% | 10% | 25% | 50% | 75% | 100% |
15771571
| 100k | 81 B | 252 B | 1.4 KB | 2.3 KB | 4.5 KB | 6.9 KB | 10.2 KB | 12.2 KB | 10.2 KB | 35 B |
@@ -1581,7 +1575,6 @@ The following tables show a size comparison for a Status List (compressed byte a
15811575
{: title="Status List Size examples for varying sizes and revocation rates"}
15821576

15831577
## Compressed array of UUIDv4 (128 bit UUIDs) for varying sizes and revocation rates
1584-
{:unnumbered}
15851578

15861579
This is a simple approximation of a Certificate Revocation List using an array of UUIDs without any additional metadata (128 bit UUID per revoked entry).
15871580

@@ -1593,14 +1586,12 @@ This is a simple approximation of a Certificate Revocation List using an array o
15931586
{: title="Size examples for 128 bit UUIDs for varying sizes and revocation rates"}
15941587

15951588
# Test vectors for Status List encoding {#test-vectors}
1596-
{:unnumbered}
15971589

15981590
All examples here are given in the form of JSON or CBOR payloads. The examples are encoded according to [](#status-list-json) for JSON and [](#status-list-cbor) for CBOR. The CBOR examples are displayed as hex values.
15991591

16001592
All values that are not mentioned for the examples below can be assumed to be 0 (VALID). All examples are initialized with a size of 2^20 entries.
16011593

16021594
## 1 bit Status List
1603-
{:unnumbered}
16041595

16051596
The following example uses a 1 bit Status List (2 possible values):
16061597

@@ -1631,7 +1622,6 @@ CBOR encoding:
16311622
~~~~~~~~~~
16321623

16331624
## 2 bit Status List
1634-
{:unnumbered}
16351625

16361626
The following example uses a 2 bit Status List (4 possible values):
16371627

@@ -1662,7 +1652,6 @@ CBOR encoding:
16621652
~~~~~~~~~~
16631653

16641654
## 4 bit Status List
1665-
{:unnumbered}
16661655

16671656
The following example uses a 4 bit Status List (16 possible values):
16681657

@@ -1697,7 +1686,6 @@ CBOR encoding:
16971686
~~~~~~~~~~
16981687

16991688
## 8 bit Status List
1700-
{:unnumbered}
17011689

17021690
The following example uses a 8 bit Status List (256 possible values):
17031691

@@ -1985,6 +1973,10 @@ CBOR encoding:
19851973
* slightly restructure/clarify referenced token cose section
19861974
* Add ASN.1 module
19871975
* many nits and improvements from genart review
1976+
* remove cose_sign1 tag from statuslist in cwt form examples
1977+
* slightly restructure/clarify referenced token cose section
1978+
* Add ASN.1 module
1979+
* removed DL suspension example
19881980

19891981
-13
19901982

src/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
git+https://github.com/wbond/oscrypto.git@1547f535001ba568b239b8797465536759c742a3
33
# Normal dependencies
44
jwcrypto==1.5.6
5-
cbor2==5.6.2
6-
cwt==2.7.4
5+
cbor2==5.7.1
6+
cwt==3.2.0
77
py_markdown_table==1.3.0

src/status_token.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import json
2-
from datetime import datetime, timedelta
2+
from datetime import UTC, datetime, timedelta
33
from typing import Dict
44

5-
from cbor2 import dumps
5+
from cbor2 import CBORTag, dumps
66
from cwt import COSE, COSEHeaders, COSEKey, CWTClaims
77
from jwcrypto import jwk, jwt
88

@@ -77,7 +77,7 @@ def get(self, pos: int) -> int:
7777

7878
def buildJWT(
7979
self,
80-
iat: datetime = datetime.utcnow(),
80+
iat: datetime = datetime.now(UTC),
8181
exp: datetime | None = None,
8282
ttl: timedelta | None = None,
8383
optional_claims: Dict | None = None,
@@ -115,7 +115,7 @@ def buildJWT(
115115

116116
def buildCWT(
117117
self,
118-
iat: datetime = datetime.utcnow(),
118+
iat: datetime = datetime.now(UTC),
119119
exp: datetime | None = None,
120120
ttl: timedelta | None = None,
121121
optional_claims: Dict | None = None,
@@ -158,10 +158,12 @@ def buildCWT(
158158
# The sender side:
159159
sender = COSE.new()
160160
encoded = sender.encode(
161-
dumps(claims),
162-
key,
161+
payload=dumps(claims),
162+
key=key,
163163
protected=protected_header,
164164
unprotected=unprotected_header,
165165
)
166166

167+
# removes cose_sign1 tag (only 1 byte long for tag 18)
168+
encoded = encoded[1:]
167169
return encoded

0 commit comments

Comments
 (0)