identity: the SD-JWT form of an AERE hybrid identity is judged on its ML-DSA-65 half by default, the Ed25519 half only on explicit request, and every verdict says postQuantum (rule sdjwt.hybrid-half); pq-pki: the signature algorithm a certificate or a revocation list declares must be its issuer key's (ALG_KEY, CRL_ALG_KEY); agents: an equivocation proof requires the agent's ML-DSA-65 key; pq-gateway: the status names the path to the backend and hybrid-only refuses a plain-HTTP backend; conformance 241 rules, 631 vectors

This commit is contained in:
Aere Network committed 2026-10-19 05:19:21 +03:00
1 parent 3ff21f7758
commit 0c8f1de3fd
122 files changed
+1205 -262

No files matched your search

+13 -4
View File
@@ -13,7 +13,7 @@ import { fileURLToPath } from 'node:url';
const AICI = path.dirname(fileURLToPath(import.meta.url));
const S = 'sdjwt.mjs';
const PLANTARI = [
// [nume, tipar, inlocuire, proba (inceputul numelui ei)]
// [nume, tipar, inlocuire, proba (inceputul numelui ei), fisierul plantat (implicit sdjwt.mjs; din 2026-10-19 si linia de comanda)]
['alg none primit', "if (!(ALGS.includes(antet.alg) /*PAZA:alg*/)) throw", "if (antet.alg === 'nimic') throw", 'ATAC: alg none'],
['algoritmul nu mai trebuie sa fie al cheii (confuzia)', 'if (!(potriveste(antet.alg, key) /*PAZA:key*/)) throw', 'if (false) throw', 'ATAC: alg none'],
['o dezvaluire nelegata de niciun digest primita', 'if (!(folosite.size === dupaDigest.size /*PAZA:unreferenced*/)) return', 'if (false) return', 'ATAC: o dezvaluire cu valoarea schimbata'],
@@ -47,7 +47,16 @@ const PLANTARI = [
['emiterea nu mai cere un typ explicit de SD-JWT', "if (!tipBun(typ, undefined)) throw new Error('sd-jwt: typ must be", "if (false) throw new Error('sd-jwt: typ must be", 'INTEROP: _sd_alg imbricat'],
['cheia publica Node nu mai e primita', "(k.type === 'public' ? k : crypto.createPublicKey(k))", 'crypto.createPublicKey(k)', 'REVIZUIRE: cheia emitentului'],
['o afirmatie __proto__ primita (prototipul schimbat)', "if (!(!Object.hasOwn(x, '__proto__') /*PAZA:disclosure-name*/)) throw", 'if (false) throw', 'ATAC: o afirmatie numita __proto__'],
['elementele de lista nedezvaluite pastrate', 'if (!c) continue; // nedezvaluit: elementul se scoate', "if (!c) { out.push(e); continue; }", 'AERE -> SD-JWT (EdDSA'],
['elementele de lista nedezvaluite pastrate', 'if (!c) continue; // nedezvaluit: elementul se scoate', "if (!c) { out.push(e); continue; }", 'AERE -> SD-JWT (implicit'],
// 2026-10-19 (AIP-25 C1, D-535): jumatatea clasica a unei identitati hibride; fiecare paznic nou si forma de dinainte a reparatiei
['AIP-25 C1: jetonul doar-Ed25519 contra cheilor AERE nu mai e numit (cade pe key)', "if (!(!(a === 'ML-DSA-65' && CLASIC.includes(headerAlg)) /*PAZA:hybrid-half*/)) throw", 'if (false) throw', 'AIP-25 C1: un SD-JWT semnat NUMAI'],
['AIP-25 C1: jumatatea Ed25519 a cheilor AERE data fara classicalHalf', 'if (!(classicalHalf === true /*PAZA:hybrid-half*/)) throw', 'if (false) throw', 'AIP-25 C1: jumatatea clasica se judeca NUMAI'],
['AIP-25 C1: forma de dinainte: cheile AERE judecate implicit pe jumatatea Ed25519, fara cerere', 'if (!esteAere(k)) return publicJwk(k, alg);', "if (true) return publicJwk(k, alg ?? 'EdDSA', { classicalHalf: true });", 'AIP-25 C1: un SD-JWT semnat NUMAI'],
['AIP-25 C1: postQuantum spus adevarat pentru orice semnatura a emitentului', "const pqEmitent = antet.alg === 'ML-DSA-65';", 'const pqEmitent = true;', 'AIP-25 C1: un JWK simplu ramane'],
['AIP-25 C1: Key Binding-ul clasic nu mai coboara postQuantum', "postQuantum: rez.postQuantum && k.antet.alg === 'ML-DSA-65',", 'postQuantum: rez.postQuantum,', 'AIP-25 C1: un JWK simplu ramane'],
['AIP-25 C1: emiterea implicita cu chei AERE pe Ed25519 (forma de dinainte)', 'const algE = alg ?? defaultAlg(issuer), algH = holderAlg ?? defaultAlg(holder);', "const algE = alg ?? 'EdDSA', algH = holderAlg ?? 'EdDSA'; classicalHalf = true;", 'AIP-25 C1: emiterea implicita'],
['AIP-25 C1: linia de comanda ignora --classical-half', "const classicalHalf = are('--classical-half');", 'const classicalHalf = false;', 'linia de comanda AIP-25 C1', 'identity-cli.mjs'],
['AIP-25 C1: linia de comanda cere implicit EdDSA (forma de dinainte)', "issuerAlg: algDat ?? (aere(cheie) ? undefined : 'EdDSA'),", "issuerAlg: algDat ?? 'EdDSA',", 'linia de comanda AIP-25 C1', 'identity-cli.mjs'],
];
function copie() {
const t = fs.mkdtempSync(path.join(os.tmpdir(), 'aere-sdjwt-ctl-'));
@@ -64,10 +73,10 @@ function ruleaza(t) {
c.on('close', (cod) => { clearTimeout(ceas); resolve({ cod, rulat: /aere-sd-jwt: \d+\/\d+/.test(out), rosii: out.split('\n').filter((l) => l.startsWith(' RAU ')) }); });
});
}
async function planteaza([nume, din, inl, tinta]) {
async function planteaza([nume, din, inl, tinta, fis = S]) {
const t = copie();
try {
const f = path.join(t, S); const src = fs.readFileSync(f, 'utf8');
const f = path.join(t, fis); const src = fs.readFileSync(f, 'utf8');
if (src.split(din).length !== 2) return [false, ` STRICAT ${nume}: tiparul apare de ${src.split(din).length - 1} ori`];
fs.writeFileSync(f, src.replace(din, inl));
const r = await ruleaza(t);