aien-receipts
Append-only AIEN verification receipts, indexed by repository and exact source commit. Read verdicts, signatures and retained logs before making a claim.
Brought by drakestapleton
aien-receipts / audit / tls / omega-mv / bench / gen-certs.sh
| 1 | #!/bin/sh |
| 2 | # Benchmark PKI: one ECDSA P-256 root (trust anchor) signs one ECDSA P-256 leaf for bench.test. |
| 3 | # Every client arm verifies the same chain against the same root.pem. |
| 4 | set -eu |
| 5 | d=${1:-www}; mkdir -p "$d"; cd "$d" |
| 6 | openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out root.key 2>/dev/null |
| 7 | openssl req -x509 -new -key root.key -subj /CN=tlsproof-bench-root -days 60 -sha256 \ |
| 8 | -addext basicConstraints=critical,CA:true -addext keyUsage=critical,keyCertSign,cRLSign -out root.pem |
| 9 | openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out leaf.key 2>/dev/null |
| 10 | openssl req -new -key leaf.key -subj /CN=bench.test -addext subjectAltName=DNS:bench.test -out leaf.csr |
| 11 | printf 'basicConstraints=critical,CA:false\nkeyUsage=critical,digitalSignature\nextendedKeyUsage=serverAuth\nsubjectAltName=DNS:bench.test\n' > leaf.ext |
| 12 | openssl x509 -req -in leaf.csr -CA root.pem -CAkey root.key -CAcreateserial -days 30 -sha256 -extfile leaf.ext -out leaf.pem 2>/dev/null |
| 13 | # bodies: byte i = i mod 251 |
| 14 | python3 - <<'PY' |
| 15 | for name, n in (("small.bin", 1024), ("1m.bin", 1 << 20), ("16m.bin", 16 << 20)): |
| 16 | open(name, "wb").write(bytes(i % 251 for i in range(n))) |
| 17 | PY |
| 18 | sha256sum root.pem leaf.pem small.bin 1m.bin 16m.bin |