crypto-inventory 0.3.0: glob imports resolved, libcrux and spqr, libsignal KEM key pairs; control-plane: a key agreement or client-side TLS called by the application itself is not routed to the TLS gateway (planner 35/35, B1 negative control 4/4)

This commit is contained in:
Aere Network committed 2026-10-18 05:59:35 +03:00
1 parent f2f6217b4c
commit f971fa9e28
11 files changed
+161 -30

No files matched your search

+33 -1
View File
@@ -27,6 +27,32 @@ const TINTE = {
pke: { target: 'ML-KEM-768 (hybrid KEM) instead of public-key encryption', product: 'kms', how: 'hybrid envelope through the KMS' },
};
// 2026-10-18 (prima rulare pe un arbore strain, Avano): un X25519, un Ed25519 sau un RSA chemat de APLICATIE (ratchet, PQXDH,
// ntor, semnaturi de mesaj, chei derivate) nu se repara punand un gateway TLS in fata serviciului si nici emitand un certificat:
// gateway-ul vede numai TLS-ul, PKI-ul numai certificatele. Numai o folosire de TLS/certificat din cod se trimite la produs; restul
// e lucru IN COD, manual, cu tinta hibrida scrisa. O constatare fara `api` (ECDH generic, fara context) ramane pe drumul vechi:
// contextul ei nu se stie, nu se ghiceste.
const IN_TLS = /\b(tls|ssl|https|x509|SSLContext|SslContext|ecdhCurve|CurvePreferences|namedGroups|KeyStore|keytool|rustls|SslConnector|SslAcceptor|TlsConnector|TlsAcceptor|HttpsConnectorBuilder)\b/i;
const TINTE_IN_COD = {
'key-agree': { target: 'X25519 + ML-KEM-768 in the same handshake and key schedule (hybrid KEM, as PQXDH does)', product: null,
how: 'called by the application itself, not by a TLS edge: a gateway in front cannot change it. Combine it with ML-KEM-768 in the protocol (both shared secrets into the KDF); if the protocol already pairs it with a post-quantum KEM in the same handshake, record that as the evidence and close this action.' },
};
// semnaturile si cifrarea cu cheie publica din cod raman pe PKI/KMS (produsul emite cheia hibrida, real, prin executor), dar `how`
// spune ca APLICATIA trebuie sa o adopte: produsul da cheia, nu schimba apelul din cod
const NOTA_ADOPTARE = {
signature: ' The application signs with its own key here, so after the PQ PKI issues the hybrid key and certificate the signing call must be changed to use them (a code change; the PKI provides the key, not the call site).',
pke: ' The application encrypts with its own public key here, so after the KMS holds the hybrid key the call must be changed to use the KMS envelope (a code change; the KMS provides the key, not the call site).',
};
// TLS de CLIENT configurat in aplicatie: gateway-ul (terminare de server) nu schimba ce ofera clientul; se repara in client
const TLS_CLIENT = /\b(default_provider|TlsConnector|ClientConfig|HttpsConnectorBuilder|SslConnector)\b/;
function tlsClientInCod(f) {
return !!(f.language && f.api) && TLS_CLIENT.test(String(f.api)) && f.assetType !== 'certificate' && f.assetType !== 'related-crypto-material';
}
function inCod(f) {
return !!(f.language && f.api) && !IN_TLS.test(String(f.api)) && f.protocolType !== 'tls'
&& f.assetType !== 'certificate' && f.assetType !== 'related-crypto-material';
}
// clasificarea unui asset vulnerabil in urgenta, pe natura primitivei (HNDL vs falsificare)
function urgenta(prim, expusPublic, certLunga) {
if (prim === 'key-agree' || prim === 'kem' || prim === 'pke') return expusPublic ? 'CRITICAL' : 'HIGH'; // HNDL: datele de azi se recolteaza
@@ -68,7 +94,13 @@ function actiuneDinInventar(f) {
const prim = primitivaDe(f);
const certLunga = f.assetType === 'certificate' && f.certificate && f.certificate.notValidAfter
&& (new Date(f.certificate.notValidAfter) - new Date()) > 365 * 24 * 3600 * 1000;
const t = TINTE[prim] || { target: 'hybrid post-quantum equivalent', product: null, how: 'to be decided' };
const eInCod = inCod(f);
const tInCod = (eInCod && TINTE_IN_COD[prim])
|| (tlsClientInCod(f) && (prim === 'key-agree' || prim === 'kem') && { target: 'X25519MLKEM768 offered by this client (hybrid)', product: null,
how: 'client-side TLS configured by the application itself: a PQ Gateway in front of a server does not change what this client offers. Switch the client to a provider that offers X25519MLKEM768 (rustls: aws-lc-rs, 0.23.22 or later; OpenSSL 3.5 or later) or enable the hybrid group in its configuration, then re-run the inventory.' });
const t0 = TINTE[prim] || { target: 'hybrid post-quantum equivalent', product: null, how: 'to be decided' };
const t = tInCod ? { ...tInCod, how: `${f.name || prim} via ${f.api}: ${tInCod.how}` }
: (eInCod && NOTA_ADOPTARE[prim] ? { ...t0, how: t0.how + NOTA_ADOPTARE[prim] } : t0);
const numeAsset = f.assetType === 'certificate'
? `X.509 certificate ${f.certificate && f.certificate.subjectName ? '(' + f.certificate.subjectName + ')' : ''}`.trim()
: `${f.name || prim}${f.assetType === 'related-crypto-material' && f.material ? ' (' + f.material.type + ')' : ''}`;