crypto-inventory 0.3.0 and the control-plane planner after the second run on a tree that is not ours (libsignal): BoringSSL, Noise hfs, libcrux Kyber, the libsignal Java/Node API; self-signed trust anchors are blocked, test code is LOW with its own scope

This commit is contained in:
Aere Network committed 2026-10-18 07:52:31 +03:00
1 parent 42b049ef04
commit e453c0c42d
35 files changed
+675 -51

No files matched your search

+2 -1
View File
@@ -1,5 +1,6 @@
# Aere Cloud, Quantum Security Gateway. Imagine minima: Node 24 si un singur fisier, fara nicio dependinta.
# NECONSTRUITA si netrasa pe laptopul de dezvoltare (2026-09-25): versiunea OpenSSL din imagine e NEMASURATA aici.
# Construita si masurata 2026-10-18 pe rpc2 din octetii comisi (dovezi/imagine-docker-2026-10-18.md): 62,5 MB, Node v24.22.0 cu
# OpenSSL 3.5.8, handshake X25519MLKEM768 reusit, clientul clasic refuzat in hybrid-only. Pe laptopul de dezvoltare nu e docker.
# Gateway-ul o verifica singur la pornire (refuza sub OpenSSL 3.5) si o scrie in randul 'listening' din jurnal.
#
# docker build -t aere-pq-gateway .
+4 -2
View File
@@ -84,8 +84,10 @@ docker run --rm -p 443:8443 \
The mounted private key must be readable by the container user (uid 1000), otherwise the gateway refuses to start
with `cannot read KEY (EACCES)`. The OpenSSL version inside the image is printed on the `listening` line; the gateway
refuses to start if it is older than 3.5. Not yet measured by us: a build of this image and the OpenSSL version it
carries (the test suite runs the gateway directly on Node.js 24 with OpenSSL 3.5.5).
refuses to start if it is older than 3.5. Measured on 2026-10-18 from the committed bytes (`dovezi/imagine-docker-2026-10-18.md`):
the image builds in 6 s (62.5 MB, `node:24-alpine`, runs as `node`), its base carries Node v24.22.0 with OpenSSL 3.5.8, a client
offering only X25519MLKEM768 completes TLS 1.3 against it, a classical-only client is refused in `hybrid-only` and accepted in
`hybrid-preferred` (where the hybrid group is chosen when offered). The test suite still runs the gateway directly on Node.js 24.
## Configuration
@@ -0,0 +1,27 @@
# Imaginea Docker a gateway-ului, construita si masurata, 2026-10-18 03:31Z
Pana azi README-ul spunea "not yet measured by us: a build of this image and the OpenSSL version it carries", iar roadmap-ul (s.2a,
Shield, punctul 2) o tinea NEMASURATA. Masurat pe rpc2 (docker 29.6.2, 2 nuclee), din octetii COMISI (`git archive HEAD
cloud-gateway/pq-gateway/Dockerfile cloud-gateway/pq-gateway/pq-gateway.mjs`; pq-gateway.mjs sha256 `8602ac1afa2fe002...`,
Dockerfile `9690e8d1df1a9dc2...`), cu scriptul `pqgw-imagine-rpc2.sh` si sonda `pqgw-sonda.mjs` (ambele pastrate langa acest fisier):
| ce | masurat |
|---|---|
| `docker build` | cod 0 in 6 s; imaginea `sha256:d1e6b588a74a...`, 62.467.140 de octeti, linux/amd64, `user=node` |
| baza `node:24-alpine` (digest `sha256:44fce696f38b...`) | Node v24.22.0, **OpenSSL 3.5.8** (`docker run --rm node:24-alpine node -p process.versions.openssl`) |
| pornirea, `hybrid-only` | containerul `Up`; randul `listening`: `mode hybrid-only, groups X25519MLKEM768, minTlsVersion TLSv1.3`, plus avertismentul ca amontele e http simplu |
| client care ofera NUMAI `X25519MLKEM768` (Node 24, OpenSSL 3.5.8, de pe aceeasi gazda) | **handshake reusit**: TLSv1.3, TLS_AES_256_GCM_SHA384, grupul raportat `X25519MLKEM768`, 16 ms |
| client care ofera NUMAI `X25519`, in `hybrid-only` (control negativ) | **refuzat**: `ERR_SSL_SSL/TLS_ALERT_HANDSHAKE_FAILURE`, 18 ms |
| `hybrid-preferred`: client numai `X25519` | reusit (TLSv1.3, grup `X25519`) |
| `hybrid-preferred`: client `X25519MLKEM768:X25519` | reusit, grupul ales `X25519MLKEM768` (hibridul e preferat) |
| RPC-ul public local al lui rpc2 inainte / dupa | 9 ms / 10 ms (`eth_blockNumber`) |
| curatenie | containerul, imaginea gateway-ului si imaginea de baza sterse; 0 containere, 0 imagini straine ramase; porturile 8444/8081 libere |
Certificatul probei: EC P-256 autosemnat, 2 zile, citibil de uid 1000 (`chmod 644`); amontele probei: `python3 -m http.server` pe
127.0.0.1:8081. Cererea HTTP prin gateway cu `curl --curves X25519MLKEM768` NU s-a masurat (optiunea `%{tls_version}` lipseste in
curl-ul gazdei; nu e o constatare despre gateway).
Doua capcane platite in aceeasi rulare, fara paguba: (1) randul `listening` a fost taiat la 220 de coloane de `cut`, deci versiunea
OpenSSL a gateway-ului a lipsit din jurnalul adus si s-a masurat separat pe imaginea de baza; (2) serverul de proba pornit cu
`nohup ... &` dintr-un subshell a ramas in viata dupa script (`$!` scris intr-un fisier relativ sters de curatenie), a tinut sesiunea
ssh deschisa 10 minute dupa ce scriptul se terminase (aceeasi familie cu C5, 2026-10-11) si a fost oprit de mana; nimic nu a ramas armat.
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
# pqgw-imagine-rpc2.sh (PE rpc2; fisierele vin in /root/pqgw-imagine: pqgw.tar din `git archive HEAD` + pqgw-sonda.mjs):
# masoara ce README-ul gateway-ului numeste NEMASURAT: imaginea Docker se construieste, PORNESTE, poarta OpenSSL >= 3.5, si un client
# care ofera NUMAI X25519MLKEM768 face handshake, iar unul clasic e REFUZAT in modul hybrid-only (controlul negativ). Totul pe 127.0.0.1,
# port 8444, container si imagine sterse la sfarsit (nimic ramane armat). RPC-ul local e cronometrat inainte si dupa.
set -u
D=/root/pqgw-imagine; cd "$D" || exit 2
N=/opt/node24/bin/node
rpc() { local t0=$(date +%s%N); curl -s -m 5 -H 'content-type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' http://127.0.0.1:8545 | grep -o '"result":"0x[0-9a-f]*"' | head -1; echo " ($(( ($(date +%s%N) - t0) / 1000000 )) ms)"; }
echo "== RPC inainte: $(rpc)"
rm -rf src && mkdir -p src certs && tar -xf pqgw.tar -C src && ls -la src/cloud-gateway/pq-gateway | sed -n '2,5p'
sha256sum src/cloud-gateway/pq-gateway/pq-gateway.mjs src/cloud-gateway/pq-gateway/Dockerfile | cut -c1-16,66-
echo "== docker build"; t0=$(date +%s); docker build -q -t aere-pq-gateway:proba src/cloud-gateway/pq-gateway > build.log 2>&1; c=$?; echo "build cod=$c in $(( $(date +%s) - t0 )) s; $(tail -1 build.log | cut -c1-100)"
[ $c -eq 0 ] || { tail -20 build.log; exit 1; }
docker image inspect aere-pq-gateway:proba --format 'imagine: {{.Id}} {{.Size}} octeti, {{.Os}}/{{.Architecture}}, user={{.Config.User}}'
echo "== certificat de proba (EC P-256, autosemnat, citibil de uid 1000)"
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -nodes -keyout certs/privkey.pem -out certs/fullchain.pem -days 2 -subj '/CN=proba.local' > /dev/null 2>&1 && chmod 644 certs/privkey.pem certs/fullchain.pem && echo "cert ok"
echo "== upstream de proba (python http.server pe 127.0.0.1:8081)"; (cd certs && nohup python3 -m http.server 8081 --bind 127.0.0.1 > /dev/null 2>&1 & echo $! > ../upstream.pid); sleep 1
docker rm -f pqgw-proba > /dev/null 2>&1
echo "== pornire: hybrid-only"
docker run -d --name pqgw-proba --network host -e AERE_PQGW_LISTEN=127.0.0.1:8444 -e AERE_PQGW_MODE=hybrid-only -e AERE_PQGW_UPSTREAM=http://127.0.0.1:8081 -v "$D/certs:/etc/aere-pq-gateway:ro" aere-pq-gateway:proba > /dev/null; sleep 3
docker ps --filter name=pqgw-proba --format 'container: {{.Status}}'
echo "-- jurnal (randul listening cu OpenSSL)"; docker logs pqgw-proba 2>&1 | head -5 | cut -c1-220
echo "-- sonda hibrid singur (trebuie ok)"; $N pqgw-sonda.mjs 127.0.0.1 8444 X25519MLKEM768; echo "cod=$?"
echo "-- sonda clasic singur in hybrid-only (CONTROL NEGATIV: trebuie refuzat)"; $N pqgw-sonda.mjs 127.0.0.1 8444 X25519; echo "cod=$?"
echo "-- o cerere HTTP prin gateway (hibrid) spre upstream"; curl -sk -m 8 --curves X25519MLKEM768 --tlsv1.3 https://127.0.0.1:8444/ -o /dev/null -w 'http=%{http_code} ssl=%{ssl_verify_result} tls=%{tls_version}\n' 2>&1 | head -1 || true
echo "== repornire: hybrid-preferred (clasicul trebuie sa mearga, hibridul preferat)"
docker rm -f pqgw-proba > /dev/null 2>&1
docker run -d --name pqgw-proba --network host -e AERE_PQGW_LISTEN=127.0.0.1:8444 -e AERE_PQGW_MODE=hybrid-preferred -e AERE_PQGW_UPSTREAM=http://127.0.0.1:8081 -v "$D/certs:/etc/aere-pq-gateway:ro" aere-pq-gateway:proba > /dev/null; sleep 3
echo "-- sonda clasic singur in hybrid-preferred (trebuie ok)"; $N pqgw-sonda.mjs 127.0.0.1 8444 X25519; echo "cod=$?"
echo "-- sonda hibrid+clasic in hybrid-preferred (trebuie ok)"; $N pqgw-sonda.mjs 127.0.0.1 8444 X25519MLKEM768:X25519; echo "cod=$?"
docker logs pqgw-proba 2>&1 | tail -4 | cut -c1-220
echo "== curatenie"; docker rm -f pqgw-proba > /dev/null 2>&1; docker rmi aere-pq-gateway:proba > /dev/null 2>&1 && echo "imaginea stearsa"; kill "$(cat upstream.pid)" 2>/dev/null; rm -rf certs upstream.pid; docker ps --filter name=pqgw --format '{{.Names}}' | grep -c . | sed 's/^/containere pqgw ramase: /'
echo "== RPC dupa: $(rpc)"
+14
View File
@@ -0,0 +1,14 @@
// pqgw-sonda.mjs <gazda> <port> <grupuri>: o strangere de mana TLS 1.3 reala cu grupurile de schimb de cheie date (de ex.
// X25519MLKEM768 singur, sau X25519 singur), fara verificarea certificatului (cel al probei e autosemnat). Tipareste JSON cu
// protocolul, cifrul, grupul raportat de OpenSSL (pentru hibrid OpenSSL nu il numeste; reusita cu grupul hibrid OFERIT SINGUR e dovada)
// si motivul esecului. Iesire 0 = handshake reusit, 1 = refuzat.
import tls from 'node:tls';
const [gazda, port, grupuri] = process.argv.slice(2);
const t0 = Date.now();
const s = tls.connect({ host: gazda, port: Number(port), servername: 'proba.local', rejectUnauthorized: false, minVersion: 'TLSv1.3', maxVersion: 'TLSv1.3', ecdhCurve: grupuri, ALPNProtocols: ['http/1.1'] }, () => {
const ek = s.getEphemeralKeyInfo();
console.log(JSON.stringify({ ok: true, grupuriOferite: grupuri, protocol: s.getProtocol(), cifru: s.getCipher().name, grupRaportat: ek && ek.name, alpn: s.alpnProtocol, ms: Date.now() - t0, openssl: process.versions.openssl }));
s.end(); process.exitCode = 0;
});
s.setTimeout(8000, () => { console.log(JSON.stringify({ ok: false, grupuriOferite: grupuri, motiv: 'timeout' })); s.destroy(); process.exitCode = 1; });
s.on('error', (e) => { console.log(JSON.stringify({ ok: false, grupuriOferite: grupuri, motiv: e.code || e.message, ms: Date.now() - t0, openssl: process.versions.openssl })); process.exitCode = 1; });