Skip to content
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ab7a6b6
RDK-61060: Add PKCS#11 xPKI certificate procurement support
Apr 1, 2026
48476d0
Remove automatic ssa-cpc build and infrastructure tests
Apr 1, 2026
744b9b8
Apply suggestion from @Copilot
Sidsohail Apr 2, 2026
40d88fa
Add certificate renewal support to mockxconf xPKI server
Apr 3, 2026
094fbfd
Add /renew endpoint for libcertifier renewal requests
Apr 3, 2026
fd67db7
Fix renewal endpoint: use /v1/certifier/renew instead of /renew
Apr 4, 2026
659ccdf
Fix certificate renewal workflow and remove duplicate PKCS#11 setup
Apr 6, 2026
6268602
Fix Copilot security and reliability issues
Apr 8, 2026
c0392a5
Apply suggestion from @Copilot
Sidsohail Apr 8, 2026
860cc8c
Apply suggestion from @Copilot
Sidsohail Apr 8, 2026
c51f803
Apply suggestion from @Copilot
Sidsohail Apr 8, 2026
2acb812
Address all Copilot security review comments
Apr 8, 2026
5668ae7
Update Dockerfile
Sidsohail Apr 8, 2026
d2ec9ef
Fix certificate renewal: revert certificateId hash from SHA-256 to SHA-1
Apr 9, 2026
450050c
Add comprehensive documentation for SHA-1 requirement in certificateId
Apr 9, 2026
178efb4
Fix mTLS failures: unify PKI hierarchy using rdk-cert-config scripts
Apr 10, 2026
fdabd93
Fix mTLS failures: unify PKI hierarchy using rdk-cert-config
Apr 10, 2026
645a6e5
Add comprehensive logging to debug mTLS connection resets
Apr 10, 2026
53a63bb
Fix mTLS connection reset: revert to develop trust store behavior
Apr 10, 2026
3bff424
Clean up debug logging: revert to develop versions
Apr 11, 2026
5f5b4b3
Revert certsel.cfg setup to develop version
Apr 11, 2026
eee51c5
Apply suggestion from @Copilot
Sidsohail Apr 13, 2026
b5735b9
Remove unreliable shutdown trap from entrypoint.sh
Apr 13, 2026
493fc1f
Update test_docker.py
Sidsohail Apr 13, 2026
0a06666
Fix mTLS race condition: verify ca-chain.pem is non-empty before copying
Apr 13, 2026
9c3ca4e
Update certs.sh
Sidsohail Apr 13, 2026
97e2d02
Update certs.sh
Sidsohail Apr 13, 2026
40d8f4e
Add xPKI seed certificate wait logic for PKCS#11 tests
Apr 13, 2026
7ed5e79
Update certs.sh
Sidsohail Apr 14, 2026
e2b13e0
Remove seed cert wait logic from container startup
Apr 14, 2026
4815306
Update certs.sh
Sidsohail Apr 14, 2026
a94341b
Align certs.sh with develop
Apr 15, 2026
70597a0
Address review: optimize cert validity and paths for testing
Apr 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ services:
- "50051:50051"
- "50052:50052"
- "50053:50053"
- "50054:50054"
- "50055:50055" # RDK-61060: XPKI Certifier
- "50056:50056"
Comment thread
Sidsohail marked this conversation as resolved.
- "50057:50057"
- "50058:50058"
Expand All @@ -16,7 +18,7 @@ services:
volumes:
- ../:/mnt/L2_CONTAINER_SHARED_VOLUME
environment:
- ENABLE_MTLS=true
- ENABLE_MTLS=true


l2-container:
Expand Down
5 changes: 5 additions & 0 deletions mock-xconf/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,18 @@ RUN chmod +x /usr/local/bin/stbLogUpload.js
COPY crashUpload.js /usr/local/bin/crashUpload.js
RUN chmod +x /usr/local/bin/crashUpload.js

# RDK-61060: XPKI Certifier service
COPY xpki-certifier.js /usr/local/bin/xpki-certifier.js
RUN chmod +x /usr/local/bin/xpki-certifier.js

CMD ["/usr/local/bin/entrypoint.sh"]

EXPOSE 50050
EXPOSE 50051
EXPOSE 50052
EXPOSE 50053
EXPOSE 50054
EXPOSE 50055
EXPOSE 50056
EXPOSE 50057
EXPOSE 50058
Expand Down
50 changes: 50 additions & 0 deletions mock-xconf/certs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
echo "[certs.sh] Starting certificate generation..."
set -e

##########################################################################
Expand Down Expand Up @@ -60,6 +61,7 @@ mkdir -p "$SHARED_CERTS_DIR/server"

# Copy the server certificates to the xconf certs directory
cp "$SERVER_KEY" /etc/xconf/certs/mock-xconf-server-key.pem
chmod 600 /etc/xconf/certs/mock-xconf-server-key.pem
cp "$SERVER_CERT" /etc/xconf/certs/mock-xconf-server-cert.pem
echo "[certs] Server certificates generated and copied to /etc/xconf/certs"

Expand All @@ -68,6 +70,47 @@ cp "$ROOT_CA_CERT" "$SHARED_CERTS_DIR/server/root_ca.pem"
cp "$ICA_CERT" "$SHARED_CERTS_DIR/server/intermediate_ca.pem"
echo "[certs] Server root and intermediate CA certificates copied to shared volume for native-platform"

