44 Commits
Author SHA1 Message Date
woggioni a101182fdd Allow dedicated Redis for OCSP publication 2026-10-31 20:26:37 +00:00
woggioni ef64c4a532 Serialize OCSP Redis snapshots with CBOR 2026-10-28 20:54:19 +00:00
woggioni df98ada177 Publish OCSP snapshots through Redis 2026-10-28 20:27:07 +00:00
woggioni a7cfda4167 Use S3 object expiry for OCSP snapshots 2026-10-28 19:39:51 +00:00
woggioni 9da68a9625 Add production support for SQLite
CI / Build and push docker image (push) Successful in 3m9s
CI / Build and push OCSP image (push) Successful in 33s
release/0.0.1
2026-10-28 01:23:28 +00:00
woggioni 3918a2ac71 Filter certificate key selection to unused keys 2026-10-27 23:34:25 +00:00
woggioni 356e3beccd Use aioboto3 for asynchronous OCSP S3 uploads 2026-10-27 22:23:33 +00:00
woggioni 0301cbff6f Batch certificate summary lookups
CI / Build and push docker image (push) Successful in 3m14s
CI / Build and push OCSP image (push) Successful in 40s
2026-10-27 14:09:00 +00:00
Walter Oggioni a2457ab1f4 Move certificate transforms into header dropdown
CI / Build and push docker image (push) Successful in 1m56s
CI / Build and push OCSP image (push) Successful in 33s
2026-10-27 07:39:13 +08:00
Walter Oggioni 917e0c1d7c Move certificate export and revoke actions into header 2026-10-27 07:39:00 +08:00
Walter Oggioni 73e6a11463 Remove bulk actions from certificate list 2026-10-27 00:14:32 +08:00
Walter Oggioni 555f3f28f7 Combine AIA fields into XCA-style editor
CI / Build and push docker image (push) Successful in 1m43s
CI / Build and push OCSP image (push) Successful in 33s
2026-10-26 23:55:50 +08:00
woggioni cc05d450a2 Fix multi-certificate PEM chain imports 2026-10-26 14:21:10 +00:00
woggioni 0b21910e2b Reduce WASM bundle size 2026-10-26 14:19:19 +00:00
woggioni c8b4e211a0 Fix issuer links for PEM certificate chain imports 2026-10-26 13:35:28 +00:00
woggioni 7523c0b8c4 Make public key extraction idempotent 2026-10-26 10:55:24 +00:00
woggioni c1d8711cb4 Fix certificate list links to detail route 2026-10-26 05:17:51 +00:00
woggioni 1a7b4a10e8 Add full XCA curve and digest parity
CI / Build and push docker image (push) Successful in 37s
CI / Build and push OCSP image (push) Successful in 38s
2026-10-26 12:06:17 +08:00
woggioni e83dc42d3d Add structured subject attribute editor 2026-10-26 12:06:17 +08:00
woggioni f9e8915b77 Add advanced extension list editors 2026-10-26 12:06:17 +08:00
woggioni c8031f5876 Add XCA-style SAN editor 2026-10-26 12:06:17 +08:00
woggioni dd6d20e3a3 Fix hexadecimal master key decoding 2026-10-26 12:06:17 +08:00
woggioni 4adf7c4882 kca-core: fix CSR attribute DER encoding and conformant decoding
- Generated attributes are now explicitly tagged as UTF8String via
  CertificateSigningRequestBuilder.add_attribute(_tag=_ASN1Type.UTF8String),
  so values include proper DER TLV instead of raw bytes.
- The attribute decoder first attempts DER string parsing (UTF8String, PrintableString,
  IA5String, BMPString, long-form lengths), falling back to legacy raw UTF-8 decode for
  previously generated nonconformant CSRs.
- Regression tests verify DER encoding, Unicode round-tripping, supported string types,
  long values (>127 bytes), and legacy raw UTF-8 attributes.
- Mypy passes cleanly (no issues in 42 source files).
2026-10-26 12:06:17 +08:00
woggioni c263f967dc Fix: chain exports use certificate equality instead of object identity
The chain export formatters in kca-core used  identity checks
(e.g. , ) to determine whether to
exclude the leaf certificate from the chain. This caused duplicates
when the chain was built from separately-parsed certificate objects
that were cryptographically identical (same DER/fingerprint) but
different Python instances.

Changed  →  for value equality across all affected formats:
  - _pem_chain()        : PEM chain export
  - PKCS#7 chain        : serialization_certificates
  - PKCS#12 chain       : serialize_key_and_certificates
  - OpenVPN             : issuer detection
  - JWK chain           : x5c certificate list

Also added a regression test (test_chain_exports_exclude_equivalent_leaf)
that reproduces the exact issue: a leaf certificate re-parsed from its
DER form is treated as a distinct object, so the old -based checks
kept both copies in the output. The new -based checks correctly
deduplicate, retain the issuer, and handle OpenVPN's CA selection.
2026-10-26 12:06:16 +08:00
woggioni 82d448d8d4 Fix expired self-signed cert validation: remove bypass, enable X509_STRICT|POLICY_CHECK, extract numeric error codes from pyOpenSSL 2026-10-26 12:06:16 +08:00
woggioni 987fdc0e12 Fix SSH private-key import/export for Paramiko 5.1.0 and remove unconditional DSSKey reference
- Replace paramiko-based OpenSSH private key serialization with
  cryptography's PrivateFormat.OpenSSH backend.
  The old code relied on paramiko.RSAKey, paramiko.DSSKey, etc. to write
  private keys, but Paramiko 5.1.0 removed DSSKey entirely and changed
  constructor APIs, causing crashes.

