Skip to content

Commit e90928b

Browse files
authored
Merge pull request #25 from siemens/guilianoupdatedoc
Guiliano's doc update
2 parents fe968ff + 18f8563 commit e90928b

35 files changed

+3531
-356
lines changed

MISSING_SUPPORT_TEMPLATE.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!--
2+
SPDX-FileCopyrightText: Copyright 2024 Siemens AG
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
-->
6+
7+
# Missing Support Issue Template (Example: HSS Signatures)
8+
9+
The CMP test suite currently lacks support for Hierarchical Signature System (HSS) signatures as defined in RFC 8554 and RFC 9858.
10+
This includes the ability to parse, validate, and generate HSS signatures and keys. Adding this support is essential for testing
11+
CMP implementations that utilize HSS for post-quantum security.
12+
13+
## Motivation and Context
14+
15+
- HSS is a widely recognized stateful hash-based signature scheme, offering strong security guarantees.
16+
- CMP implementations may adopt HSS for enhanced security, necessitating comprehensive test coverage.
17+
- Supporting HSS aligns with our goal of providing robust post-quantum cryptographic testing capabilities.
18+
19+
## Desired Support
20+
- Accept, generate, and validate HSS signatures using the parameter sets from RFC 8554, RFC 9858 and NIST SP 800-208.
21+
- Track the HSS hierarchy depth correctly, enforcing `height < 9` and other constraints defined in NIST SP 800-208.
22+
23+
## Required Work Items
24+
25+
1. Extend parsing/validation logic to recognise HSS signature structures and keys.
26+
2. Add regression fixtures (minimal + verbose) covering:
27+
- Valid signatures across permissible parameter sets.
28+
- Rejection cases for height ≥ 9, malformed hierarchies, and truncated signatures.
29+
- Mirror existing XMSS test cases where applicable.
30+
- Add basic test cases for a slow HSS variant for shake and SHA2 inside [pq_stateful_sig_tests.robot](tests_pq_and_hybrid/pq_stateful_sig_tests.robot).
31+
3. Create verbose tests for all supported HSS combinations with the `scripts/generate_pq_stfl_test_cases.py` script and add it manually.
32+
inside [pq_stateful_sig_alg.robot](tests_pq_and_hybrid/pq_stateful_sig_alg.robot).
33+
4. Update documentation to reflect HSS support.
34+
35+
## Test Coverage
36+
37+
- Update ALGORITHM_TEST_COVERAGE.md to include HSS scenarios.
38+
39+
## Out of Scope/ Should be added later
40+
41+
(if applicable)
42+
43+
## Open Questions / Follow-ups
44+
45+
(if applicable)
46+
47+
## References
48+
- RFC 8554 — Leighton-Micali Hash-Based Signatures.
49+
- RFC 9802 — Use of the HSS and XMSS Hash-Based Signature Algorithms in Internet X.509 PKI.
50+
- RFC 9858 — Additional Parameter Sets for HSS/LMS Hash-Based Signatures.
51+
- NIST SP 800-208 — Recommendation for Stateful Hash-Based Signature Schemes.

