interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / om / tls / test / fuzz / fz_pem.om

31 lines · 941 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note fz_pem.om: fuzz target for the PEM trust-store loader of om/tls/x509.om (pem_decode: armour
3note scanning, base64, per-certificate parsing into store entries) and for chain verification against
4note the store it builds. Input: a PEM bundle (as /etc/ssl/certs/ca-certificates.crt would hold).
5note Argument 1 (optional): a certificate_list file (3-byte length, DER, 2-byte zero, per entry, as
6note run.sh writes from om/tls/test/x509/vectors/pki/lR.der + intR.der) checked against the store
7note when pem_decode accepted it, at now 1792972800 and host www.example.test.
8
9fn fz_pchain st view uchar * to ulong
10cl = new uchar 16384 0
11hq = new uchar 32 0
12m = fz_load 1 cl
13if eq m 0
14ret 0
15end
16h = fz_hq hq
17ret x509_chain_verify part cl 0 m st part hq 0 h
18end
19
20fn main to int
21st = new uchar TLSTSZ 0
22n = fz_read st
23if lt n 1
24ret 0
25end
26r = pem_decode st n
27if gt r 0
28v = fz_pchain view st
29end
30ret 0
31end