This document outlines the implementation plan for adapting the DSSSL (OpenSSL fork) into a DSMIL-grade secure build as specified in OPENSSL_SECURE_SPEC.md. The implementation leverages existing ML-KEM and ML-DSA implementations while adding DSLLVM build configurations, policy enforcement, and event telemetry.
-
Post-Quantum Crypto Implementation
- ✓ ML-KEM-512/768/1024 (
crypto/ml_kem/,providers/implementations/kem/ml_kem_kem.c) - ✓ ML-DSA-44/65/87 (
crypto/ml_dsa/,providers/implementations/signature/ml_dsa_sig.c) - ✓ SLH-DSA (
crypto/slh_dsa/) - ✓ Hybrid KEM support started (
providers/implementations/kem/mlx_kem.c)
- ✓ ML-KEM-512/768/1024 (
-
Infrastructure
- ✓ OpenSSL 3.x provider architecture
- ✓ Default, Legacy, FIPS, Base, Null providers
- ✓ Configure script with extensive build options
- ✓ Constant-time implementation considerations (see ML-KEM.md, ml-dsa.md)
-
Testing Frameworks
- ✓ Wycheproof test suite (submodule)
- ✓ TLS fuzzer (submodule)
- ✓ Existing OpenSSL test suite
-
External Provider Support
- ✓ oqs-provider submodule (not initialized)
- ✓ pkcs11-provider submodule for HSM/TPM
-
DSLLVM Build System Integration
- Build configurations for portable (world) and optimized (DSMIL) builds
- Compiler flag profiles with CSNA 2.0 annotations
- Dual-build infrastructure
-
DSMIL Policy Provider
- New provider for policy enforcement (WORLD_COMPAT/DSMIL_SECURE/ATOMAL)
- Algorithm selection based on security profiles
- Property query system integration
-
Event Telemetry System
- Event emission to
/run/crypto-events.sock - CBOR/JSON event formatting
- Integration points for DEFRAMEWORK
- Event emission to
-
Configuration System
- OpenSSL config files for each security profile
- Profile-specific algorithm allowlists/denylists
- THREATCON integration
-
Build Scripts & Tools
- Wrapper scripts for DSLLVM compilation
- Installation scripts for both variants
- Version management
-
Enhanced Hybrid Support
- Expand existing mlx_kem.c for full hybrid composition
- Hybrid signature support (dual-cert or composite)
- TLS 1.3 integration
Goal: Enable DSLLVM-based builds with proper compiler flags
Tasks:
-
Create DSLLVM Build Configurations
- File:
Configurations/10-dsllvm.conf - Define two targets:
dsllvm-world: Portable x86-64-v3 builddsllvm-dsmil: Meteorlake-optimized build
- Configure compiler flags as per spec
- File:
-
Create Build Wrapper Scripts
- File:
util/build-dsllvm-world.sh - File:
util/build-dsllvm-dsmil.sh - Automate configure + build + test process
- File:
-
Verification
- Test build with mock
dsclang(alias to clang for now) - Verify compiler flags are applied
- Run basic test suite
- Test build with mock
Deliverables:
- Working DSLLVM build configurations
- Build scripts
- Build verification documentation
Goal: Implement policy enforcement provider
Tasks:
-
Create Provider Skeleton
- Directory:
providers/dsmil/ - File:
providers/dsmil/dsmilprov.c - File:
providers/dsmil/build.info - Implement provider initialization and query interface
- Directory:
-
Implement Policy Logic
- File:
providers/dsmil/policy.c - Profile definitions (WORLD_COMPAT, DSMIL_SECURE, ATOMAL)
- Algorithm filtering based on profiles
- Property query handling
- File:
-
Property Query Integration
- Map OpenSSL property queries to policy decisions
- Implement profile selection logic
- SNI/IP-based profile mapping
-
Testing
- Unit tests for policy decisions
- Integration tests with existing providers
- Verify algorithm selection per profile
Deliverables:
- Functional DSMIL policy provider
- Policy enforcement tests
- Configuration documentation
Goal: Implement observable crypto operations for DEFRAMEWORK
Tasks:
-
Event Infrastructure
- File:
providers/dsmil/events.c - File:
providers/dsmil/events.h - Unix domain socket to
/run/crypto-events.sock - CBOR/JSON event formatting
- File:
-
Event Emission Points
- Hook into policy provider decisions
- Capture handshake events
- Log algorithm negotiations
- Detect downgrade attempts
-
Event Schema Implementation
- Implement event types per spec Appendix C
- Include metadata (profile, KEX type, cipher, etc.)
- Ensure no secret leakage
-
Testing
- Mock DEFRAMEWORK consumer
- Verify event format and content
- Performance impact assessment
Deliverables:
- Event telemetry system
- Event schema documentation
- Integration test suite
Goal: Provide configuration files for each security profile
Tasks:
-
Create Configuration Templates
- File:
config/world.cnf - File:
config/dsmil-secure.cnf - File:
config/atomal.cnf
- File:
-
Profile Configuration
- Define provider activation per profile
- Configure algorithm allowlists/denylists
- Set security levels
- THREATCON integration placeholders
-
Documentation
- Configuration reference guide
- Profile selection guide
- Migration guide
Deliverables:
- Configuration templates
- Configuration documentation
- Example use cases
Goal: Complete hybrid KEM and signature support
Tasks:
-
Expand Hybrid KEM
- Enhance
providers/implementations/kem/mlx_kem.c - Implement X25519+ML-KEM-768/1024
- Implement P-256+ML-KEM-768/1024
- HKDF composition with explicit labels
- Enhance
-
Hybrid Signature Support
- Design composite or dual-cert approach
- Implement ECDSA+ML-DSA composition
- Certificate validation logic
-
TLS 1.3 Integration
- Ensure hybrid algorithms negotiate properly
- Implement downgrade detection
- Add logging for classical fallback
-
Testing
- Interop tests with browsers
- Hybrid composition correctness tests
- KAT for hybrid operations
Deliverables:
- Complete hybrid crypto support
- TLS 1.3 integration
- Interoperability test results
Goal: Apply DSLLVM constant-time annotations and side-channel mitigations
Tasks:
-
CSNA Annotations
- Add constant-time annotations to ML-KEM code
- Add annotations to ML-DSA code
- Add annotations to hybrid composition code
-
Side-Channel Testing
- Implement timing variance harness
- Test KEM decapsulation
- Test signature operations
- Statistical analysis of timing
-
Compiler Checks
- Enable DSLLVM constant-time enforcement
- Enable side-channel alert mode
- Fix any identified issues
Deliverables:
- CSNA-annotated crypto code
- Timing test harness
- Side-channel assessment report
Goal: Integrate hardware-backed key storage
Tasks:
-
TPM2 Provider Integration
- Initialize pkcs11-provider submodule
- Configure for TPM2 support
- Test key sealing/unsealing
-
Key Management
- Implement long-term key storage in TPM
- Secure key access controls
- Key lifecycle management
-
Testing
- TPM-backed TLS handshake
- Key persistence tests
- Fallback to software keys
Deliverables:
- TPM2 integration
- Key management tools
- TPM integration guide
Goal: Comprehensive testing across all profiles and scenarios
Tasks:
-
Functional Testing
- Full OpenSSL test suite on both builds
- TLS interop tests (browsers, curl, etc.)
- SSH/VPN integration tests
-
Crypto Correctness
- Wycheproof tests for classical crypto
- PQC KAT tests
- Hybrid composition tests
-
Security Testing
- Fuzzing campaign (TLS state machine, X.509)
- Timing side-channel tests
- Policy enforcement validation
-
Performance Benchmarking
- Handshake performance per profile
- Throughput tests
- Overhead analysis
Deliverables:
- Test results report
- Performance benchmarks
- Security assessment
Goal: Complete documentation and deployment tools
Status: ✅ Complete (2025-11-25)
Tasks:
-
Documentation ✅
- ✅ Build guide (../README.md)
- ✅ Configuration reference (OPENSSL_SECURE_SPEC.md Section 4)
- ✅ Deployment guide (../DEPLOYMENT_GUIDE.md)
- ✅ API documentation updates (../DOCUMENTATION_INDEX.md)
- ✅ Master documentation index (../DOCUMENTATION_INDEX.md)
-
Packaging ✅
- ✅ Create .deb packages for both builds (util/build-package.sh)
- ✅ Package dependencies (DEBIAN control files)
- ✅ Installation scripts (postinst/prerm/postrm)
- ✅ Container deployment (Dockerfile)
-
Deployment Tools ✅
- ✅ System integration scripts (util/verify-installation.sh)
- ✅ Systemd service integration (util/dsssl-telemetry.service)
- ✅ Configuration management (../DEPLOYMENT_GUIDE.md)
- ✅ Update procedures (../DEPLOYMENT_GUIDE.md Section 7)
Deliverables:
- ✅ Complete documentation set (16 documents, ~210 pages)
- ✅ Deployment packages (util/build-package.sh)
- ✅ Installation guides (../DEPLOYMENT_GUIDE.md)
- ✅ Verification tools (util/verify-installation.sh)
- ✅ Container images (Dockerfile)
Files Created:
- ../DEPLOYMENT_GUIDE.md - Complete production deployment guide (~400 lines)
- util/build-package.sh - Debian package builder (~300 lines)
- util/verify-installation.sh - Installation verification script (~250 lines)
- util/dsssl-telemetry.service - Systemd service file
- Dockerfile - Container image build configuration
- ../DOCUMENTATION_INDEX.md - Master documentation index
- README.md - Project overview and quick start
- DSLLVM build configurations (Phase 1)
- DSMIL policy provider (Phase 2)
- Configuration system (Phase 4)
- Hybrid crypto completion (Phase 5)
- Event telemetry (Phase 3)
- CSNA annotations (Phase 6)
- Testing & validation (Phase 8)
- TPM integration (Phase 7)
- Advanced documentation (Phase 9)
DSSSL/
├── OPENSSL_SECURE_SPEC.md # ✓ Created
├── IMPLEMENTATION_PLAN.md # ✓ Created
├── Configurations/
│ └── 10-dsllvm.conf # New: DSLLVM build configs
├── config/
│ ├── world.cnf # New: WORLD_COMPAT profile
│ ├── dsmil-secure.cnf # New: DSMIL_SECURE profile
│ └── atomal.cnf # New: ATOMAL profile
├── providers/
│ └── dsmil/ # New: DSMIL policy provider
│ ├── dsmilprov.c
│ ├── policy.c
│ ├── events.c
│ ├── events.h
│ └── build.info
├── util/
│ ├── build-dsllvm-world.sh # New: Build script
│ ├── build-dsllvm-dsmil.sh # New: Build script
│ └── deploy-dsmil.sh # New: Deployment script
├── crypto/
│ ├── ml_kem/ # ✓ Exists - will enhance
│ └── ml_dsa/ # ✓ Exists - will enhance
└── test/
└── recipes/
└── 95-test_dsmil_policy.t # New: Policy tests
- DSLLVM (dsclang) compiler
- For initial work: can use clang as mock
- For production: need real DSLLVM with CSNA 2.0
- liboqs (via oqs-provider submodule) - optional, using built-in ML-KEM/ML-DSA
- TPM2 libraries (for Phase 7)
- JSON/CBOR library for event formatting
- Linux kernel with Xen support (for production)
- Intel Meteor Lake CPU (for DSMIL-optimized build)
- TPM 2.0 (for Phase 7)
-
DSLLVM availability
- Mitigation: Use clang with feature flags as stand-in during development
- Mitigation: Document required DSLLVM features
-
Hybrid crypto complexity
- Mitigation: Leverage existing mlx_kem.c as foundation
- Mitigation: Comprehensive testing
-
Performance overhead of policy provider
- Mitigation: Optimize hot paths
- Mitigation: Profile-based caching
-
Event telemetry performance impact
- Mitigation: Async event emission
- Mitigation: Buffering and batching
- Configuration complexity
- Mitigation: Good documentation and examples
- Mitigation: Validation tools
- Both DSLLVM build targets compile successfully
- Compiler flags verified in build output
- Basic test suite passes on both builds
- Build time < 2x baseline
- Policy provider loads and initializes
- Correct algorithm selection per profile
- No performance regression > 5%
- Policy tests pass
- Events emitted to Unix socket
- Event format matches schema
- No secrets leaked in events
- Performance overhead < 2%
- All three profiles (WORLD/SECURE/ATOMAL) functional
- TLS 1.3 with hybrid KEX works
- Interop with major browsers
- Side-channel tests pass
- Documentation complete
| Phase | Duration | Dependencies |
|---|---|---|
| Phase 1: Build System | 1 week | None |
| Phase 2: Policy Provider | 2 weeks | Phase 1 |
| Phase 3: Telemetry | 1 week | Phase 2 |
| Phase 4: Configuration | 1 week | Phase 2 |
| Phase 5: Hybrid Crypto | 2 weeks | Phase 1, 2 |
| Phase 6: CSNA/Hardening | 2 weeks | Phase 5 |
| Phase 7: TPM Integration | 2 weeks | Phase 2, 4 |
| Phase 8: Testing | 2 weeks | Phase 1-6 |
| Phase 9: Documentation | 1 week | All |
Total: ~14 weeks (3.5 months)
Note: Phases can overlap; this is serial estimate.
- Create DSLLVM build configuration (
Configurations/10-dsllvm.conf) - Create build wrapper scripts (
util/build-dsllvm-*.sh) - Test build with clang (as DSLLVM stand-in)
- Begin DSMIL policy provider skeleton
Decision: Use built-in ML-KEM and ML-DSA implementations in DSSSL, not oqs-provider
Rationale:
- DSSSL already has native ML-KEM and ML-DSA with design docs
- Easier to add CSNA annotations to code we control
- Better integration with policy provider
- OQS provider can still be optional add-on
Decision: Implement as separate provider, not as part of default provider
Rationale:
- Clean separation of concerns
- Can be loaded/unloaded independently
- Easier testing and validation
- Follows OpenSSL provider model
Decision: Use JSON for events (CBOR optional/future)
Rationale:
- JSON easier to debug and test
- CBOR can be added later for efficiency
- Both formats supported by most logging systems
Decision: Separate config files per profile, not runtime switching
Rationale:
- Clearer security boundaries
- Easier to audit
- Prevents accidental profile mixing
- Can still override via environment
Version: 1.0 Date: 2025-11-25 Author: DSMIL Security Team