aboutsummaryrefslogtreecommitdiffstats
path: root/views/address.html
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2016-09-22 10:11:45 -0700
committerAdam Soltys <[email protected]>2016-09-22 10:11:45 -0700
commit62e3ba927a918d012bb6af0e034866db880454e0 (patch)
tree5614d2b68a094cad9b4bb15c1f9606e9626ef128 /views/address.html
parent9634031d5972051da76dab048d748d96e56b2715 (diff)
parentacd47767d0c02dfa1a4152208a16c21255e4943b (diff)
downloadcoinos-server-62e3ba927a918d012bb6af0e034866db880454e0.tar.gz
coinos-server-62e3ba927a918d012bb6af0e034866db880454e0.zip
Merge branch 'notifications'
Diffstat (limited to 'views/address.html')
0 files changed, 0 insertions, 0 deletions
hlight .sh { color: #D20; background-color: #FFF0F0 } /* Literal.String.Heredoc */ .highlight .si { color: #33B; background-color: #FFF0F0 } /* Literal.String.Interpol */ .highlight .sx { color: #2B2; background-color: #F0FFF0 } /* Literal.String.Other */ .highlight .sr { color: #080; background-color: #FFF0FF } /* Literal.String.Regex */ .highlight .s1 { color: #D20; background-color: #FFF0F0 } /* Literal.String.Single */ .highlight .ss { color: #A60; background-color: #FFF0F0 } /* Literal.String.Symbol */ .highlight .bp { color: #038 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #06B; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #369 } /* Name.Variable.Class */ .highlight .vg { color: #D70 } /* Name.Variable.Global */ .highlight .vi { color: #33B } /* Name.Variable.Instance */ .highlight .vm { color: #369 } /* Name.Variable.Magic */ .highlight .il { color: #00D; font-weight: bold } /* Literal.Number.Integer.Long */
// DNSSEC chain validation against LIVE DNS. Needs network.
// Run: bun tools/dnssec-test.js
import { resolveTxtValidated } from '../src/dnssec.js';

let fails = 0;
const check = (name, ok, detail = '') => {
  console.log(` ${ok ? '✓' : '✗'} ${name}${detail ? ' — ' + String(detail).slice(0, 140) : ''}`);
  if (!ok) fails++;
};

// The canonical BIP-353 record: ₿[email protected] (alg 8 chain).
try {
  const { txts } = await resolveTxtValidated('matt.user._bitcoin-payment.mattcorallo.com');
  const uri = txts.find((t) => t.toLowerCase().startsWith('bitcoin:'));
  check('validates [email protected] (RSA chain)', !!uri, (uri || '').slice(0, 60) + '…');
} catch (e) { check('validates [email protected] (RSA chain)', false, e.message); }

// A Cloudflare-signed TXT (alg 13 chain): cloudflare.com SPF record.
try {
  const { txts } = await resolveTxtValidated('cloudflare.com');
  check('validates cloudflare.com TXT (ECDSA chain)', txts.length > 0, txts[0]);
} catch (e) { check('validates cloudflare.com TXT (ECDSA chain)', false, e.message); }

// An unsigned zone must FAIL closed, not pass quietly.
try {
  await resolveTxtValidated('google.com'); // google.com is famously unsigned
  check('unsigned zone fails closed', false, 'validated?!');
} catch (e) {
  check('unsigned zone fails closed', /not in a signed zone|no DNSKEY|fails/.test(e.message), e.message);
}

// A missing record must throw, not return empty-and-valid.
try {
  await resolveTxtValidated('definitely-not-real.user._bitcoin-payment.mattcorallo.com');
  check('missing record throws', false);
} catch (e) { check('missing record throws', true, e.message); }

console.log(fails ? `\n❌ ${fails} failure(s)` : '\n✅ DNSSEC validation behaves');
process.exit(fails ? 1 : 0);