Skip to content

Commit 30eb5ea

Browse files
authored
Merge pull request #547 from gstarovo/delegated-credentials
delegated credentials
2 parents 6805bcb + 74853f8 commit 30eb5ea

20 files changed

+1277
-257
lines changed

README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Implemented TLS features include:
7272
* (experimental) TACK extension
7373
* heartbeat extension and protocol
7474
* Record Size Limit extension
75+
* Delegated Credential for TLS
7576

7677
2 Licenses/Acknowledgements
7778
============================
@@ -579,7 +580,46 @@ as said above, asyncore is deprecated in Python 3.12, and asyncio should be used
579580
Implementation is similar to TLSAsyncDispatcherMixIn.py, but instead, use the class
580581
TLSAsyncioDispatcherMixIn.py.
581582
582-
11 History
583+
11 Using the ```credential``` tool
584+
=================================
585+
586+
The credential tool is a command-line utility used to generate a [Delegated Credential](https://datatracker.ietf.org/doc/rfc9345/) for a TLS 1.3 server.
587+
588+
To generate the Delegated Credential:
589+
590+
```
591+
tls.py credential [-c CERT] [-k KEY] [--dc-pub KEY] [--dc-sig-scheme SIG] [--dc-file DCFILE]
592+
```
593+
594+
To generate the DC the following MUST be provided: the certificate, the certificate's private key, the public key of the Delegated Credential and the output file. Providing signature scheme is optional.
595+
596+
The content is saved into the output file in ```.pem``` format.
597+
598+
The following command provides an illustrative example using RSA keys for both the main server certificate and the delegated credential's public key to create Delegated Credential. Go to the tests directory and run:
599+
600+
```
601+
tls.py credential -k serverX509Key.pem -c serverX509Cert.pem --dc-pub serverDelCredRSAPSSPub.pem --dc-file serverRSAPSSDC.pem
602+
```
603+
604+
After that the server can be run without the certificate's private key, but with the Delegated Credential:
605+
```
606+
tls.py server -c serverX509Cert.pem --dc-key serverDelCredRSAPSSKey.pem --dc-file serverRSAPSSDC.pem localhost:4433
607+
```
608+
609+
The client must indicate the support of Delegated Credential by provideng the signature algorithm it supports in the Delegated Credential's extesion in Client Hello.
610+
611+
In case creating the file with saved Delegated Credential is not an option, the server can create the Delegated Credential on the fly before the handshake.
612+
To do so, run:
613+
```
614+
tls.py server -k serverX509Key.pem -c serverX509Cert.pem --dc-key serverDelCredRSAPSSKey.pem --dc-pub serverDelCredRSAPSSPub.pem localhost:4433
615+
```
616+
### Important Note
617+
618+
According to RFC 5280, [Section 4.2.1.3](https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.3) and specifically [RFC 9260](https://datatracker.ietf.org/doc/rfc9345/) (Delegated Credentials), Section 4, the X.509 certificate used by the server to sign a delegated credential MUST contain the ```digitalSignature``` Key Usage extension. The ```credential``` tool and the delegated credential generation feature within the ```server``` tool are designed primarily for **testing and development purposes**. Hence, these tools do not perform strict validation to ensure that the provided main server certificate actually possesses the ```digitalSignature``` Key Usage extension.
619+
Similarly, while delegated credentials have a valid time option, it is not enforced. The current certificate implementation lacks time validation, a requirement that is also omitted for delegated credentials.
620+
621+
622+
12 History
583623
===========
584624
585625
0.8.2 - 2025-01-22

0 commit comments

Comments
 (0)