Skip to content

Recipient-aware enveloping + full post-quantum SCEP#6

Merged
pdb0102 merged 13 commits into
mainfrom
feature/scep-recipient-aware
Jun 20, 2026
Merged

Recipient-aware enveloping + full post-quantum SCEP#6
pdb0102 merged 13 commits into
mainfrom
feature/scep-recipient-aware

Conversation

@pdb0102

@pdb0102 pdb0102 commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Makes the SCEP client choose the EnvelopedData recipient correctly from the GetCACert bundle, branch the RecipientInfo by the recipient's algorithm, and surface cert-usage conformance findings — then takes it all the way to post-quantum (signing and key establishment), verified against OpenSSL.

Recipient-aware core

  • RecipientSelector: picks signing vs. encryption cert by KeyUsage (RFC 8894 leaves this undefined), with a positional fallback; emits findings (signature-only CA → can't envelope; encryption key missing its KeyUsage bit; keyUsage/position mismatch).
  • BcEnvelope branches enveloping by recipient algorithm — RSA KeyTransRecipientInfo, EC ephemeral-ECDH KeyAgreeRecipientInfo, ML-KEM KEMRecipientInfo. Contract (IScepCrypto) unchanged.

Post-quantum (BouncyCastle 2.5.0 → 2.6.1)

  • PQ CA signing (ML-DSA, SLH-DSA) of CertRep responses via the SignerInfoGeneratorBuilder path.
  • PQ key establishment: hand-rolled RFC 9629 KEMRecipientInfo (HKDF-SHA256 + AES-KeyWrap, CBC + GCM) — decrypted by OpenSSL 3.6.2 in an interop test.
  • PQ certificate enrollment: enroll an ML-DSA/SLH-DSA subject key (issued cert carries the PQ key) over a transient RSA transport, because RFC 8894 encrypts the response to the requester's signing key and no PQ algorithm both signs and decapsulates. A pure-PQ-signed request can be emitted as a conformance probe.

Ready-to-use fake server: /scep/ endpoints (rsa, rsa-split, ec-encrypt, ec-dual, ecdsa-rsa, mldsa-rsa, slhdsa-rsa, mlkem-encrypt, mldsa-mlkem, mldsa-only, signing-only) — drive a real SCEP client or scripted tests against any recipient/signing combination.

pdb0102 added 13 commits June 20, 2026 16:01
…ipient algorithm (RSA; EC/ML-KEM unsupported -> clean error)
…encryption cert by KeyUsage; finding when none)
…ng); fix DerSequence ambiguity + DigestAlgOid deprecation
… 2.6.1); mldsa-rsa round-trip + mldsa-only finding profiles
…olled CBC+GCM) + SLH-DSA CA; full PQ profile matrix round-trips
…null-guard EncryptedContent, assert EnvelopedData version 3; verified by OpenSSL 3.6.2 interop decrypt
…ssues PQ certs); PQ outer signing (BcSelfSigned/BcPkiMessage builder path) + pure-PQ conformance probe
@pdb0102
pdb0102 merged commit c4e1180 into main Jun 20, 2026
1 check passed
@pdb0102
pdb0102 deleted the feature/scep-recipient-aware branch June 20, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant