agents: the hosted witness for agent ledgers (sandbox on testnet 28001), its probe and negative control; crypto-inventory 0.4.1 resolves a minimum TLS version given through a constant or a ternary; proof-kinds and conformance gain the agent-witness-checkpoint kind; the reproduction scripts of the Shield recipes no longer carry a workstation path
This commit is contained in:
1 parent
0c8f1de3fd
commit
a654c3d522
27 files changed
+4737
-43
No files matched your search
@@ -1,5 +1,5 @@
|
||||
// Detectorul JavaScript / TypeScript: node:crypto, WebCrypto, optiuni TLS, biblioteci din importuri.
|
||||
import { argumente, imparteArgumente, valoareArgument, necunoscut, obiectulDin, cifruOpenssl, identificator, rezolva, escapeRe } from './context.mjs';
|
||||
import { argumente, imparteArgumente, valoareArgument, necunoscut, obiectulDin, cifruOpenssl, identificator, rezolva, rezolvaTernarJs, escapeRe } from './context.mjs';
|
||||
import { hashCanonic, grupTls, jws, JWS_RE } from './catalog.mjs';
|
||||
|
||||
const MODP = { modp1: 768, modp2: 1024, modp5: 1536, modp14: 2048, modp15: 3072, modp16: 4096, modp17: 6144, modp18: 8192 };
|
||||
@@ -210,6 +210,32 @@ function detecteazaTlsJs(ctx) {
|
||||
const rol = /min/i.test(m[1]) ? 'min' : 'max';
|
||||
ctx.adauga(m.index, `tls ${m[1]}`, 'config', { grup: 'TLS', param: TLSV[m[3]], rol }, { bucata: m[0] });
|
||||
}
|
||||
// 0.4.1 (2026-10-19, D-540): versiunea data printr-o EXPRESIE, nu printr-un sir. Pana la 0.4.0 o constanta (`minVersion: v`) nu dadea
|
||||
// nicio gasire TLS, nici macar una necunoscuta (gasit pe gateway-ul PQ al casei: `const minSus = ... ? 'TLSv1.3' : 'TLSv1.2'`). Acum, ca la
|
||||
// ecdhCurve: o constanta se rezolva; un ternar intre doua literale de versiune da ramura cea mai SLABA (pentru o minima e podeaua care
|
||||
// conteaza, pentru o maxima plafonul cel mai jos), spusa in resolvedFrom; orice alta expresie iese "unknown", nu tace. Un nume de tip
|
||||
// TypeScript (`SecureVersion`, `string`) dupa doua puncte nu e o valoare.
|
||||
for (const m of ctx.potriviri(/(?<![\w$])(minVersion|maxVersion|DEFAULT_MIN_VERSION|DEFAULT_MAX_VERSION)\s*(?::|=(?![=>]))\s*/g)) {
|
||||
const baza = m.index + m[0].length;
|
||||
const expr = expresiePanaLaVirgula(ctx, baza);
|
||||
if (!expr || /^(['"])/.test(expr) || /^(?:tls\s*\.\s*)?SecureVersion\b|^string\b/.test(expr)) continue;
|
||||
const rol = /min/i.test(m[1]) ? 'min' : 'max';
|
||||
const v = valoareExpresie(ctx, expr);
|
||||
if (v && TLSV[v.valoare]) {
|
||||
ctx.adauga(m.index, `tls ${m[1]}`, 'config', { grup: 'TLS', param: TLSV[v.valoare], rol }, { bucata: `${m[1]}: ${v.valoare}`, rezolvatDin: v.din });
|
||||
continue;
|
||||
}
|
||||
const id = identificator(expr);
|
||||
const ter = id && !v ? rezolvaTernarJs(ctx, id) : null;
|
||||
if (ter && ter.valori.every((x) => TLSV[x])) {
|
||||
const ORDINE = ['ssl3', '1.0', '1.1', '1.2', '1.3'];
|
||||
const slaba = ter.valori.slice().sort((a, b) => ORDINE.indexOf(TLSV[a]) - ORDINE.indexOf(TLSV[b]))[0];
|
||||
ctx.adauga(m.index, `tls ${m[1]}`, 'config', { grup: 'TLS', param: TLSV[slaba], rol },
|
||||
{ bucata: `${m[1]}: ${slaba}`, rezolvatDin: `${id} (line ${ter.line}, a conditional: ${ter.valori.join(' or ')}; the weaker one)` });
|
||||
continue;
|
||||
}
|
||||
ctx.adauga(m.index, `tls ${m[1]}`, 'config', necunoscut(expr, `tls ${m[1]}`), { bucata: m[0] + expr });
|
||||
}
|
||||
for (const m of ctx.potriviri(/(?<![\w$])secureProtocol\s*:\s*(['"])(\w+)\1/g)) {
|
||||
const map = { SSLv2_method: 'ssl2', SSLv3_method: 'ssl3', TLSv1_method: '1.0', TLSv1_1_method: '1.1', TLSv1_2_method: '1.2', TLS_method: 'negotiated', SSLv23_method: 'negotiated' };
|
||||
const v = map[m[2].replace(/_(client|server)_method$/, '_method')];
|
||||
|
||||
Reference in new issue
Block a user