MockCA_readme.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
<!--
2+
SPDX-FileCopyrightText: Copyright 2025 Siemens AG
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
-->
6+
7+
# Mock CA
8+
9+
> **Note:** *This mock CA is a simple tool to generate certificates for testing purposes. It is not a real CA and does not provide sufficient validation.*
10+
11+
## Overview
12+
13+
Mock CA is a simulated certificate authority designed for testing and
14+
research purposes, particularly focusing on post-quantum (PQ) cryptography and hybrid certificate
15+
issuance. The project enables the issuance, management, and revocation of certificates using a
16+
combination of traditional and PQ cryptographic mechanisms.
17+
18+
## About the Mock CA
19+
20+
- The Mock-CA is currently only supported in
21+
the LwCMP fashion (one request at a time.)
22+
- Supports the generation of certificates using various key types, including traditional and post-quantum keys and
23+
hybrid keys and mechanisms.
24+
25+
### Missing Features
26+
27+
- Does not support **CRS** attributes, beside the one for extensions.
28+
- Does only support **CA** `ccp` Cross-Certification Response.
29+
- Does not support Announcement messages yet (python logic is present).
30+
- Does not support `krr` (key recovery request) messages and
31+
`krp` (key recovery response) messages (requires new state!)
32+
33+
### Features
34+
35+
- **General Message Handling:** Supports CMP (Certificate Management Protocol) messages with functionalities like key updates, revocation passphrases, and encryption key pair type queries.
36+
- **Certificate Request Processing:** Handles various certificate request types, including:
37+
- `ir` (initial registration)
38+
- `cr` (certificate request)
39+
- `p10cr` (PKCS#10 certificate request)
40+
- `kur` (key update request)
41+
- `ccr` (cross-certification request)
42+
- **Challenge-Response Mechanism:** Implements a challenge-response system for authentication before issuing certificates,
43+
both the encrypted `Rand` and the encrypted certificate.
44+
- **Hybrid Key and Certificate Support:** Enables the use of traditional, post-quantum, and hybrid key mechanisms such as:
45+
- ECDH (Elliptic Curve Diffie-Hellman)
46+
- X25519/X448 key exchange
47+
- Hybrid KEMs (Key Encapsulation Mechanisms)
48+
- **Nested and Batch Processing:** Supports nested PKI messages and batch processing
49+
for multiple certificate requests (`ir`, `cr`, `p10cr`, `kur`, `ccr`).
50+
- **Certificate Revocation Handling:** Manages certificate revocation lists (CRLs) and supports passphrase-based revocation.
51+
- **Added Protection Requests:** Implements LwCMP (Lightweight CMP) protection mechanisms, including password-based MAC and hybrid protection.
52+
53+
## Endpoints
54+
55+
The Mock CA exposes several HTTP endpoints. Unless noted otherwise, all POST
56+
routes expect a DER-encoded CMP `PKIMessage` in the request body and return the
57+
response as a DER-encoded `PKIMessage`.
58+
59+
The server listens on `127.0.0.1:5000` by default and exposes the following routes:
60+
61+
- **`/issuing`** (`POST`)
62+
– Handle standard CMP requests and return a `PKIMessage` with the issued certificate or an error.
63+
- **`/chameleon`** (`POST`)
64+
– Processes requests for chameleon certificates.
65+
- **`/sun-hybrid`** (`POST`)
66+
– Issues Sun‑Hybrid certificates using PQ and traditional keys.
67+
- **`/multi-auth`** (`POST`)
68+
– Validate hybrid-protected requests using multiple certificates.
69+
- **`/cert-discovery`** (`POST`)
70+
– Issues a certificate which includes the `url` of the secondary certificate.
71+
- **`/related-cert`** (`POST`)
72+
– Issues a certificate related to an existing one.
73+
- **`/catalyst-sig`** (`POST`)
74+
– Issues a certificate signed with a `Catalyst` alternative signature.
75+
- **`/catalyst-issuing`** (`POST`)
76+
– Issues a certificate from a catalyst request with an alternative Proof-of-Possession (PoP) signature.
77+
- **`/ocsp`** (`POST`)
78+
– Takes an OCSP request and returns the corresponding OCSP response.
79+
- **`/crl`** (`GET`)
80+
– Returns the current certificate revocation list.
81+
- **`/cert/<serial_number>`** (`GET`)
82+
– Retrieves the certificate with the specified serial number.
83+
- **`/pubkey/<serial_number>`** (`GET`)
84+
– Returns the public key for the given certificate.
85+
- **`/sig/<serial_number>`** (`GET`)
86+
– Returns the alternative signature for the specified Sun‑Hybrid certificate.
87+
88+
## Debug Error handler:
89+
90+
1. If the Exchange PKIMessage
91+
The `Exchange PKIMessage` keyword contains the error message is set there.
92+
Otherwise, the error message is set in the `PKIMessage` itself, it is advised to use the
93+
`PKIStatus Must Be` keyword to see the logged PKIStatusInfo, in human-readable format.
94+
95+
2. The Mock-CA runs in the `Debug` mode. But there are better not yet
96+
implemented methods, which are better for logging or debugging.
97+
98+
3. Some tests require a state and will fail, the second time, the tests are executed.
99+
100+
## Getting Started
101+
102+
To start using the Mock CA, ensure you have the necessary dependencies installed (e.g., Python version, OpenSSL, etc.).
103+
Then follow the instructions in the [Start the CA](#start-the-ca) section below.
104+
105+
- The requirements are the same as for the CMP test cases.
106+
107+
## Example Usage
108+
109+
Examples are defined inside the [client.py](mock_ca/client.py) file.
110+
If Python is not to be used, the OpenSSL command can be used instead:
111+
112+
```sh
113+
OUTDIR="data/openssl_out"
114+
mkdir -p "$OUTDIR"
115+
116+
# Generate key and CSR
117+
openssl genpkey -algorithm RSA -out "$OUTDIR/new-private-key-rsa.pem" -pkeyopt rsa_keygen_bits:2048
118+
openssl req -new -key "$OUTDIR/new-private-key-rsa.pem" -subj "/CN=Hans the Tester" -out "$OUTDIR/csr-rsa.pem"
119+
120+
# Send IR request with OpenSSL CMP; write outputs into $OUTDIR
121+
openssl cmp -cmd ir \
122+
-server http://localhost:5000/issuing \
123+
-recipient "/CN=Hans the Tester" \
124+
-ref "CN=Hans the Tester" \
125+
-subject "/CN=Hans the Tester" \
126+
-csr "$OUTDIR/csr-rsa.pem" \
127+
-secret pass:SiemensIT \
128+
-popo 1 \
129+
-certout "$OUTDIR/result-cert.pem" \
130+
-newkey "$OUTDIR/new-private-key-rsa.pem" \
131+
-reqout "$OUTDIR/req-ir.pkimessage" \
132+
-unprotected_errors
133+
```
134+
135+
136+
### Start the CA
137+
138+
To start the CA, run the following command:
139+
140+
```sh
141+
make start-mock-ca
142+
```
143+
144+
Alternative python command:
145+
146+
```sh
147+
python3 mock_ca/ca_handler.py
148+
```
149+
150+
To test the CMP test cases, run the following command
151+
in a second shell:
152+
153+
```sh
154+
make mock-ca-tests
155+
```

REFERENCES.md

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# References
2+
3+
<!--
4+
SPDX-FileCopyrightText: Copyright 2025 Siemens AG
5+
6+
SPDX-License-Identifier: Apache-2.0
7+
-->
8+
9+
This section lists external specifications and internal documents that may be helpful
10+
when working with the Mock CA.
11+
12+
## Table of Contents
13+
14+
- [References](#references)
15+
- [Project Documentation](#project-documentation)
16+
- [Standards](#standards)
17+
- [Transport CMP](#transport-cmp)
18+
- [Algorithm Profiles](#algorithm-profiles)
19+
- [Drafts](#drafts)
20+
- [Software](#software)
21+
- [Post-Quantum Key Encapsulation Mechanism (KEM)](#post-quantum-key-encapsulation-mechanism-kem)
22+
- [ML-KEM](#ml-kem)
23+
- [Related RFCs and Drafts](#related-rfcs-and-drafts)
24+
- [Post-Quantum Signature](#post-quantum-signature)
25+
- [ML-DSA](#ml-dsa)
26+
- [Related RFCs and Drafts](#related-rfcs-and-drafts-1)
27+
- [SLH-DSA](#slh-dsa)
28+
- [Related RFCs and Drafts](#related-rfcs-and-drafts-2)
29+
- [PQ Stateful Signature](#pq-stateful-signature)
30+
- [XMSS / XMSSMT](#xmss--xmssmt)
31+
- [HSS](#hss)
32+
- [Hybrid Key Encapsulation Mechanism (KEM)](#hybrid-key-encapsulation-mechanism-kem)
33+
- [Hybrid Signature](#hybrid-signature)
34+
- [Hybrid Certificates](#hybrid-certificates)
35+
36+
---
37+
38+
## Project Documentation
39+
40+
- [Server Test Coverage](./SERVER_TEST_COVERAGE.md)
41+
- [CMP Test Suite README](./readme.md)
42+
- [Post‑Quantum Integration Details](./about_pq.md)
43+
- [Test Suite Architecture](./about_suite.md)
44+
- [CMP Issues and Proposals](./cmp_issues_and_proposals.md)
45+
- [Mock CA README](./MockCA_readme.md)
46+
47+
## Standards
48+
49+
- [RFC 4210 — Certificate Management Protocol (CMP)](https://datatracker.ietf.org/doc/rfc4210/)
50+
- [RFC 9480 — Certificate Management Protocol (CMP) Updates](https://datatracker.ietf.org/doc/rfc9480/)
51+
- [RFC 9483 — Lightweight Certificate Management Protocol (CMP)](https://datatracker.ietf.org/doc/rfc9483/)
52+
- [RFC 5280 — Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile](https://datatracker.ietf.org/doc/rfc5280/)
53+
54+
### Transport CMP
55+
56+
- [RFC 6712 — CMP over HTTP](https://datatracker.ietf.org/doc/rfc6712/)
57+
- [RFC 9482 — CMP over CoAP](https://datatracker.ietf.org/doc/rfc9482/)
58+
59+
### Algorithm Profiles
60+
61+
- [RFC 9481 — CMP Algorithms](https://datatracker.ietf.org/doc/rfc9481/)
62+
63+
### Drafts
64+
65+
- [draft-ietf-lamps-rfc4210bis (CMP)](https://datatracker.ietf.org/doc/draft-ietf-lamps-rfc4210bis/)
66+
67+
## Software
68+
69+
- [OpenSSL](https://www.openssl.org/docs/) — command-line tools used for CSR generation and CMP messages
70+
- [liboqs](https://github.com/open-quantum-safe/liboqs) — post-quantum cryptography library enabling PQ algorithms
71+
72+
## Post-Quantum Key Encapsulation Mechanism (KEM)
73+
74+
### ML-KEM
75+
76+
- [FIPS 203 — Module-Lattice-based Key-Encapsulation Mechanism (ML-KEM)](https://doi.org/10.6028/NIST.FIPS.203)
77+
78+
#### Related RFCs and Drafts
79+
80+
- [draft-ietf-lamps-kyber-certificates](https://datatracker.ietf.org/doc/draft-ietf-lamps-kyber-certificates/) — X.509 certificate profile for ML‑KEM
81+
- [draft-ietf-lamps-cms-kyber](https://datatracker.ietf.org/doc/draft-ietf-lamps-cms-kyber/) — Using ML‑KEM in CMS
82+
83+
## Post-Quantum Signature
84+
85+
### ML-DSA
86+
87+
- [FIPS 204 — Module-Lattice-based Digital Signature Algorithm (ML‑DSA)](https://doi.org/10.6028/NIST.FIPS.204)
88+
89+
#### Related RFCs and Drafts
90+
91+
- [draft-ietf-lamps-dilithium-certificates](https://datatracker.ietf.org/doc/draft-ietf-lamps-dilithium-certificates/) — X.509 certificate profile for ML‑DSA
92+
- [draft-ietf-lamps-cms-ml-dsa](https://datatracker.ietf.org/doc/draft-ietf-lamps-cms-ml-dsa/) — Using ML‑DSA in CMS
93+
94+
### SLH-DSA
95+
96+
- [FIPS 205 — Stateless Hash‑Based Digital Signature Algorithm (SLH‑DSA)](https://doi.org/10.6028/NIST.FIPS.205)
97+
98+
#### Related RFCs and Drafts
99+
100+
- [RFC 9814 — Use of the SLH‑DSA Signature Algorithm in CMS](https://datatracker.ietf.org/doc/rfc9814/)
101+
- X.509 certificate profile for SLH‑DSA:
102+
- [draft-ietf-lamps-sphincsplus-certificates](https://datatracker.ietf.org/doc/draft-ietf-lamps-sphincsplus-certificates/)
103+
104+
## PQ Stateful Signature
105+
106+
- NIST Special Publication:
107+
- [NIST SP 800‑208 — Recommendation for Stateful Hash‑Based Signature Schemes](https://doi.org/10.6028/NIST.SP.800-208)
108+
- Defines the use of XMSS and HSS in X.509:
109+
- [RFC 9802 — Use of the HSS and XMSS Hash‑Based Signature Algorithms in Internet X.509 Public Key Infrastructure](https://datatracker.ietf.org/doc/rfc9802/)
110+
111+
### XMSS / XMSSMT
112+
113+
- Definition of XMSS and XMSSMT:
114+
- [RFC 8391 — XMSS: eXtended Merkle Signature Scheme](https://datatracker.ietf.org/doc/rfc8391/)
115+
116+
### HSS
117+
118+
- Definition of LMS and HSS:
119+
- [RFC 8554 — Leighton–Micali Hash‑Based Signatures](https://datatracker.ietf.org/doc/rfc8554/)
120+
- Using LMS/HSS in CMS:
121+
- [RFC 9708 — Use of the HSS/LMS Hash‑Based Signature Algorithm in the Cryptographic Message Syntax (CMS)](https://datatracker.ietf.org/doc/rfc9708/)
122+
- Additional parameter sets for HSS/LMS hash‑based signatures:
123+
- [draft-fluhrer-lms-more-parm-sets](https://datatracker.ietf.org/doc/draft-fluhrer-lms-more-parm-sets/)
124+
125+
## Hybrid Key Encapsulation Mechanism (KEM)
126+
127+
- [draft-connolly-cfrg-xwing-kem](https://datatracker.ietf.org/doc/draft-connolly-cfrg-xwing-kem/)
128+
- [draft-ietf-lamps-pq-composite-kem](https://datatracker.ietf.org/doc/draft-ietf-lamps-pq-composite-kem/)
129+
- [draft-josefsson-chempat](https://datatracker.ietf.org/doc/draft-josefsson-chempat/)
130+
131+
## Hybrid Signature
132+
133+
- [draft-ietf-lamps-pq-composite-sigs](https://datatracker.ietf.org/doc/draft-ietf-lamps-pq-composite-sigs/)
134+
135+
## Hybrid Certificates
136+
137+
- [draft-sun-lamps-hybrid-scheme](https://datatracker.ietf.org/doc/draft-sun-lamps-hybrid-scheme/)
138+
- [RFC 9763 — Related Certificates for Use in Multiple Authentications within a Protocol](https://datatracker.ietf.org/doc/rfc9763/)
139+
- [draft-lamps-okubo-certdiscovery](https://datatracker.ietf.org/doc/draft-lamps-okubo-certdiscovery/)
140+
- [draft-bonnell-lamps-chameleon-certs](https://datatracker.ietf.org/doc/draft-bonnell-lamps-chameleon-certs/)
141+
- Catalyst (Alternative Signature):
142+
- [ITU‑T X.509 (10/2019) — Alternative public key and signature extensions](https://www.itu.int/ITU-T/formal-language/itu-t/x/x509/2019/CertificateExtensions.html)
143+
- Document:
144+
- [ITU‑T X.509 (10/2019)]( https://www.itu.int/ITU-T/recommendations/rec.aspx?id=14033)
145+
- Died draft:
146+
- [draft-truskovsky-lamps-pq-hybrid-x509 — Multiple Public‑Key Algorithm X.509 Certificates](https://datatracker.ietf.org/doc/draft-truskovsky-lamps-pq-hybrid-x509/)

0 commit comments

Comments
 (0)