- Add explicit fallback path in _load_ssh_private_with_paramiko that
  guards against missing DSSKey (getattr paramiko 'DSSKey', append only
  when present), modern private_key attribute vs legacy signing_key,
  and Ed25519 PyNaCl key material conversion.

- Add two new test coverage methods:
  test_ssh_private_roundtrip  – round-trip RSA/DSA/EC/Ed25519
    unencrypted and password-encrypted, verifying OpenSSH PEM header
    and DER preservation.
  test_ssh_private_paramiko_fallback – explicitly exercise the
    Paramiko fallback for RSA and EC keys, confirming it still works
    under locked Paramiko 5.1.0.

Also clean up the comment in load_key_bytes to reflect the new fallback
behavior rather than the old 'encrypted OpenSSH keys not supported' note.
2026-10-26 12:06:16 +08:00
woggioni bd352051e0 Typed but unhandled extensions preserve DER via public_bytes() 2026-10-26 12:06:16 +08:00
woggioni 1032b10c49 Fix EC JWK: fixed-width x, y, d encoding; restrict to registered curve names
- Encode EC coordinates and private d with curve-width (32/48/66 bytes) to satisfy RFC 7518,
  preserving leading zero octets.
- Restrict JWK  values to registered JOSE names: P-256, P-384, P-521, secp256k1.
  Raise ValueError for unregistered curves (P-192, P-224, Brainpool).
- Add regression tests: deterministic coordinate/private-value widths, leading-zero
  preservation, supported curve names, and rejection of unsupported curves.
- Mypy clean; all core and backend tests pass.
2026-10-26 12:06:16 +08:00
woggioni aee1025015 Fix stale OCSP snapshots indefinitely
- Parse and validate  from snapshot JSON, reject future/missing timestamps
- Enforce snapshot age vs  in cache and stale fallback (no lifetime extension on repeat S3 reads)
- OCSP: , ,
- Remove unused  from signer
- Publisher heartbeats: , republish clean snapshots past interval, preserve dirty-only behavior and concurrency
- Config/env/docker/docs updates for heartbeat

Rolling upgrade: enable publisher heartbeats before deploying the age-enforcing responder so existing snapshots remain within the age window.
2026-10-26 12:06:15 +08:00
woggioni b59b935d1b Fix quadratic ReDoS in PEM import block scanning
Replace the backtracking _PEM_BLOCK regex with a forward-only scanner
that indexes END markers by label, so repeated unterminated headers do
not cause the regex to rescan the remaining input.

Impact: 80 KiB payload went from 8.34 s to 0.001 s.
2026-10-26 12:06:15 +08:00
woggioni 718d11b4c0 Offload certificate key generation to worker threads 2026-10-25 21:26:34 +00:00
woggioni 4c1bfa4e4d Reject duplicate serials and make keep_serial renewal safe
Add shared serial collision checking against existing certificates and
issuer revocations, reuse it for automatic serial allocation, and enforce
it for user-supplied serials so duplicate serials no longer break the
OCSP snapshot.

make keep_serial renewal require replace_old, refuse keep_serial +
revoke_old, and reject serials already revoked by the issuer so revoked
serials cannot be inherited by renewed certificates.
2026-10-25 21:23:34 +00:00
woggioni a8d322776d Enforce CSR proof of possession during certificate issuance 2026-10-25 21:21:16 +00:00
woggioni cc7059c100 Fix OCSP snapshots for orphaned revocations 2026-10-25 13:21:23 +00:00
woggioni 404facf8e2 Fix OCSP publication races for revocation changes 2026-10-25 11:19:17 +00:00
woggioni 44a79f5b0c Key OIDC identity by issuer and subject 2026-10-25 08:35:11 +00:00
woggioni dab4b9e0bb Fix cross-vault OCSP snapshot poisoning 2026-10-24 22:03:02 +00:00
woggioni 69d78939a1 Build static musl OCSP image in Gitea Actions
CI / Build and push docker image (push) Successful in 3m23s
CI / Build and push OCSP image (push) Successful in 7m53s
2026-10-23 10:00:36 +00:00
woggioni 0384995570 Add S3 OCSP status publishing and standalone Rust Axum responder 2026-10-23 09:18:00 +00:00
woggioni 4ed14b42a7 Add optional OpenTelemetry traces, metrics and OTLP logs 2026-10-23 06:09:43 +00:00
woggioni 57c810ea65 Polish PWA assets, accessible tabs and bulk selection, harden bulk revoke tests 2026-10-23 05:44:32 +00:00
woggioni 763268bd40 Add server template apply modes, bulk revocation, explicit DN order and detail tabs 2026-10-23 05:33:43 +00:00
woggioni 5eb7866f5b Close XCA parity gaps: advanced extensions, CA/revocation UI, imports, ZIP export, E2E 2026-10-23 04:26:35 +00:00
woggioni 4f3a632f4b Implement KCA: web reimplementation of XCA PKI workflows
- kaya backend with OIDC sessions, API tokens, Postgres/Tortoise models
- AES-256-GCM private key storage and full certificate/CSR/CRL domain logic
- Sycamore/WASM SPA for vaults, keys, requests, certificates, CRLs and templates
- imports/exports, XCA .xdb migration, Docker Compose stack and tests
2026-10-23 02:06:55 +00:00