# ─── RDK-61060: Generate Seed Certificate using Server ICA ───────────────────
# NOTE: This MUST run BEFORE the mTLS wait so that xpki-certifier.js can start
# Use Test-RDK-server-ICA to sign seed cert (simpler than dual PKI hierarchy)
# Per architecture: mock-xconf generates seed, exports to shared volume

echo "[certs] Generating seed certificate using Test-RDK-server-ICA..."

# Setup xpki-certifier.js directories
XPKI_DIR="/etc/xconf/xpki-certs"
SEED_CERT_DIR="$SHARED_CERTS_DIR/client"
mkdir -p "$XPKI_DIR" "$SEED_CERT_DIR"

# Copy server ICA for xpki-certifier.js (to sign operational certs)
cp "/etc/pki/${ROOT_CA_NAME}/${ICA_NAME}/private/${ICA_NAME}.key" "$XPKI_DIR/Test-RDK-xpki-ICA.key"
Comment thread
Sidsohail marked this conversation as resolved.
Outdated
cp "$ICA_CERT" "$XPKI_DIR/Test-RDK-xpki-ICA.pem"
cp "$ROOT_CA_CERT" "$XPKI_DIR/Test-RDK-xpki-root.pem"
chmod 600 "$XPKI_DIR/Test-RDK-xpki-ICA.key"

Comment thread
Sidsohail marked this conversation as resolved.
Outdated
# Generate seed cert using rdk-cert-config (unified PKI - no separate xpki-root)
/etc/pki/scripts/create_leaf_cert.sh \
--cert-name "test-seed-device-001" \
--ca-name "$ICA_NAME" \
--cn "test-seed-device-001" \
--validity 30 \
Comment thread
Sidsohail marked this conversation as resolved.
Outdated
--type client

# Export seed cert to shared volume for native-platform
SEED_KEY="/etc/pki/${ROOT_CA_NAME}/${ICA_NAME}/private/test-seed-device-001.key"
SEED_CERT="/etc/pki/${ROOT_CA_NAME}/${ICA_NAME}/certs/test-seed-device-001.pem"
SEED_P12="/etc/pki/${ROOT_CA_NAME}/${ICA_NAME}/certs/test-seed-device-001.p12"

cp "$SEED_KEY" "$SEED_CERT_DIR/seed-cert.key"
cp "$SEED_CERT" "$SEED_CERT_DIR/seed-cert.pem"
cp "$SEED_P12" "$SEED_CERT_DIR/seed-cert.p12"

chmod 644 "$SEED_CERT_DIR/seed-cert.pem" "$SEED_CERT_DIR/seed-cert.p12"
Comment thread
Sidsohail marked this conversation as resolved.
chmod 600 "$SEED_CERT_DIR/seed-cert.key"
Comment thread
Sidsohail marked this conversation as resolved.

echo "[certs] ✓ Seed certificate generated and exported to shared volume"
echo "[certs] ✓ xPKI Certifier configured (uses Test-RDK-server-ICA)"

# If mTLS is enabled at startup, wait for client certificates
if [ "$ENABLE_MTLS" = "true" ]; then
echo "[certs] mTLS enabled - waiting for client certificates..."
Expand All @@ -83,6 +126,13 @@ if [ "$ENABLE_MTLS" = "true" ]; then
# Import client CA chain to trust store and clean it up from shared volume
cp "$SHARED_CERTS_DIR/client/ca-chain.pem" /etc/xconf/trust-store/ca-chain.pem
rm -f "$SHARED_CERTS_DIR/client/ca-chain.pem"
# Operational certs are signed by Test-RDK-server-ICA which has a DIFFERENT root
# than the client certificates, so we need the complete server chain
if [ -f "$SHARED_CERTS_DIR/server/intermediate_ca.pem" ] && [ -f "$SHARED_CERTS_DIR/server/root_ca.pem" ]; then
cat "$SHARED_CERTS_DIR/server/intermediate_ca.pem" >> /etc/xconf/trust-store/ca-chain.pem
cat "$SHARED_CERTS_DIR/server/root_ca.pem" >> /etc/xconf/trust-store/ca-chain.pem
echo "[certs] Server CA chain (ICA + root) appended to trust store for operational certificates"
Comment thread
Sidsohail marked this conversation as resolved.
fi
echo "[certs] Client CA chain imported to trust store"
echo "[certs] mTLS certificate trust flow established"
fi
Expand Down
12 changes: 12 additions & 0 deletions mock-xconf/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,17 @@ node /usr/local/bin/stbLogUpload.js &

node /usr/local/bin/crashUpload.js &

## RDK-61060: Start XPKI Certifier service (port 50055)
echo "[entrypoint] DEBUG: Checking xpki-certifier.js file..."
if [ -f /usr/local/bin/xpki-certifier.js ]; then
echo "[entrypoint] xpki-certifier.js found, starting service..."
node /usr/local/bin/xpki-certifier.js &
XPKI_PID=$!
echo "[entrypoint] xpki-certifier started (PID: $XPKI_PID) on port 50055"
else
Comment thread
Sidsohail marked this conversation as resolved.
echo "[entrypoint] ERROR: /usr/local/bin/xpki-certifier.js NOT FOUND - xpki service will not start"
ls -la /usr/local/bin/xpki* || echo "No xpki files in /usr/local/bin"
Comment thread
Sidsohail marked this conversation as resolved.
fi
Comment thread
Sidsohail marked this conversation as resolved.

## Keep the container running . Running an independent process will help in simulating scenarios of webservices going down and coming up
while true ; do echo "Mocked webservice heartbeat ..." && sleep 5 ; done
Comment thread
Sidsohail marked this conversation as resolved.
Loading
Loading