Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omtls/blob/main/tests/drv/tm.om # omtls omtls: a TLS 1.3 client (RFC 8446) written fresh in seeded Omega, for mailhand. Not audited by a cryptographer. Free (Apache-2.0). Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omtls / tests / drv / tm.om` 81 lines ยท 1563 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 2 note tests/drv/tm.om: ot_tm_ cases. Arguments: vector files. Line forms: 3 note T ot_tm_der over exactly those bytes 4 note C ot_tm_civil 5 text ot_x5_zar "tm" 6 text ot_x5_zwT "T" 7 text ot_x5_zwC "C" 8 text ot_x5_zwB "BAD" 9 text ot_x5_zm1 "wrong value" 10 text ot_x5_zm2 "accepted, expected BAD" 11 text ot_x5_zm3 "refused, expected a value" 12 text ot_x5_zm4 "malformed vector line" 13 text ot_x5_zm5 "cannot read vector file" 14 15 fn ot_x5_ztmT to void 16 n = ot_x5_zthex 3 0 17 if lt n 0 18 ot_x5_zifail ot_x5_zar ot_x5_zm4 19 ret 20 end 21 v = ot_tm_der 0 ulong n 22 if eq v ot_tm_bad 23 if ot_x5_zteq 2 ot_x5_zwB 24 ot_x5_zipass 25 ret 26 end 27 ot_x5_zifail ot_x5_zar ot_x5_zm3 28 ret 29 end 30 if ot_x5_zteq 2 ot_x5_zwB 31 ot_x5_zifail ot_x5_zar ot_x5_zm2 32 ret 33 end 34 if ne v ot_x5_ztdec 2 35 ot_x5_zifail ot_x5_zar ot_x5_zm1 36 ret 37 end 38 ot_x5_zipass 39 end 40 41 fn ot_x5_ztmC to void 42 if ne ot_x5_ztn 9 43 ot_x5_zifail ot_x5_zar ot_x5_zm4 44 ret 45 end 46 y = ot_x5_ztdec 3 47 mo = ot_x5_ztdec 4 48 d = ot_x5_ztdec 5 49 h = ot_x5_ztdec 6 50 mi = ot_x5_ztdec 7 51 s = ot_x5_ztdec 8 52 v = ot_tm_civil y mo d h mi s 53 if ne v ot_x5_ztdec 2 54 ot_x5_zifail ot_x5_zar ot_x5_zm1 55 ret 56 end 57 ot_x5_zipass 58 end 59 60 fn main to int 61 a = ulong 1 62 while lt long a argcnt bound 64 63 if eq ot_x5_ziread a false 64 ot_x5_zifail ot_x5_zar ot_x5_zm5 65 else 66 while ot_x5_ziline bound `1000000` 67 if ot_x5_zteq 0 ot_x5_zwT 68 ot_x5_ztmT 69 else 70 if ot_x5_zteq 0 ot_x5_zwC 71 ot_x5_ztmC 72 else 73 ot_x5_zifail ot_x5_zar ot_x5_zm4 74 end 75 end 76 end 77 end 78 a = add a 1 79 end 80 ret ot_x5_ziend ot_x5_zar 81 end