FreeHSM C

An open-source PKCS#11 v3.2 cryptographic module under Simorgh Labs

View the Project on GitHub afchine1337/freehsm

FreeHSM C — Common Criteria EAL4+ Target of Evaluation

TOE name: FreeHSM Cryptographic Module TOE version: 1.0.0-FIPS Target EAL: EAL4 augmented with ALC_FLR.2 (Flaw remediation) and AVA_VAN.5 (Advanced vulnerability analysis) Protection Profile claim: eIDAS QSCD (EN 419211-2) or cPP for Cryptographic Modules (NIAP, when published)


1. TOE description (ASE_INT.1)

1.1 TOE type

The TOE is a software cryptographic module (“Soft HSM”) providing PKCS#11 v3.2 services to applications. It is delivered as a single shared object libfreehsm.so plus the configuration file freehsm.conf. It depends on the OpenSSL 3.x FIPS provider, which is treated as a separately-evaluated module within the same Operational Environment.

1.2 Major security features

1.3 Non-TOE hardware / firmware / software

2. Conformance claims (ASE_CCL.1)

3. Security objectives (ASE_OBJ.2)

3.1 Security objectives for the TOE

Identifier Statement
O.CRYPTO The TOE shall provide cryptographic services using only FIPS-validated primitives loaded from the OpenSSL FIPS provider.
O.AUTH The TOE shall authenticate operators (CO, USER) before granting access to private key material.
O.AUDIT The TOE shall record security-relevant events in an append-only log resistant to insertion, deletion, and modification by an attacker without the audit-MAC key.
O.SSP The TOE shall protect Sensitive Security Parameters (DEKs, private keys, PINs) from unauthorized disclosure during operation and on termination (zeroize).
O.SELFTEST The TOE shall perform power-on and conditional self-tests; on failure, the TOE shall enter an unrecoverable ERROR state.
O.ROLE_SEP The TOE shall enforce separation between CO and USER roles: only CO can re-initialize the token or unlock a USER PIN; only the role owner can change its own PIN.

3.2 Security objectives for the operational environment

Identifier Statement
OE.OS The operational OS shall provide process isolation (no ptrace from a different UID) and mlock capability.
OE.STORAGE The filesystem storing token files shall provide atomic file replacement (rename + fsync).
OE.OPENSSL The OpenSSL FIPS provider shall be installed, validated, and in approved mode.
OE.OP Operators shall protect their authentication credentials (PIN) and shall not log in over an untrusted channel.
OE.PHYS The host shall be physically protected against unauthorized access (server room or equivalent).

4. Security requirements (ASE_REQ.2)

4.1 Class FAU — Audit

4.2 Class FCS — Cryptographic support

4.3 Class FDP — User Data Protection

4.4 Class FIA — Identification and Authentication

4.5 Class FMT — Security Management

4.6 Class FPT — Protection of the TSF

4.7 Class FTA — TOE access

5. Modular design (ADV_TDS.3)

Subsystem File(s) TSFI exposed
State machine src/fhsm_state.c (internal only)
Secure memory src/fhsm_memory.c (internal only)
Crypto primitives src/fhsm_crypto.c + kat/ (internal only)
Token store src/fhsm_token.c (internal only)
Session table src/fhsm_session.c (internal only)
Audit log src/fhsm_audit.c (internal only)
PKCS#11 façade src/fhsm_pkcs11.c C_* (full PKCS#11 v3.2)

The TSFI is exclusively the set of C_* symbols exported by libfreehsm.so. All other symbols are hidden by -fvisibility=hidden and the linker version script.

6. Lifecycle (ALC_*)

6.1 ALC_CMC.4 — Production support, acceptance procedures, automation

6.2 ALC_FLR.2 — Flaw reporting procedures

6.3 ALC_TAT.1 — Well-defined development tools

7. Vulnerability analysis (AVA_VAN.5)

The TOE is designed to resist attacks with attack potential Beyond-High, the AVA_VAN.5 target. Evidence:

8. Delivery (ALO_DEL.1)

The TOE is delivered as a signed .tar.xz source archive (make dist) and a binary RPM/DEB package built reproducibly. Both bundles are signed with the same GPG key. Customers verify the signature and the SHA-256 digest published on the project website over HTTPS.

9. TSF list — v1.1.0 additions

The CST-evidence work batch adds 4 transverse TSFs that complement the EAL4+ functional family coverage:

TSF identifier Family Description Source
FCS_RBG_EXT.1 FCS (Cryptographic Support) Hardened DRBG with multi-source seeding (getrandom + RDRAND + /dev/urandom + TSC jitter), SHA-384 conditioner per SP 800-90C, NIST SP 800-90B health tests (RCT, APT, CRNGT), auto-reseed every 1 MiB or 1 h. src/fhsm_drbg.c, include/fhsm_drbg.h, RNG.md
FCS_CKM_EXT.4 FCS Pair-wise consistency check post C_GenerateKeyPair (RSA, EC, ML-KEM, ML-DSA, SLH-DSA). Failure latches ERROR + refusal to persist. Per FIPS 140-3 §7.10.2.b. src/fhsm_pairwise.c, include/fhsm_pairwise.h
FPT_TST_EXT.1 FPT (Protection of TSF) TPM 2.0 sealing of the per-token DEK (opt-in via FHSM_TPM_SEALING=1). DEK bound to PCRs 0-7 of the boot chain. Mismatch on unseal treated as wrong PIN (oracle resistance). src/fhsm_token_tpm.c, src/fhsm_tpm.c
FMT_SMR_EXT.1 FMT (Security Management) Runtime mode switch between permissive (default) and strict via FHSM_MODE env or mode = conf directive; the former spellings legacy and fips still work. Sufficient for a single binary to satisfy both the FIPS 140-3 evaluator and operators who need interoperability with legacy systems. src/fhsm_mode.c, src/dispatch/fhsm_dispatch_legacy.c

9.1 Updated ADV_FSP coverage

External interface TSF covered
C_GenerateKeyPair FCS_CKM_EXT.4 (pair-wise check) + existing FCS_CKM.1
Any fhsm_rng_bytes consumer FCS_RBG_EXT.1 (RCT + APT + CRNGT)
fhsm_token_init / fhsm_token_login FPT_TST_EXT.1 (optional TPM sealing)
Every C_* mechanism call FMT_SMR_EXT.1 (mode-dependent dispatch)