├── tests ├── afl-fuzz │ ├── static │ │ ├── dc │ │ │ ├── t27.in │ │ │ ├── t17.in │ │ │ ├── t6.in │ │ │ ├── t18.in │ │ │ ├── t12.in │ │ │ ├── t19.in │ │ │ ├── t23.in │ │ │ ├── t11.in │ │ │ ├── t24.in │ │ │ ├── t10.in │ │ │ ├── t4.in │ │ │ ├── t13.in │ │ │ ├── t2.in │ │ │ ├── t8.in │ │ │ ├── t25.in │ │ │ ├── t26.in │ │ │ ├── t9.in │ │ │ ├── t5.in │ │ │ ├── t16.in │ │ │ ├── t1.in │ │ │ ├── t15.in │ │ │ ├── t14.in │ │ │ ├── t3.in │ │ │ ├── t7.in │ │ │ ├── t21.in │ │ │ └── t20.in │ │ ├── m4 │ │ │ ├── gnuprefix.m4 │ │ │ ├── dumpdef.m4 │ │ │ ├── fatalwarnings.m4 │ │ │ ├── gnuformat.m4 │ │ │ ├── args3.m4 │ │ │ ├── gnusofterror.m4 │ │ │ ├── eval.m4 │ │ │ ├── translit.m4 │ │ │ ├── gnupatterns2.m4 │ │ │ ├── weird,name.m4 │ │ │ ├── includes.m4 │ │ │ ├── args2.m4 │ │ │ ├── m4wrap2.m4 │ │ │ ├── redef2.m4 │ │ │ ├── gnueval.m4 │ │ │ ├── m4wrap.m4 │ │ │ ├── gnupatterns.m4 │ │ │ ├── fibo.m4 │ │ │ ├── args.m4 │ │ │ ├── translit2.m4 │ │ │ ├── synch1.m4 │ │ │ ├── m4wrap3.m4 │ │ │ ├── patterns.m4 │ │ │ ├── redef.m4 │ │ │ ├── esyscmd.m4 │ │ │ ├── quotes.m4 │ │ │ └── comments.m4 │ │ ├── switchd │ │ │ └── switchd.conf │ │ ├── tcpdump │ │ │ ├── tcpdump.expression │ │ │ └── sample.pcap │ │ ├── bc │ │ │ ├── t10.in │ │ │ ├── t6.in │ │ │ ├── t7.in │ │ │ ├── t12.in │ │ │ ├── t3.in │ │ │ ├── t5.in │ │ │ ├── t2.in │ │ │ ├── t8.in │ │ │ ├── t13.in │ │ │ ├── t4.in │ │ │ ├── t11.in │ │ │ ├── t9.in │ │ │ ├── t16.in │ │ │ ├── t15.in │ │ │ ├── t14.in │ │ │ ├── t18.in │ │ │ ├── t1.in │ │ │ └── t17.in │ │ ├── last │ │ │ └── wtmp │ │ ├── switchd.dict │ │ ├── keynote │ │ │ └── spec │ │ ├── ed │ │ │ └── ed.commands │ │ ├── kdump │ │ │ └── ktrace.out │ │ ├── doas │ │ │ └── doas.conf │ │ ├── deroff │ │ │ ├── br-args.in │ │ │ ├── na-args.in │ │ │ ├── sp-negative.in │ │ │ ├── ps-ignore.in │ │ │ ├── string-std.in │ │ │ ├── string-infinite.in │ │ │ ├── cc-basic.in │ │ │ ├── ft-badargs.in │ │ │ ├── tr.args.in │ │ │ ├── it-badarg.in │ │ │ ├── ds-nested.in │ │ │ ├── it-double.in │ │ │ ├── ds-escname.in │ │ │ ├── ft-basic-mdoc.in │ │ │ ├── rm-basic.in │ │ │ ├── po-basic-mdoc.in │ │ │ ├── string-zerolength.in │ │ │ ├── ds-append.in │ │ │ ├── sp-badargs-man.in │ │ │ ├── ta-basic-man.in │ │ │ ├── sp-badargs-mdoc.in │ │ │ ├── rn-append.in │ │ │ ├── scale-horiz.in │ │ │ ├── string-badargs-mdoc.in │ │ │ ├── ig-basic.in │ │ │ ├── sp-scaling-man.in │ │ │ ├── sp-scaling-mdoc.in │ │ │ ├── ta-basic-mdoc.in │ │ │ ├── it-text.in │ │ │ ├── ti.basic-man.in │ │ │ ├── ti-basic-mdoc.in │ │ │ ├── string-name.in │ │ │ ├── string-escape.in │ │ │ ├── ds-quoting.in │ │ │ ├── ll-basic.in │ │ │ ├── args-roff.in │ │ │ ├── args-mdoc.in │ │ │ └── args-man.in │ │ ├── doas.dict │ │ ├── dvmrpd │ │ │ └── dvmrpd.conf │ │ ├── ripd │ │ │ └── ripd.conf │ │ ├── acme-client.conf │ │ ├── dhclient.dict │ │ ├── ldapd │ │ │ └── ldapd.conf │ │ ├── sasyncd │ │ │ └── sasyncd.conf │ │ ├── mtree.dict │ │ ├── dhclient │ │ │ └── dhclient.conf │ │ ├── vmd.dict │ │ ├── smtpd │ │ │ └── smtpd.conf │ │ ├── ospf6d │ │ │ └── ospf6d.conf │ │ ├── snmpd │ │ │ └── snmpd.conf │ │ ├── radiusd │ │ │ └── radiusd.conf │ │ ├── ntpd │ │ │ └── ntpd.conf │ │ ├── ospfd │ │ │ └── ospfd.conf │ │ ├── ldpd │ │ │ └── ldpd.conf │ │ ├── iked │ │ │ └── iked.conf │ │ ├── npppd │ │ │ └── npppd.conf │ │ ├── eigrpd │ │ │ └── eigrpd.conf │ │ ├── httpd │ │ │ └── httpd.conf │ │ ├── vmd │ │ │ └── vm.conf │ │ ├── ifstated │ │ │ └── ifstated.conf │ │ ├── patch │ │ │ ├── patch │ │ │ ├── README │ │ │ ├── patch.opt_u │ │ │ └── patch.opt_c │ │ ├── hostapd │ │ │ └── hostapd.conf │ │ ├── relayd │ │ │ └── relayd.conf │ │ ├── cap_mkdb │ │ │ └── termcap │ │ ├── bgpd │ │ │ └── bgpd.conf │ │ └── make │ │ │ └── Makefile │ └── afl_run ├── libfuzzer │ ├── Makefile │ ├── README.md │ └── sample.cc ├── regress │ ├── settings.py │ ├── tcpdump │ │ ├── helper.pyc │ │ ├── Makefile │ │ ├── not_finished │ │ │ ├── proto_radius.py │ │ │ ├── proto_gtp.py │ │ │ ├── proto_carp.py │ │ │ ├── proto_cdp.py │ │ │ ├── proto_ike.py │ │ │ ├── proto_mpls.py │ │ │ ├── proto_ripng.py │ │ │ ├── proto_etherip.py │ │ │ ├── proto_vqp.py │ │ │ ├── proto_bgp.py │ │ │ ├── proto_lldp.py │ │ │ ├── proto_ospf.py │ │ │ └── proto_hsrp.py │ │ ├── proto_ip.py │ │ ├── proto_ether.py │ │ ├── proto_l2tp.py │ │ ├── proto_raw.py │ │ ├── broken │ │ │ ├── proto_ip.py │ │ │ ├── proto_l2tp.py │ │ │ ├── proto_raw.py │ │ │ ├── proto_icmp.py │ │ │ ├── proto_tftp.py │ │ │ ├── proto_ether.py │ │ │ ├── proto_arp.py │ │ │ ├── proto_ntp.py │ │ │ ├── proto_llc.py │ │ │ ├── proto_tcp.py │ │ │ └── proto_domain.py │ │ ├── proto_llc.py │ │ ├── proto_ppp.py │ │ ├── proto_rip.py │ │ ├── proto_udp.py │ │ ├── proto_vrrp.py │ │ ├── proto_tcp.py │ │ ├── proto_icmp6.py │ │ ├── proto_tftp.py │ │ ├── proto_icmp.py │ │ ├── proto_dhcp6.py │ │ ├── proto_ntp.py │ │ ├── proto_stp.py │ │ ├── proto_arp.py │ │ ├── proto_snmp.py │ │ ├── proto_gre.py │ │ ├── README │ │ ├── proto_domain.py │ │ └── helper.py │ ├── Makefile │ ├── static │ │ ├── vmm.tgf │ │ └── bc.lark │ ├── README.md │ ├── test_openssl.py │ ├── test_x11perf.py │ ├── test_bc.py │ ├── test_fuse.py │ ├── conftest.py │ ├── test_adjtime.py │ ├── test_tcpstress.py │ ├── test_benchmarks.py │ ├── test_vmm.py │ ├── vmm_states.py │ └── vmm_install.py └── 3rdparty │ ├── Makefile │ └── mangle.c ├── .gitignore ├── tools ├── unveil.cocci ├── kcovprint │ ├── sample.c │ ├── Makefile │ └── kcovprint.c ├── pledge.cocci ├── coverage.csv ├── coverage.sh ├── README.md ├── addpromise ├── addr2info └── snapmon ├── README.md ├── ansible.cfg ├── packer-templates ├── postinstall.sh └── README.md ├── .travis.yml └── patches ├── kvm-unit-tests-openbsd-63dd93ec3a10042d0d706f7a7e528395b84c928e.patch ├── oss-fuzz-opensmtpd.patch ├── kemufuzzer-780ef603c35bb31e941e14d19f98f696583dc2d9.patch └── oss-fuzz-libressl.patch /tests/afl-fuzz/static/dc/t27.in: -------------------------------------------------------------------------------- 1 | 1 2:x1Lx1:x1:x 2 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t17.in: -------------------------------------------------------------------------------- 1 | 1 2Rf 2 | Rf 3 | [foo][bar]rRf 4 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/gnuprefix.m4: -------------------------------------------------------------------------------- 1 | dumpdef() 2 | m4_dumpdef() 3 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t6.in: -------------------------------------------------------------------------------- 1 | [1ps.1Q3ps.]sa 2 | [3ps.lax]sb 3 | lbx 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .cache 2 | .ropeproject 3 | tests/.ropeproject 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/dumpdef.m4: -------------------------------------------------------------------------------- 1 | undefine(`unix')dnl 2 | dumpdef()dnl 3 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/switchd/switchd.conf: -------------------------------------------------------------------------------- 1 | listen on 0.0.0.0 port 6633 2 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/tcpdump/tcpdump.expression: -------------------------------------------------------------------------------- 1 | tcp port 80 and host sundown 2 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bc/t10.in: -------------------------------------------------------------------------------- 1 | for (;;) { 2 | } 3 | for (;a<1;) 4 | for (a=1;a<1;) 5 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bc/t6.in: -------------------------------------------------------------------------------- 1 | if (1) 2 | for (i=1; i <= 10; i++) 3 | while (1>0) 4 | -------------------------------------------------------------------------------- /tools/unveil.cocci: -------------------------------------------------------------------------------- 1 | @@ expression E; @@ 2 | 3 | -unveil(E) 4 | +unveil("/", "rwx") 5 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bc/t7.in: -------------------------------------------------------------------------------- 1 | a += 1 2 | b -= 2 3 | c *= 3 4 | d /= 4 5 | e ^= 5 6 | f %= 6 7 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/fatalwarnings.m4: -------------------------------------------------------------------------------- 1 | patsubst(`a') 2 | patsubst(`b') 3 | patsubst(`c') 4 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t18.in: -------------------------------------------------------------------------------- 1 | 0;ap 2 | 100;a; 3 | 99 0:a 4 | 100 100:a 5 | 0;ap 6 | 100;ap 7 | 8 | -------------------------------------------------------------------------------- /tests/libfuzzer/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: 3 | clang -g -O1 -fsanitize=fuzzer,address sample.cc -o sample 4 | -------------------------------------------------------------------------------- /tools/kcovprint/sample.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() { 4 | puts("Hello, world!"); 5 | } 6 | -------------------------------------------------------------------------------- /tools/pledge.cocci: -------------------------------------------------------------------------------- 1 | @@ expression E; @@ 2 | 3 | -pledge(E) 4 | +pledge("wpath cpath rpath flock", NULL) 5 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bc/t12.in: -------------------------------------------------------------------------------- 1 | print 1,.,1+1,"",3 2 | "X\Y" 3 | print "\a\b\t\f\n\q\ra\\b[] 4 | foo" 5 | . 6 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bc/t3.in: -------------------------------------------------------------------------------- 1 | for (i = 0; i < 10; i++) { 2 | a[i] = 3; 3 | if (x % 3 == 0) break; 4 | } 5 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t12.in: -------------------------------------------------------------------------------- 1 | 1 2 rf 2 | [a] [b] rf 3 | [c] 3 rf 4 | c 5 | r 6 | 1 7 | r 8 | 2 9 | rf 10 | -------------------------------------------------------------------------------- /tests/regress/settings.py: -------------------------------------------------------------------------------- 1 | DEF_PKG_PATH = "ftp://ftp.eu.openbsd.org/pub/OpenBSD/" 2 | DEF_VERSION = "snapshots" 3 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t19.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligurio/openbsd-tests/HEAD/tests/afl-fuzz/static/dc/t19.in -------------------------------------------------------------------------------- /tests/afl-fuzz/static/last/wtmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligurio/openbsd-tests/HEAD/tests/afl-fuzz/static/last/wtmp -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/gnuformat.m4: -------------------------------------------------------------------------------- 1 | format(`a%15sa%%b%-15sbc%3scd%-3sd', `string', `pouet', `toolong', `toolong2') 2 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/switchd.dict: -------------------------------------------------------------------------------- 1 | keyword_LISTEN_ON="listen on" 2 | keyword_TLS="tls" 3 | keyword_INCLUDE="include" 4 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/helper.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligurio/openbsd-tests/HEAD/tests/regress/tcpdump/helper.pyc -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bc/t5.in: -------------------------------------------------------------------------------- 1 | define f(a, b, c[]) { 2 | auto d,e,f; 3 | a=1; 4 | return (8); 5 | } 6 | 7 | f(1,2,g[]) 8 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t23.in: -------------------------------------------------------------------------------- 1 | [ 1Lxs. 2Q]s0 2 | [Sxlx 1!<0 lxlx 1-lx*Lxs. 1QLxs.0 1Q]s 3 | 4 | 5 | 6 | 1000lxps. 7 | q -------------------------------------------------------------------------------- /tests/afl-fuzz/static/keynote/spec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligurio/openbsd-tests/HEAD/tests/afl-fuzz/static/keynote/spec -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bc/t2.in: -------------------------------------------------------------------------------- 1 | while (1) { 2 | while (0) break; 3 | if (a == 1) break; 4 | if (a = 2) if (a = 3) break; 5 | } 6 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/ed/ed.commands: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligurio/openbsd-tests/HEAD/tests/afl-fuzz/static/ed/ed.commands -------------------------------------------------------------------------------- /tests/afl-fuzz/static/kdump/ktrace.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligurio/openbsd-tests/HEAD/tests/afl-fuzz/static/kdump/ktrace.out -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/args3.m4: -------------------------------------------------------------------------------- 1 | dnl invalid number of parameters for doifelse 2 | dnl do not segfault 3 | ifelse(A, "s",,,) 4 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t11.in: -------------------------------------------------------------------------------- 1 | [[IF]p]sa 2 | [[ELSE]p]sb 3 | 0 1aeb 5 | 0 0=aeb 6 | 0 1=aeb 7 | 1 0!=aeb 8 | 0 0!=aeb 9 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t24.in: -------------------------------------------------------------------------------- 1 | 10 66 ^p 2 | 10 67 ^p 3 | 10 68 ^p 4 | 10 69 ^p 5 | 10 135 ^p 6 | 10 136 ^p 7 | 10 137 ^p 8 | 10 138 ^p 9 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/tcpdump/sample.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligurio/openbsd-tests/HEAD/tests/afl-fuzz/static/tcpdump/sample.pcap -------------------------------------------------------------------------------- /tests/regress/Makefile: -------------------------------------------------------------------------------- 1 | PYTEST_OPT += --junit-xml=report-`date +%Y-%m-%d`.xml 2 | 3 | run: 4 | make -C ../tools 5 | pytest ${PYTEST_OPT} 6 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bc/t8.in: -------------------------------------------------------------------------------- 1 | while (a < 10) { 2 | a += 1; 3 | if (a == 2) if (1) continue; 4 | if (a == 7) if (1) continue; 5 | a 6 | } 7 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t10.in: -------------------------------------------------------------------------------- 1 | [1J]sM 2 | 1plMx 3 | !echo M aap 4 | lMp 5 | [aMa] 6 | 0 0!=M 7 | 1p 8 | 0 0!=MeM 9 | 1p 10 | M 11 | 2p 12 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t4.in: -------------------------------------------------------------------------------- 1 | [From toby@openbsd.org]sd 2 | [100SdSn lnld/ LnLd%Plax]sb16i0A2172656B63616820636420726568746F6E61207473754A[dZ1!=b]salax 3 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/gnusofterror.m4: -------------------------------------------------------------------------------- 1 | dnl $OpenBSD: gnusofterror.m4,v 1.1 2012/04/12 16:58:15 espie Exp $ 2 | include(`hey I do not exit')dnl 3 | abc 4 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/eval.m4: -------------------------------------------------------------------------------- 1 | dnl $OpenBSD: eval.m4,v 1.1 2004/05/12 21:24:37 espie Exp $ 2 | dnl expr parser 3 | eval(224&127) 4 | eval(224|127) 5 | eval(224&&127) 6 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bc/t13.in: -------------------------------------------------------------------------------- 1 | #line comment 2 | # 3 | define f() { 4 | return 5 | return 1+2 6 | return (1+2) 7 | return () 8 | } 9 | define f() 10 | { 11 | } 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Unofficial OpenBSD regression tests 2 | 3 | - [Wiki](https://github.com/ligurio/openbsd-tests/wiki) 4 | - [Code Coverage](https://ligurio.github.io/openbsd-tests/) 5 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/translit.m4: -------------------------------------------------------------------------------- 1 | dnl $OpenBSD: translit.m4,v 1.1 2010/03/23 20:11:52 espie Exp $ 2 | dnl first one should match, not second one 3 | translit(`onk*', `**', `p_') 4 | -------------------------------------------------------------------------------- /tests/3rdparty/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: 3 | ${CC} fusexmp.c -o fusexmp 4 | ${CC} mangle.c -o mangle 5 | ${CC} tcpstress.c -o tcpstress 6 | 7 | clean: 8 | rm -f mangle fusexmp tcpstress 9 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/gnupatterns2.m4: -------------------------------------------------------------------------------- 1 | define(`zoinx',dnl 2 | `patsubst($1,\(\w+\)\(\W*\),\1 )')dnl 3 | zoinx(acosl asinl atanl \ 4 | cosl sinl tanl \ 5 | coshl sinhl tanhl) 6 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t13.in: -------------------------------------------------------------------------------- 1 | # Comment 2 | # 3 | 4 | 1n 5 | [foo]n 6 | []an 7 | [a]an 8 | [bc]an 9 | 0an 10 | 32an 11 | 100an 12 | 100000100an 13 | [lidan1+dsi127>a]sa 14 | 32silax 15 | 10an 16 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/weird,name.m4: -------------------------------------------------------------------------------- 1 | dnl $OpenBSD: weird,name.m4,v 1.1 2001/10/10 11:16:28 espie Exp $ 2 | dnl trip up m4 if it forgets to quote filenames 3 | define(`A', `$2')dnl 4 | A(__file__)dnl 5 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/includes.m4: -------------------------------------------------------------------------------- 1 | dnl $OpenBSD: includes.m4,v 1.1 2008/08/16 10:02:32 espie Exp $ 2 | dnl Check that include can occur within parameters 3 | define(`foo', include(includes.aux))dnl 4 | foo 5 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/args2.m4: -------------------------------------------------------------------------------- 1 | dnl $OpenBSD: args2.m4,v 1.1 2008/08/16 09:57:12 espie Exp $ 2 | dnl Preserving spaces within nested parentheses 3 | define(`foo',`$1')dnl 4 | foo(( check for embedded spaces)) 5 | -------------------------------------------------------------------------------- /tests/regress/static/vmm.tgf: -------------------------------------------------------------------------------- 1 | 1 Start 2 | 2 v_started 3 | 3 v_stopped 4 | 4 v_paused 5 | # 6 | 1 2 e_once 7 | 2 3 e_stop 8 | 2 4 e_pause 9 | 3 2 e_start 10 | 3 4 e_pause 11 | 4 2 e_unpause 12 | 4 3 e_stop 13 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bc/t4.in: -------------------------------------------------------------------------------- 1 | while (0) while(1) while(2) while(3) while(4) while(5) while(6) while(7) { 2 | while (8) while (9) while (10) while (11) while(12) while(13) { 3 | while(14) while(15) { 4 | } 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t2.in: -------------------------------------------------------------------------------- 1 | [Adapted from a dc example by Michel Charpentier, see 2 | http://www.cs.unh.edu/~charpov/Programming/DC/ ]s. 3 | 10234252[p]s2[lip/dli%0=1dvsr]s12sid2%0=13sidvsr[dli%0=1lrli2+dsi!>.]ds.xd1<2 4 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/m4wrap2.m4: -------------------------------------------------------------------------------- 1 | dnl $OpenBSD: m4wrap2.m4,v 1.1 2001/10/06 10:59:11 espie Exp $ 2 | dnl another wrap test, to check that nothing adds bogus EOF 3 | m4wrap(`m4wrap_string')dnl 4 | define(m4wrap_string,`')dnl 5 | -------------------------------------------------------------------------------- /tests/libfuzzer/README.md: -------------------------------------------------------------------------------- 1 | ## libfuzzer tests 2 | 3 | - https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/lib/Makefile 4 | - https://llvm.org/docs/LibFuzzer.html 5 | - https://github.com/openssl/openssl/tree/master/fuzz 6 | -------------------------------------------------------------------------------- /tests/regress/README.md: -------------------------------------------------------------------------------- 1 | ### Usage 2 | 3 | ``` 4 | $ pkg_add py-test 5 | $ pip install pytest pytest-html 6 | $ pytest --self-contained-html --html=report-`date +%Y-%m-%d`.html \ 7 | --junit-xml=report-`date +%Y-%m-%d`.xml 8 | ``` 9 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/redef2.m4: -------------------------------------------------------------------------------- 1 | dnl $OpenBSD: redef2.m4,v 1.1 2014/12/07 14:32:34 jsg Exp $ 2 | dnl recursive macro redefinition 3 | define(`A', `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') 4 | A( 5 | define(`A', `bbbbbbbbbbbbbbbbbbb') 6 | ) 7 | -------------------------------------------------------------------------------- /tools/kcovprint/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean 2 | 3 | libkcovprint.so.1.0.0: kcovprint.c 4 | $(CC) -fPIC kcovprint.c -shared -Wl,-soname,libkcovprint.so.1 -o libkcovprint.so.1.0.0 5 | 6 | clean: 7 | $(RM) -f libkcovprint.so.1.0.0 8 | 9 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/gnueval.m4: -------------------------------------------------------------------------------- 1 | dnl $OpenBSD: gnueval.m4,v 1.1 2012/04/12 16:58:15 espie Exp $ 2 | dnl exponentiation is right associative 3 | eval(`4**2**3') 4 | dnl priority between unary operators and * 5 | eval(`4**2*3') 6 | eval(`-4**3') 7 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/m4wrap.m4: -------------------------------------------------------------------------------- 1 | dnl $OpenBSD: m4wrap.m4,v 1.1.1.1 2000/07/01 00:31:01 espie Exp $ 2 | dnl $NetBSD: m4wrap.m4,v 1.1 1997/12/30 23:30:57 cgd Exp $ 3 | define(`ateof', `TEXT AT EOF 4 | ')dnl 5 | m4wrap(`ateof()')dnl 6 | TEXT IN BODY 7 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/doas/doas.conf: -------------------------------------------------------------------------------- 1 | permit persist setenv { PKG_CACHE PKG_PATH } aja cmd pkg_add 2 | permit setenv { -ENV PS1=$DOAS_PS1 SSH_AUTH_SOCK } :wheel 3 | permit nopass tedu as root cmd /usr/sbin/procmap 4 | permit nopass keepenv root as root 5 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/gnupatterns.m4: -------------------------------------------------------------------------------- 1 | patsubst(`string with a + to replace with a minus', `+', `minus') 2 | patsubst(`string with aaaaa to replace with a b', `a+', `b') 3 | patsubst(`+string with a starting + to replace with a minus', `^+', `minus') 4 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/fibo.m4: -------------------------------------------------------------------------------- 1 | dnl $OpenBSD: fibo.m4,v 1.2 2000/07/01 14:18:39 espie Exp $ 2 | define(`copy', `$1')dnl 3 | define(`fibo',dnl 4 | `ifelse($1,0,`a',dnl 5 | $1,1,`b',dnl 6 | `copy(fibo(decr($1)))`'copy(fibo(decr(decr($1))))')')dnl 7 | fibo(N) 8 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t8.in: -------------------------------------------------------------------------------- 1 | [S1S,Salaps. 0;,ps. 99 1:,Las.L,s.L1s.0 1Q]sF 2 | 3 | 13sa 4 | 33 0:i 5 | 44 1:i 6 | 7 | 77 0:c 8 | 88 1:c 9 | 10 | lalilclFxps. 11 | 2lclclFxps. 12 | 13 | 0;ips. 14 | 1;ips. 15 | 0;cps. 16 | 1;cps. 17 | q 18 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bc/t11.in: -------------------------------------------------------------------------------- 1 | for (i = 0; i < 5; i++) { 2 | if (i > 0) { 3 | if (i < 3) { 4 | "i > 0 && i < 3" 5 | } else { 6 | "i > 0 && i >= 3" 7 | } 8 | } else "i == 0" 9 | " " 10 | if (i == 0) "0 " else if (i == 1) "1 " else "* " 11 | i 12 | } 13 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/br-args.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: args.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $ 2 | .TH BR-ARGS 1 "January 17, 2011" 3 | .SH NAME 4 | br-args \- arguments to .br macros 5 | .SH DESCRIPTION 6 | some 7 | text 8 | .br arg1 arg2 arg3 9 | more 10 | text 11 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/na-args.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: args.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ 2 | .TH NA-ARGS 1 "January 17, 2011" 3 | .SH NAME 4 | na-args \- arguments to .na macros 5 | .SH DESCRIPTION 6 | some 7 | text 8 | .na arg1 arg2 arg3 9 | more 10 | text 11 | -------------------------------------------------------------------------------- /tests/regress/test_openssl.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import subprocess 3 | 4 | 5 | @pytest.mark.slowtest 6 | def test_openssl(): 7 | openssl_cmd = ["openssl", "speed"] 8 | proc = subprocess.Popen(openssl_cmd) 9 | proc.wait() 10 | assert proc.returncode == 0 11 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t25.in: -------------------------------------------------------------------------------- 1 | 5k 2 | 2 2^p 3 | 2 _2^p 4 | _2 2^p 5 | _2 _2^p 6 | 2 3^p 7 | 2 _3^p 8 | _2 3^p 9 | _2 _3^p 10 | .2 2^p 11 | .2 _2^p 12 | _.2 2^p 13 | _.2 _2^p 14 | .2 3^p 15 | .2 _3^p 16 | _.2 3^p 17 | _.2 _3^p 18 | 0k 19 | 0.1 _1^p 20 | _0.2 _2^p 21 | _0.9 _9^p 22 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/sp-negative.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: negative.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ 2 | .TH SP-NEGATIVE 1 "July 12, 2012" 3 | .SH NAME 4 | sp-negative \- negative vertical spacing 5 | .SH DESCRIPTION 6 | first line 7 | .sp -1v 8 | .PP 9 | second line 10 | -------------------------------------------------------------------------------- /tools/coverage.csv: -------------------------------------------------------------------------------- 1 | # Userspace code coverage (index 0) 2 | # Release, Lines, Branches 3 | 6.3,20,18 4 | 6.2,14,14 5 | 6.1,16,11 6 | 6.0,13,10 7 | 8 | # Kernel code coverage (index 1) 9 | # Release, Lines, Branches 10 | #6.3,20,18 11 | #6.2,14,14 12 | #6.1,16,11 13 | #6.0,13,10 14 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t26.in: -------------------------------------------------------------------------------- 1 | 16i 2 | FF.F 3 | FF.F0 4 | FF.F00 5 | FF.F000 6 | FF.F0000 7 | F.100 8 | _F.1 9 | 8i 10 | 0.1 11 | 0.10 12 | 0.100 13 | 0.1000 14 | 0.7 15 | 0.70 16 | 0.7000 17 | 2i 18 | 1 19 | 1.1 20 | _1.1 21 | 1.01 22 | 1.11 23 | .001 24 | 0.0001 25 | _0.0011 26 | f 27 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/ps-ignore.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: ignore.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ 2 | .TH PS-IGNORE 1 "Febuary 5, 2011" 3 | .SH NAME 4 | ps-ignore \- ignoreing point size macros 5 | .SH DESCRIPTION 6 | normal text 7 | .ps -1 8 | small text 9 | .ps +1 10 | big text 11 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/Makefile: -------------------------------------------------------------------------------- 1 | ARGS != cd ${.CURDIR} && ls proto_*.py 2 | TARGETS ?= ${ARGS} 3 | REGRESS_TARGETS = ${TARGETS:S/^/run-regress-/} 4 | 5 | .for a in ${ARGS} 6 | run-regress-$a: $a 7 | @echo '\n======== $@ ========' 8 | @python $a 9 | .endfor 10 | 11 | .include 12 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/doas.dict: -------------------------------------------------------------------------------- 1 | prop_action1="permit" 2 | prop_action2="deny" 3 | prop_opt="options" 4 | prop_opt1="nopass" 5 | prop_opt2="persist" 6 | prop_opt3="keepenv" 7 | prop_opt4="options" 8 | prop_opt5="setenv" 9 | prop_ident="identity" 10 | prop_as="as" 11 | prop_cmd="cmd" 12 | prop_args="args" 13 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/args.m4: -------------------------------------------------------------------------------- 1 | dnl $OpenBSD: args.m4,v 1.1 2001/10/10 23:23:59 espie Exp $ 2 | dnl Expanding all arguments 3 | define(`A', `first form: $@, second form $*')dnl 4 | define(`B', `C')dnl 5 | A(1,2,`B') 6 | dnl indirection means macro can get called with argc == 2 ! 7 | indir(`A',1,2,`B') 8 | indir(`A') 9 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bc/t9.in: -------------------------------------------------------------------------------- 1 | define x() { 2 | for (i = 0; i < 10; i++) { 3 | i 4 | "a "; 5 | if (i == 5) { 6 | "b "; 7 | continue 8 | } 9 | "aaaaMbbbb" 10 | a=0; 11 | while (a < 4) { 12 | a += 1; 13 | if (a == 2) if (1) continue 14 | "c "; a 15 | } 16 | } 17 | } 18 | 19 | x() 20 | -------------------------------------------------------------------------------- /ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | host_key_checking = False 3 | gathering = smart 4 | gather_subset = all 5 | fact_caching = jsonfile 6 | fact_caching_timeout = 86400 7 | fact_caching_connection = .cache 8 | nocows = 0 9 | timeout = 10 10 | transport = paramiko 11 | accelerate_connect_timeout = 1.0 12 | retry_files_enabled = False 13 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dvmrpd/dvmrpd.conf: -------------------------------------------------------------------------------- 1 | # $OpenBSD: dvmrpd.conf,v 1.1 2014/07/11 16:36:35 deraadt Exp $ 2 | 3 | # macros 4 | #fast="10" 5 | 6 | # global configuration 7 | #mfc-update no 8 | 9 | group { 10 | robustness 4 11 | 12 | interface bge0 13 | interface vlan5 14 | interface vlan6 15 | interface gre0 16 | } 17 | 18 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/string-std.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: std.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ 2 | .TH STRING-STD 1 "June 18, 2017" 3 | .SH NAME 4 | string-std - expanding standard macros as strings 5 | .SH DESCRIPTION 6 | expanding the DT macro as a string: 7 | >>>\*[DT]<<< 8 | .PP 9 | .rn DT myname 10 | the same after renaming it: 11 | >>>\*[myname]<<< 12 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/translit2.m4: -------------------------------------------------------------------------------- 1 | translit(`[HAVE_abc/def.h 2 | ]', ` 3 | /.', `/ ') 4 | translit(`[HAVE_abc/def.h=]', `=/.', `/~~') 5 | translit(`0123456789', `0123456789', `ABCDEFGHIJ') 6 | translit(`0123456789', `[0-9]', `[A-J]') 7 | translit(`abc-0980-zyx', `abcdefghijklmnopqrstuvwxyz', `ABCDEFGHIJKLMNOPQRSTUVWXYZ') 8 | translit(`abc-0980-zyx', `[a-z]', `[A-Z]') 9 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/synch1.m4: -------------------------------------------------------------------------------- 1 | This is a test for multi MARK1 2 | line synchronization stuff MARK2 3 | # Let's include comments to see MARK3 4 | dnl 5 | dnl 6 | `quoted string' MARK4 7 | define(`A',`big string 8 | with a newline embedded')dnl 9 | Return to normal MARK5 10 | Let's try A 11 | And let's see where we are now. MARK6 12 | Okay, some more input. 13 | MARK7 14 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/string-infinite.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: infinite.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ 2 | .TH STRING-INFINITE 1 "December 3, 2010" 3 | .SH NAME 4 | string-infinite - endless recursion in string expansion 5 | .SH DESCRIPTION 6 | .ds recur \\*[recur] 7 | Blow up, 8 | (and do not \*[recur] print this) 9 | but still render following text correctly. 10 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/cc-basic.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: basic.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $ 2 | .TH CC-BASIC 1 "July 7, 2012" 3 | .SH NAME 4 | cc-basic \- basic usage of the cc request 5 | .SH DESCRIPTION 6 | first line 7 | .br 8 | second 9 | .cc : 10 | line 11 | :br 12 | third 13 | :cc ;bogus 14 | line 15 | ;br 16 | fourth 17 | ;cc 18 | line 19 | .br 20 | last line 21 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/ft-badargs.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: badargs.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ 2 | .TH "FT-BADARGS" 1 "July 5, 2014" 3 | .SH NAME 4 | ft-badargs \(en font request with bad arguments 5 | .SH DESCRIPTION 6 | default font 7 | .ft B 8 | bold 9 | .ft foo 10 | still bold 11 | .ft I bogus 12 | italic 13 | .ft P 14 | back to bold 15 | .ft 16 | back to italic 17 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/m4wrap3.m4: -------------------------------------------------------------------------------- 1 | dnl $OpenBSD: m4wrap3.m4,v 1.1 2005/03/02 10:12:41 espie Exp $ 2 | dnl Another test, this time for multiple wrappers 3 | dnl Check the behavior in presence of recursive m4wraps 4 | dnl both for POSIX m4 and for gnu-m4 mode 5 | m4wrap(`this is 6 | ')dnl 7 | m4wrap(`a string 8 | ')dnl 9 | m4wrap(`m4wrap(`recurse 10 | ')')dnl 11 | normal m4 stuff 12 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/tr.args.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: args.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ 2 | .TH TR-BASIC 1 "February 6, 2015" 3 | .SH NAME 4 | tr-args \- arguments of the tr request 5 | .SH DESCRIPTION 6 | no argument: 7 | .tr 8 | one character: 9 | .tr x 10 | >>x<< 11 | two characters: 12 | .tr xy 13 | >>x<< 14 | three characters: 15 | .tr xyz 16 | >>xz<< 17 | last line 18 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/ripd/ripd.conf: -------------------------------------------------------------------------------- 1 | # $OpenBSD: ripd.conf,v 1.1 2014/07/11 21:20:10 deraadt Exp $ 2 | 3 | fib-update yes 4 | redistribute static 5 | split-horizon poisoned 6 | triggered-updates yes 7 | 8 | interface rl0 { 9 | auth-type crypt 10 | auth-md-keyid 1 11 | auth-md 1 test 12 | cost 2 13 | } 14 | 15 | interface rl1 { 16 | auth-type simple 17 | auth-key secret 18 | } 19 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/it-badarg.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: badarg.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ 2 | .Dd $Mdocdate: July 4 2017 $ 3 | .Dt IT-BADARG 1 4 | .Os 5 | .Sh NAME 6 | .Nm it-badarg 7 | .Nd input line traps without numeric arguments 8 | .Sh DESCRIPTION 9 | .de mytrap 10 | traptext 11 | .. 12 | line 1 13 | .it mytrap 14 | line 2 15 | line 3 16 | .it 17 | line 4 18 | line 5 19 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/ds-nested.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: nested.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ 2 | .Dd $Mdocdate: July 4 2017 $ 3 | .Dt DS-NESTED 1 4 | .Os 5 | .Sh NAME 6 | .Nm ds-nested 7 | .Nd nested string expansion 8 | .Sh DESCRIPTION 9 | .ds foo bar 10 | .ds bar output 11 | This is the \*[\*[foo]]. 12 | .Pp 13 | .ds pi surprising 14 | This is \*[\*[Pi]]. 15 | This is \*(\*(Pi. 16 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/acme-client.conf: -------------------------------------------------------------------------------- 1 | domain example.com { 2 | alternative names { secure.example.com www.example.com } 3 | domain key "/etc/ssl/private/example.com.key" 4 | domain certificate "/etc/ssl/example.com.crt" 5 | domain full chain certificate "/etc/ssl/example.com.fullchain.pem" 6 | sign with letsencrypt 7 | challengedir "/var/www/acme" 8 | } 9 | 10 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/it-double.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: double.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ 2 | .TH IT-DOUBLE 1 2013-07-13 3 | .SH NAME 4 | it-double \- double input line trap 5 | .SH DESCRIPTION 6 | .de firstmacro 7 | firstmacro 8 | .. 9 | .de secondmacro 10 | secondmacro 11 | .. 12 | initial text 13 | .it 1 firstmacro 14 | .it 2 secondmacro 15 | first line 16 | second line 17 | third line 18 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/ds-escname.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: escname.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ 2 | .Dd $Mdocdate: July 4 2017 $ 3 | .Dt DS-ESCNAME 1 4 | .Os 5 | .Sh NAME 6 | .Nm ds-escname 7 | .Nd escape sequences in string names 8 | .Sh DESCRIPTION 9 | .ds std\\esc stdval 10 | Now \e*[std\\esc] is 11 | .Sq \*[std\\esc] . 12 | .Pp 13 | .ds esc\eesc escval 14 | Now \e*[esc] is 15 | .Sq \*[esc] . 16 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/patterns.m4: -------------------------------------------------------------------------------- 1 | dnl $OpenBSD: patterns.m4,v 1.4 2003/06/08 20:11:45 espie Exp $ 2 | patsubst(`quote s in string', `(s)', `\\\1') 3 | patsubst(`check whether subst 4 | over several lines 5 | works as expected', `^', `>>>') 6 | patsubst(`# This is a line to zap 7 | # and a second line 8 | keep this one', `^ *#.* 9 | ') 10 | dnl Special case: empty regexp 11 | patsubst(`empty regexp',`',`a ') 12 | -------------------------------------------------------------------------------- /tests/libfuzzer/sample.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | bool FuzzMe(const uint8_t *Data, size_t DataSize) { 5 | return DataSize >= 3 && 6 | Data[0] == 'F' && 7 | Data[1] == 'U' && 8 | Data[2] == 'Z' && 9 | Data[3] == 'Z'; // :‑< 10 | } 11 | 12 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { 13 | FuzzMe(Data, Size); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /packer-templates/postinstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -eu 4 | 5 | export PKG_PATH="$MIRROR/`uname -r`/packages/`uname -p`/" 6 | 7 | df -h 8 | 9 | COMPONENTS="ports src sys xenocara" 10 | RELEASE=`uname -r` 11 | for c in $COMPONENTS; do 12 | ftp "$MIRROR/$RELEASE/$c.tar.gz" -o /home/$c.tar.gz 13 | done 14 | 15 | pkg_add py-simplejson 16 | 17 | dd if=/dev/zero of=/EMPTY bs=1M || true 18 | rm -f /EMPTY 19 | 20 | sync 21 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | 3 | python: 4 | - "2.7" 5 | - "3.3" 6 | - "3.4" 7 | - "3.5" 8 | - "pypy" 9 | - "pypy3" 10 | 11 | install: 12 | - pip install flake8 pycodestyle 13 | 14 | script: 15 | - flake8 --ignore=W191,F401,E501,F403,F405,E226 . 16 | - pycodestyle --filename=*.py --ignore=E501 --count . 17 | 18 | notifications: 19 | email: 20 | on_success: change 21 | on_failure: always 22 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t9.in: -------------------------------------------------------------------------------- 1 | [10o[* ]Ppop]sb 2 | 3 | [[==== ]10oPp 2lbx 3 lbx 4 lbx 5lbx 6lbx 7 lbx 8lbx 9lbx 10lbx 16lbx 4 | 17 lbx 20lbx 99lbx 100lbx 101lbx 1000lbx 10000lbx 2 30^lbx 5 | [==== 6 | ]Ps.]sa 7 | 0lax 8 | 1lax 9 | 10lax 10 | 100lax 11 | 1000lax 12 | 10000lax 13 | _1lax 14 | _10lax 15 | _100lax 16 | _1000lax 17 | _10000lax 18 | 10.1lax 19 | 10.01lax 20 | 10.10lax 21 | 1024 22 | 25lax 23 | 125lax 24 | 2.1 500^lax 25 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/ft-basic-mdoc.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: badargs-mdoc.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ 2 | .Dd $Mdocdate: July 4 2017 $ 3 | .Dt FT-BADARGS-MDOC 1 4 | .Os 5 | .Sh NAME 6 | .Nm ft-badargs-mdoc 7 | .Nd font request with bad arguments 8 | .Sh DESCRIPTION 9 | default font 10 | .ft B 11 | bold 12 | .ft foo 13 | still bold 14 | .ft I bogus 15 | italic 16 | .ft P 17 | back to bold 18 | .ft 19 | back to italic 20 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dhclient.dict: -------------------------------------------------------------------------------- 1 | prop1="backoff-cutoff" 2 | prop2="initial-interval" 3 | prop3="link-timeout" 4 | prop4="reboot" 5 | prop5="retry" 6 | prop6="select-timeout" 7 | prop7="timeout" 8 | prop8="append" 9 | prop9="default" 10 | prop10="ignore" 11 | prop11="prepend" 12 | prop12="request" 13 | prop13="send" 14 | prop14="supersede" 15 | prop15="interface" 16 | prop16="lease" 17 | prop17="reject" 18 | prop18="require" 19 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/rm-basic.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: basic.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ 2 | .Dd $Mdocdate: July 4 2017 $ 3 | .Dt RM-BASIC 1 4 | .Os 5 | .Sh NAME 6 | .Nm rm-basic 7 | .Nd the remove macro request 8 | .Sh DESCRIPTION 9 | .de mymacro 10 | Hello 11 | .. 12 | .ds mystring world 13 | before rm: 14 | .mymacro 15 | \*[mystring]! 16 | .br 17 | .rm mymacro mystring 18 | after rm: 19 | .mymacro 20 | \*[mystring]! 21 | -------------------------------------------------------------------------------- /tools/coverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | gnuplot <0 0sylx 2<1 1sa 1sblbsc 1sd 1se 1dsas. 1 1=2 Lxs.Las.Lbs.Lcs.Lds.Les.Lgs.Lts.Lws.Lys.0 1Q]sE 9 | 10lExps. 10 | 10.6lExps. 11 | 12 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/ta-basic-man.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: basic-man.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ 2 | .TH TA-BASIC-MAN 1 "May 7, 2014" 3 | .SH NAME 4 | ta-basic-man \- setting tabstop positions in man(7) 5 | .SH DESCRIPTION 6 | .nf 7 | default: 8 | 1 2 3 9 | 10n: 10 | .ta 10n 11 | 1 2 3 12 | none: 13 | .ta 14 | 1 2 3 15 | 3n +6n T 4n +2n: 16 | .ta 3n +6n T 4n +2n 17 | 1 2 3 4 5 6 7 8 9 18 | default unit: 19 | .ta 3 +4 12 20 | 1 2 3 4 21 | rounding: 22 | .ta 0.26i T 1c 23 | 1 2 3 4 5 6 7 8 9 24 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/proto_tcp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | packet = TCP() 14 | re_output = "(000) ret #65535" 15 | exitcode = helper.chck(packet, re_output) 16 | sys.exit(exitcode) 17 | 18 | 19 | if __name__ == "__main__": 20 | main() 21 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/sp-badargs-mdoc.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: badargs-mdoc.in,v 1.5 2017/07/04 14:53:27 schwarze Exp $ 2 | .Dd $Mdocdate: July 4 2017 $ 3 | .Dt SP-BADARGS-MDOC 1 4 | .Os 5 | .Sh NAME 6 | .Nm sp-badargs-mdoc 7 | .Nd bad arguments to .sp macros in mdoc(7) 8 | .Sh DESCRIPTION 9 | no arguments: 10 | .sp 11 | one argument: 12 | .sp 2v 13 | two arguments: 14 | .sp 3v 2i 15 | no scaling unit specified: 16 | .sp 1 17 | trailing garbage: 18 | .sp 2vx 19 | garbage only: 20 | .sp xxx 21 | end of test document 22 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/proto_icmp6.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | packet = ICMPv6EchoRequest() 14 | re_output = "[|ether]\n" 15 | exitcode = helper.chck(packet, re_output) 16 | sys.exit(exitcode) 17 | 18 | 19 | if __name__ == "__main__": 20 | main() 21 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/rn-append.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: append.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ 2 | .Dd $Mdocdate: July 4 2017 $ 3 | .Dt RN-APPEND 1 4 | .Os 5 | .Sh NAME 6 | .Nm rn-append 7 | .Nd append to renamed standard macro 8 | .Sh DESCRIPTION 9 | original macro: 10 | .Bo in brackets 11 | .Bc 12 | .Pp 13 | renamed macro: 14 | .rn Bc myBc 15 | .Bo in brackets 16 | .myBc 17 | .Pp 18 | appending to macro: 19 | .am myBc 20 | .Pq appended words 21 | .. 22 | .Bo more in brackets 23 | .myBc 24 | final text 25 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/scale-horiz.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: horiz.in,v 1.5 2017/07/04 14:53:27 schwarze Exp $ 2 | .TH HORIZ 1 "December 23, 2014" 3 | .SH NAME 4 | horiz \- horizontal distances 5 | .SH DESCRIPTION 6 | initial text 7 | .in 240u 8 | 240u 9 | .in 3.6c 10 | 3.6c 11 | .in 0.003f 12 | 0.003f 13 | .in 2i 14 | 2i 15 | .in 500M 16 | 500M 17 | .in 6P 18 | 6P 19 | .in 36p 20 | 36p 21 | .in 10n 22 | 10n 23 | .in 5m 24 | 5m 25 | .in 79n 26 | 79n 27 | .in 1.5ix 28 | 1.5ix 29 | .in -6n 30 | -6n 31 | .PP 32 | final text 33 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/string-badargs-mdoc.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: badargs-mdoc.in,v 1.5 2017/07/04 14:53:27 schwarze Exp $ 2 | .Dd $Mdocdate: July 4 2017 $ 3 | .Dt SP-BADARGS-MDOC 1 4 | .Os 5 | .Sh NAME 6 | .Nm sp-badargs-mdoc 7 | .Nd bad arguments to .sp macros in mdoc(7) 8 | .Sh DESCRIPTION 9 | no arguments: 10 | .sp 11 | one argument: 12 | .sp 2v 13 | two arguments: 14 | .sp 3v 2i 15 | no scaling unit specified: 16 | .sp 1 17 | trailing garbage: 18 | .sp 2vx 19 | garbage only: 20 | .sp xxx 21 | end of test document 22 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/proto_tftp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | packet = IP()/UDP()/TFTP()/TFTP_DATA(block=0) 14 | re_output = "" 15 | exitcode = helper.chck(packet, re_output) 16 | sys.exit(exitcode) 17 | 18 | 19 | if __name__ == "__main__": 20 | main() 21 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/proto_icmp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | packet = IP(dst="192.168.1.1", ttl=128) / ICMP() 14 | re_output = "" 15 | exitcode = helper.chck(packet, re_output) 16 | sys.exit(exitcode) 17 | 18 | 19 | if __name__ == "__main__": 20 | main() 21 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/broken/proto_icmp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | packet = IP(dst="192.168.1.1", ttl=128) / ICMP() 14 | re_output = "" 15 | exitcode = helper.chck(packet, re_output) 16 | sys.exit(exitcode) 17 | 18 | 19 | if __name__ == "__main__": 20 | main() 21 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/broken/proto_tftp.py: -------------------------------------------------------------------------------- 1 | # /usr/local/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | packet = IP()/UDP()/TFTP()/TFTP_DATA(block=0) 14 | re_output = "" 15 | exitcode = helper.chck(packet, re_output) 16 | sys.exit(exitcode) 17 | 18 | 19 | if __name__ == "__main__": 20 | main() 21 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/not_finished/proto_gtp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from scapy.all import GTP 4 | import helper 5 | import logging 6 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 7 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 8 | 9 | 10 | def main(): 11 | 12 | # https://github.com/secdev/scapy/blob/master/scapy/contrib/gtp.py 13 | packet = GTP() 14 | re_output = "" 15 | helper.chck(packet, re_output) 16 | 17 | 18 | if __name__ == "__main__": 19 | main() 20 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/broken/proto_ether.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | packet = Ether() 14 | re_output = "08:00:27:e6:42:5a Broadcast loopback 14:\n\n" 15 | exitcode = helper.chck(packet, re_output) 16 | sys.exit(exitcode) 17 | 18 | 19 | if __name__ == "__main__": 20 | main() 21 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/not_finished/proto_carp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from scapy.all import CARP 4 | import helper 5 | import logging 6 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 7 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 8 | 9 | 10 | def main(): 11 | 12 | # https://github.com/secdev/Scapy/blob/master/scapy/contrib/carp.py 13 | packet = CARP() 14 | re_output = "" 15 | helper.chck(packet, re_output) 16 | 17 | 18 | if __name__ == "__main__": 19 | main() 20 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/not_finished/proto_cdp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from scapy.all import CDP 4 | from helper import chck 5 | import logging 6 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 7 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 8 | 9 | 10 | def main(): 11 | 12 | # https://github.com/secdev/Scapy/blob/master/scapy/contrib/cdp.py 13 | packet = CDP() 14 | re_output = "" 15 | chck(packet, re_output) 16 | 17 | 18 | if __name__ == "__main__": 19 | main() 20 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/not_finished/proto_ike.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from scapy.all import IKEv2 4 | import helper 5 | import logging 6 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 7 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 8 | 9 | 10 | def main(): 11 | 12 | # https://github.com/secdev/Scapy/blob/master/scapy/contrib/ikev2.py 13 | packet = IKEv2() 14 | re_output = "" 15 | helper.chck(packet, re_output) 16 | 17 | 18 | if __name__ == "__main__": 19 | main() 20 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/not_finished/proto_mpls.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from scapy.all import MPLS 4 | from helper import chck 5 | import logging 6 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 7 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 8 | 9 | 10 | def main(): 11 | 12 | # https://github.com/secdev/scapy/blob/master/scapy/contrib/mpls.py 13 | packet = MPLS() 14 | re_output = "" 15 | chck(packet, re_output) 16 | 17 | 18 | if __name__ == "__main__": 19 | main() 20 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/proto_dhcp6.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | packet = DHCP(options=[("message-type", "discover"), "end"]) 14 | re_output = "[|ether]\n" 15 | exitcode = helper.chck(packet, re_output) 16 | sys.exit(exitcode) 17 | 18 | 19 | if __name__ == "__main__": 20 | main() 21 | -------------------------------------------------------------------------------- /tools/README.md: -------------------------------------------------------------------------------- 1 | - `runtest` - is a program for running OpenBSD regression tests, written on C 2 | - `kcovprint` - is a helper to measure kernel code coverage 3 | - `addpromise` - script to add `unveil()` and `pledge()` promises, required to measure code coverage 4 | - `addr2info` - script to convert address to line, required to measure kernel code coverage 5 | - `coverage.sh` 6 | - `snapmon` - script to monitor new snapshots on OpenBSD mirror 7 | - `pledge.cocci` and `unveil.cocci` are semantic patches, to execute: `spatch -sp_file pledge.cocci test.c` 8 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bc/t15.in: -------------------------------------------------------------------------------- 1 | if (1 && 2) "ok1" 2 | if (0 && 2) "nok2" else "ok2" 3 | if (3 && 0) "nok3" else "ok3" 4 | if (0 && 0) "nok4" else "ok4" 5 | if (0 && 0 && 0) "nok5" else "ok5" 6 | if (0 && 1 && 0) "nok6" else "ok6" 7 | if (1 && 1 && 1) "ok7" else "nok7" 8 | print "\n" 9 | define f() { 10 | "f" 11 | } 12 | define g() { 13 | "g" 14 | return 1 15 | } 16 | if (f() && g()) { 17 | "nok8" 18 | } else "ok8" 19 | if (!f() && g()) { 20 | "ok9" 21 | } else "nok9" 22 | print "\n" 23 | if (1 < 2 && 3 < 4) "ok10" else "nok10" 24 | print "\n" 25 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/broken/proto_arp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | packet = ARP(op=ARP.who_has, psrc='192.168.1.2', pdst='192.168.1.1') 14 | re_output = "" 15 | exitcode = helper.chck(packet, re_output) 16 | sys.exit(exitcode) 17 | 18 | 19 | if __name__ == "__main__": 20 | main() 21 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/not_finished/proto_ripng.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from scapy.all import * 4 | import helper 5 | import logging 6 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 7 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 8 | 9 | 10 | def main(): 11 | 12 | # https://github.com/secdev/Scapy/blob/master/scapy/contrib/ripng.py 13 | print("ripng") 14 | packet = RIPNG() 15 | re_output = "" 16 | helper.chck(packet, re_output) 17 | 18 | 19 | if __name__ == "__main__": 20 | main() 21 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/not_finished/proto_etherip.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from scapy.all import EtherIP 4 | import helper 5 | import logging 6 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 7 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 8 | 9 | 10 | def main(): 11 | 12 | # https://github.com/secdev/Scapy/blob/master/scapy/contrib/etherip.py 13 | packet = EtherIP() 14 | re_output = "" 15 | helper.chck(packet, re_output) 16 | 17 | 18 | if __name__ == "__main__": 19 | main() 20 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/broken/proto_ntp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | packet = IP()/UDP(dport=123)/Raw(load=str("\x17\x00\x03\x2a") + str("\x00")*4) 14 | re_output = "" 15 | exitcode = helper.chck(packet, re_output) 16 | sys.exit(exitcode) 17 | 18 | 19 | if __name__ == "__main__": 20 | main() 21 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/not_finished/proto_vqp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from scapy.all import * 4 | import helper 5 | import logging 6 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 7 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 8 | 9 | 10 | def main(): 11 | 12 | # vqp 13 | # https://github.com/secdev/scapy/blob/master/scapy/contrib/vqp.py 14 | print("vqp") 15 | packet = VQP() 16 | re_output = "" 17 | helper.chck(packet, re_output) 18 | 19 | 20 | if __name__ == "__main__": 21 | main() 22 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/proto_ntp.py: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | packet = IP()/UDP(dport=123)/Raw(load=str("\x17\x00\x03\x2a") + str("\x00") * 4) 14 | re_output = "" 15 | exitcode = helper.chck(packet, re_output) 16 | sys.exit(exitcode) 17 | 18 | 19 | if __name__ == "__main__": 20 | main() 21 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/broken/proto_llc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | packet = LLC() 14 | re_output = "[|llc]\n" \ 15 | "00:00:00:00:00:00 00:02:00:0e:00:00 0000 0:" 16 | exitcode = helper.chck(packet, re_output) 17 | sys.exit(exitcode) 18 | 19 | 20 | if __name__ == "__main__": 21 | main() 22 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/not_finished/proto_bgp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from scapy.all import IP, TCP, BGPUpdate 4 | import helper 5 | import logging 6 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 7 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 8 | 9 | 10 | def main(): 11 | 12 | # https://github.com/secdev/Scapy/blob/master/scapy/contrib/bgp.py 13 | packet = IP()/TCP()/BGPUpdate() 14 | re_output = "" 15 | helper.chck(packet, re_output) 16 | 17 | 18 | if __name__ == "__main__": 19 | main() 20 | -------------------------------------------------------------------------------- /tests/regress/test_bc.py: -------------------------------------------------------------------------------- 1 | from hypothesis import given 2 | from hypothesis.strategies import text 3 | from lark import Lark 4 | import hypothesis.extra.lark 5 | import unittest 6 | 7 | 8 | class TestEncoding(unittest.TestCase): 9 | @given(text()) 10 | def test_decode_inverts_encode(self, s): 11 | # self.assertEqual(decode(encode(s)), s) 12 | print(s) 13 | m = hypothesis.extra.lark.from_lark( 14 | "python3.lark", start='hello_world') 15 | print(m) 16 | 17 | 18 | if __name__ == '__main__': 19 | unittest.main() 20 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/broken/proto_tcp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | packet = TCP() 14 | re_output = "00:00:00:00:00:00 00:14:00:50:00:00 5002 20:\n" \ 15 | " .....\n" 16 | exitcode = helper.chck(packet, re_output) 17 | sys.exit(exitcode) 18 | 19 | 20 | if __name__ == "__main__": 21 | main() 22 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/not_finished/proto_lldp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from scapy.all import LLDP 4 | import helper 5 | import logging 6 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 7 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 8 | 9 | 10 | def main(): 11 | 12 | # https://github.com/secdev/scapy/blob/master/scapy/contrib/lldp.py 13 | # load_contrib('lldp') 14 | packet = LLDP() 15 | re_output = "" 16 | chck(packet, re_output) 17 | 18 | 19 | if __name__ == "__main__": 20 | main() 21 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/ig-basic.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: basic.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ 2 | .Dd $Mdocdate: July 4 2017 $ 3 | .Dt IG-BASIC 1 4 | .Os 5 | .Sh NAME 6 | .Nm ig-basic 7 | .Nd ignored blocks 8 | .Sh DESCRIPTION 9 | no arguments 10 | .ig 11 | ignored text 12 | .. 13 | .br 14 | with end marker 15 | .ig end1 16 | ignored text 17 | .end1 18 | .br 19 | with two arguments 20 | .ig end2 excess 21 | ignored text 22 | .end2 23 | .br 24 | Here is a stray .. block ending, 25 | .. 26 | and then an .ig staying open until the end of the file: 27 | .ig 28 | ignored text 29 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/not_finished/proto_ospf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from scapy.all import OSPF 4 | import helper 5 | import logging 6 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 7 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 8 | 9 | 10 | def main(): 11 | 12 | # https://github.com/secdev/scapy/blob/master/scapy/contrib/ospf.py 13 | # load_contrib('ospf') 14 | print("ospf") 15 | packet = OSPF() 16 | re_output = "" 17 | helper.chck(packet, re_output) 18 | 19 | 20 | if __name__ == "__main__": 21 | main() 22 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/mtree.dict: -------------------------------------------------------------------------------- 1 | keyword1="cksum" 2 | keyword2="flags" 3 | keyword3="gid" 4 | keyword4="gname" 5 | keyword5="ignore" 6 | keyword6="link" 7 | keyword7="md5digest" 8 | keyword8="mode" 9 | keyword9="nlink" 10 | keyword10="nochange" 11 | keyword11="optional" 12 | keyword12="rmd160digest" 13 | keyword13="sha1digest" 14 | keyword14="sha256digest" 15 | keyword15="size" 16 | keyword16="time" 17 | keyword17="type" 18 | type1="block" 19 | type2="char" 20 | type3="dir" 21 | type4="fifo" 22 | type5="file" 23 | type6="link" 24 | type7="socket" 25 | keyword18="uid" 26 | keyword19=uname" 27 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/proto_stp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | packet = STP() 14 | re_output = "00:00:00:00:00:00 > 00:00:00:00:00:00 null I (s=0,r=0,C) len=17\n" \ 15 | ".....................\n" 16 | exitcode = helper.chck(packet, re_output) 17 | sys.exit(exitcode) 18 | 19 | 20 | if __name__ == "__main__": 21 | main() 22 | -------------------------------------------------------------------------------- /tests/regress/test_fuse.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import pytest 3 | from conftest import osname 4 | 5 | 6 | @pytest.fixture(scope="session") 7 | def make_fusexmp_bin(): 8 | cmd = ["gcc", "fusexmp.c", "-o", "fusexmp"] 9 | retcode = subprocess.call(cmd) 10 | assert retcode == 0 11 | 12 | 13 | @pytest.mark.skipif(osname != "OpenBSD", reason="supported only OpenBSD") 14 | @pytest.mark.usefixtures('make_fusexmp_bin') 15 | def test_fusexmp(): 16 | fusexmp_cmd = ["fusexmp", "speed"] 17 | proc = subprocess.Popen(fusexmp_cmd) 18 | proc.wait() 19 | assert proc.returncode == 0 20 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dhclient/dhclient.conf: -------------------------------------------------------------------------------- 1 | backoff-cutoff 2; 2 | initial-interval 1; 3 | link-timeout 10; 4 | reboot 0; 5 | retry 10; 6 | select-timeout 0; 7 | timeout 30; 8 | 9 | interface "em0" 10 | { 11 | supersede host-name "spaceship"; 12 | supersede domain-name "domain.home"; 13 | prepend domain-name-servers 127.0.0.1; 14 | request subnet-mask, 15 | broadcast-address, 16 | routers, 17 | domain-name, 18 | domain-name-servers, 19 | host-name; 20 | require routers, 21 | subnet-mask, 22 | domain-name-servers; 23 | } 24 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/vmd.dict: -------------------------------------------------------------------------------- 1 | keyword_INCLUDE="include" 2 | keyword_PREFIX="prefix" 3 | keyword_VM="vm" 4 | keyword_BOOT="boot" 5 | keyword_DISK="disk" 6 | keyword_LOCAL="local" 7 | keyword_INTERFACE="interface" 8 | keyword_LOCKED="locked" 9 | keyword_LLADDR="lladdr" 10 | keyword_RDOMAIN="rdomain" 11 | keyword_SWITCH="switch" 12 | keyword_INTERFACES="interfaces" 13 | keyword_MEMORY="memory" 14 | keyword_OWNER="owner" 15 | keyword_SWITCH="switch" 16 | keyword_ADD="add" 17 | keyword_ENABLE="enable" 18 | keyword_DISABLE="disable" 19 | keyword_GROUP="group" 20 | keyword_UP="up" 21 | keyword_DOWN="down" 22 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/sp-scaling-man.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: scaling-man.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ 2 | .TH SP-SCALING-MAN 1 "December 23, 2014" 3 | .SH NAME 4 | sp-scaling-man \- scaled arguments to .sp requests in man(7) 5 | .SH DESCRIPTION 6 | 20 basic units: 7 | .sp 20u 8 | 21 basic units: 9 | .sp 21u 10 | one centimeter: 11 | .sp 1c 12 | quarter of an inch: 13 | .sp 0.25i 14 | half a pica: 15 | .sp 0.5P 16 | one pica: 17 | .sp 1P 18 | 6 points: 19 | .sp 6p 20 | 7 points: 21 | .sp 7p 22 | one en: 23 | .sp 1n 24 | three en: 25 | .sp 3n 26 | two em: 27 | .sp 2m 28 | end of test document 29 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/smtpd/smtpd.conf: -------------------------------------------------------------------------------- 1 | # $OpenBSD: smtpd.conf,v 1.9 2016/05/03 18:43:45 jung Exp $ 2 | 3 | # This is the smtpd server system-wide configuration file. 4 | # See smtpd.conf(5) for more information. 5 | 6 | table aliases file:/etc/mail/aliases 7 | 8 | # To accept external mail, replace with: listen on all 9 | # 10 | listen on lo0 11 | 12 | # Uncomment the following to accept external mail for domain "example.org" 13 | # 14 | # accept from any for domain "example.org" alias deliver to mbox 15 | accept for local alias deliver to mbox 16 | accept from local for any relay 17 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/redef.m4: -------------------------------------------------------------------------------- 1 | dnl $OpenBSD: redef.m4,v 1.2 2001/09/27 22:40:58 espie Exp $ 2 | dnl check all properties of builtin are passed on, including args behavior 3 | define(`mybuiltin',defn(`builtin'))dnl 4 | builtin mybuiltin 5 | define(`mydefine',defn(`define'))dnl 6 | mydefine(`mydefn',defn(`defn'))dnl 7 | mydefine(`myundefine',mydefn(`undefine'))dnl 8 | myundefine(`defn')dnl 9 | myundefine(`define')dnl 10 | myundefine(`undefine')dnl 11 | mydefine(`mydef2',mydefn(`mydefine'))dnl 12 | mydefine(`mydef', mydefn(`define'))dnl 13 | myundefine(`mydefine')dnl 14 | mydef2(`A',`B')dnl 15 | mydef(`C',`D')dnl 16 | A C 17 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/proto_arp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | packet = ARP(op=ARP.who_has, psrc='192.168.1.2', pdst='192.168.1.1') 14 | re_output = "00:01:08:00:27:e6 00:01:08:00:06:04 425a 28:\n" \ 15 | ".............." 16 | exitcode = helper.chck(packet, re_output) 17 | sys.exit(exitcode) 18 | 19 | 20 | if __name__ == "__main__": 21 | main() 22 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/proto_snmp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | packet = UDP(sport=161) / SNMP(community="private", PDU="") 14 | re_output = "00:00:30:0c:02:01 sap 70 > 00:a1:00:a2:00:16 sap 07 rr (r=52,C) len=4\n" \ 15 | ".private\n" 16 | exitcode = helper.chck(packet, re_output) 17 | sys.exit(exitcode) 18 | 19 | 20 | if __name__ == "__main__": 21 | main() 22 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/sp-scaling-mdoc.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: scaling-mdoc.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ 2 | .Dd $Mdocdate: July 4 2017 $ 3 | .Dt SP-SCALING-MDOC 1 4 | .Os 5 | .Sh NAME 6 | .Nm sp-scaling-mdoc 7 | .Nd scaled arguments to .sp requests in mdoc(7) 8 | .Sh DESCRIPTION 9 | 20 basic units: 10 | .sp 20u 11 | 21 basic units: 12 | .sp 21u 13 | one centimeter: 14 | .sp 1c 15 | quarter of an inch: 16 | .sp 0.25i 17 | half a pica: 18 | .sp 0.5P 19 | one pica: 20 | .sp 1P 21 | 6 points: 22 | .sp 6p 23 | 7 points: 24 | .sp 7p 25 | one en: 26 | .sp 1n 27 | three en: 28 | .sp 3n 29 | two em: 30 | .sp 2m 31 | end of test document 32 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/ta-basic-mdoc.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: basic-mdoc.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ 2 | .Dd $Mdocdate: July 4 2017 $ 3 | .Dt TA-BASIC-MDOC 1 4 | .Os 5 | .Sh NAME 6 | .Nm ta-basic-mdoc 7 | .Nd setting tabstop positions in mdoc(7) 8 | .Sh DESCRIPTION 9 | .Bd -unfilled 10 | default: 11 | 1 2 3 12 | 10n: 13 | .ta 10n 14 | 1 2 3 15 | none: 16 | .ta 17 | 1 2 3 18 | 3n +6n T 4n +2n: 19 | .ta 3n +6n T 4n +2n 20 | 1 2 3 4 5 6 7 8 9 21 | .Ed 22 | .Pp 23 | literal: 24 | .Bd -literal -compact 25 | 1 2 3 26 | .Ed 27 | .Pp 28 | after literal: 29 | .br 30 | 1 2 3 31 | .Pp 32 | default unit: 33 | .br 34 | .ta 3 +4 12 35 | 1 2 3 4 36 | -------------------------------------------------------------------------------- /tests/regress/conftest.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import os 3 | from settings import DEF_VERSION, DEF_PKG_PATH 4 | 5 | 6 | def service(service_name, action): 7 | proc_cmd = ["/etc/rc.d/%s" % service_name, action] 8 | proc = subprocess.Popen(proc_cmd) 9 | proc.wait() 10 | assert proc.returncode == 0 11 | 12 | 13 | def addpkg(package, version=DEF_VERSION, pkg_path=DEF_PKG_PATH): 14 | pkg_path = os.path.join(pkg_path, version, 'packages') 15 | proc = subprocess(['pkg_add', package]) 16 | proc.wait() 17 | assert proc.returncode == 0 18 | 19 | 20 | def osname(): 21 | return subprocess.check_output(["uname", "-s"]) 22 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/ospf6d/ospf6d.conf: -------------------------------------------------------------------------------- 1 | # $OpenBSD: ospf6d.conf,v 1.1 2014/07/11 16:36:35 deraadt Exp $ 2 | 3 | # global configuration 4 | # router-id 10.0.0.1 5 | # fib-update no 6 | # stub router no 7 | # spf-delay 1 8 | # spf-holdtime 5 9 | 10 | # hello-interval 10 11 | # metric 10 12 | # retransmit-interval 5 13 | # router-dead-time 40 14 | # router-priority 1 15 | # transmit-delay 1 16 | 17 | # rtlabel "DMZ" external-tag 1 18 | 19 | # areas 20 | area 0.0.0.5 { 21 | interface em0 { 22 | router-dead-time 20 23 | } 24 | 25 | interface em1 { 26 | } 27 | } 28 | 29 | area 0.0.0.7 { 30 | interface em2 { 31 | router-priority 5 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/not_finished/proto_hsrp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from scapy.all import Ether 4 | import helper 5 | import logging 6 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 7 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 8 | 9 | 10 | def main(): 11 | 12 | packet = Ether(src="00:0C:07:AC:02", dst="00:5E:00:00:02")/IP(dst="224.0.0.2", 13 | src='attacerIP', ttl=1)/UDP()/HSRP(priority=230, virtualIP='virtualIP') 14 | re_output = "" 15 | helper.chck(packet, re_output) 16 | 17 | 18 | if __name__ == "__main__": 19 | main() 20 | -------------------------------------------------------------------------------- /tests/regress/test_adjtime.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import subprocess 3 | from conftest import service 4 | from conftest import osname 5 | 6 | 7 | @pytest.mark.skipif(osname != "OpenBSD") 8 | def test_adjtime(): 9 | service("ntpd", "start") 10 | print("Sync time") 11 | proc = subprocess.Popen(["ntpd", "-s"]) 12 | proc.wait() 13 | service("ntpd", "stop") 14 | print("Move time forward for 5 minutes") 15 | # time=`date "+ %M"` 16 | # date $(($time+5)) > /dev/null 2>&1 && date "+ %H:%M" 17 | print("Validate adjustment") 18 | # ntpd -s && sleep 60 && pkill -TERM ntpd 19 | # date "+ %H:%M" 20 | # [ `date "+ %M"` -eq $(($time+1)) ]; then 21 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/esyscmd.m4: -------------------------------------------------------------------------------- 1 | changequote(`{',`}')dnl 2 | dnl 3 | esyscmd({sh -c "m4< 13 | 14 | # TODO: 15 | # 16 | # 802_11 17 | # atalk 18 | # atm 19 | # cnfp 20 | # decnet 21 | # dvmrp 22 | # enc 23 | # fddi 24 | # frag6 25 | # iapp 26 | # igrp 27 | # ip6 28 | # ip6opts 29 | # ipsec 30 | # ipx 31 | # isoclns 32 | # krb 33 | # lwres 34 | # netbios 35 | # nfs 36 | # null 37 | # ofp 38 | # ospf6 39 | # pflog 40 | # pfsync 41 | # pim 42 | # rt6 43 | # sl 44 | # slow 45 | # sunrpc 46 | # timed 47 | # udpencap 48 | # wb 49 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/ti-basic-mdoc.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: basic-mdoc.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ 2 | .Dd $Mdocdate: July 4 2017 $ 3 | .Dt TI-BASIC-MDOC 1 4 | .Os 5 | .Sh NAME 6 | .Nm ti-basic-mdoc 7 | .Nd temporary indent in mdoc(7) 8 | .Sh DESCRIPTION 9 | initial text 10 | .ti 10n 11 | This text is indented. 12 | However, the indent is temporary, 13 | so as soon as the line wraps, it is gone. 14 | .ti +10n 15 | The temporary indent can be relative. 16 | All the same, it will expire in the usual way. 17 | .ti -3n 18 | It is also possible to temporarily reduce the indentation, 19 | but that will also last until the next line break only. 20 | .ti -10n 21 | Reducing by more than the current offset 22 | starts the next line at the physical left margin. 23 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/proto_domain.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | udp_packet = IP() / UDP(dport=53) / DNS(qd=DNSQR(qname="google.com")) 14 | udp_re_output = "" 15 | udp_retcode = helper.chck(udp_packet, udp_re_output) 16 | 17 | tcp_packet = TCP(dport=53) 18 | tcp_re_output = "" 19 | tcp_retcode = helper.chck(tcp_packet, tcp_re_output) 20 | 21 | if tcp_retcode and udp_retcode: 22 | sys.exit(0) 23 | else: 24 | sys.exit(1) 25 | 26 | 27 | if __name__ == "__main__": 28 | 29 | main() 30 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/string-name.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: name.in,v 1.4 2017/07/04 14:53:27 schwarze Exp $ 2 | .Dd $Mdocdate: July 4 2017 $ 3 | .Dt STRING-NAME 1 4 | .Os 5 | .Sh NAME 6 | .Nm string-name 7 | .Nd torturing .ds with weird string names 8 | .Sh DESCRIPTION 9 | .ds norm value of norm 10 | .ds "quot" value of "quot" 11 | .ds bs\e value of bs\ee 12 | .ds bs\\e value of bs\e\ee 13 | .ds bl\ e value of bl\e e 14 | norm: \*[norm] 15 | .br 16 | norm without closing brace: \*[norm 17 | .br 18 | quot: \*[quot] 19 | .br 20 | "quot": \*["quot"] 21 | .br 22 | bs\e\ee: \*[bs\\e] 23 | .\".br 24 | .\"bs\ee: \*[bs\e] 25 | .br 26 | bse: \*[bse] 27 | .br 28 | bs: \*[bs] 29 | .\".br 30 | .\"bl\e e: \*[bl\ e] 31 | .br 32 | bl e: \*[bl e] 33 | .br 34 | ble: \*[ble] 35 | .br 36 | bl: \*[bl] 37 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/broken/proto_domain.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from scapy.all import * 5 | import helper 6 | import logging 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def main(): 12 | 13 | udp_packet = IP() / UDP(dport=53) / DNS(qd=DNSQR(qname="google.com")) 14 | udp_re_output = "" 15 | udp_retcode = helper.chck(udp_packet, udp_re_output) 16 | 17 | tcp_packet = TCP(dport=53) 18 | tcp_re_output = "" 19 | tcp_retcode = helper.chck(tcp_packet, tcp_re_output) 20 | 21 | if tcp_retcode and udp_retcode: 22 | sys.exit(0) 23 | else: 24 | sys.exit(1) 25 | 26 | 27 | if __name__ == "__main__": 28 | 29 | main() 30 | -------------------------------------------------------------------------------- /tests/regress/tcpdump/helper.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from scapy.all import * 4 | import logging 5 | import os 6 | import subprocess as sub 7 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 8 | logging.getLogger("scapy.runtime").setLevel(logging.WARNING) 9 | 10 | 11 | def chck(pkt, re_output): 12 | 13 | pcap_name = 'sample.pcap' 14 | wrpcap(pcap_name, pkt) 15 | tcpdump_cmd = ['tcpdump', '-A', '-t', '-r', pcap_name] 16 | p = sub.Popen(tcpdump_cmd, stdout=sub.PIPE, stderr=sub.PIPE) 17 | output = p.communicate()[0] 18 | retcode = p.wait() 19 | 20 | if retcode != 0 or re_output != output: 21 | pkt.show() 22 | print(output, re_output) 23 | return 1 24 | else: 25 | os.remove(pcap_name) 26 | return 0 27 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t1.in: -------------------------------------------------------------------------------- 1 | [1234]Xp s. 2 | 12.345Xp s. 3 | []Xp s. 4 | 1Xp s. 5 | _1Xp s. 6 | 3.99999999999999Xp s. 7 | _3.99999999999999Xp s. 8 | []Zp s. 9 | [aap]Zp s. 10 | [aapnoot]Zp s. 11 | 0Zp s. 12 | 1Zp s. 13 | _1Zp s. 14 | 3.99999999999999Zp s. 15 | _3.99999999999999Zp s. 16 | _1 3^p s. 17 | _1 3.0^p s. 18 | 2.0 10^p s. 19 | 100000000000000000000000000000000000000000000000000000000000000000000 99^ps. 20 | 30k 21 | 10000000000000000000000000000000000000vp s. 22 | 0.3219832098321890321903903218321098321098213vp s. 23 | [ps.]sa 24 | 1 0 1 25 | a 30 | 4 6 7 31 | !>a 32 | 5 8 9 33 | =a 34 | 6 10 10 35 | =a 36 | 7 11 11 37 | !=a 38 | 8 12 13 39 | !=a 40 | c 41 | [OK] 0:a 0Sa [NOT OK] 0:a La 0;ap 42 | [lip1+sili10>a]sa0silax 43 | c 44 | zp s. 45 | 1 2 3 z ps. 46 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/ospfd/ospfd.conf: -------------------------------------------------------------------------------- 1 | # $OpenBSD: ospfd.conf,v 1.1 2014/07/11 16:36:35 deraadt Exp $ 2 | 3 | # macros 4 | password="secret" 5 | 6 | # global configuration 7 | # router-id 10.0.0.1 8 | # fib-update no 9 | # stub router no 10 | # spf-delay 1 11 | # spf-holdtime 5 12 | 13 | # auth-key $password 14 | # auth-type simple 15 | # hello-interval 10 16 | # metric 10 17 | # retransmit-interval 5 18 | # router-dead-time 40 19 | # router-priority 1 20 | # transmit-delay 1 21 | 22 | # rtlabel "DMZ" external-tag 1 23 | 24 | # areas 25 | area 0.0.0.5 { 26 | interface em0 { 27 | auth-type simple 28 | auth-key $password 29 | } 30 | 31 | interface em1 { 32 | auth-type simple 33 | auth-key unknown 34 | } 35 | } 36 | 37 | area 0.0.0.7 { 38 | interface em2 { 39 | router-priority 5 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/string-escape.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: escape.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ 2 | .TH STRING-ESCAPE 1 "December 3, 2010" 3 | .SH NAME 4 | string-escape - preventing string interpolation 5 | .SH DESCRIPTION 6 | .ds right wrong 7 | .ds inner *[right] 8 | .ds outer \\*[inner] 9 | .SS Normal interpolation 10 | result: \*[inner] 11 | .PP 12 | The above line must be "result: *[right]". 13 | .SS Intervening character 14 | result: \e*[right] 15 | .PP 16 | The above line must be "result: backslash*[right]", 17 | not "result: rong". 18 | .SS Escaped backslash 19 | result: \\*[right] 20 | .PP 21 | The above line must be "result: backslash*[right]", 22 | not "result: rong". 23 | .SS Delayed interpolation 24 | result: \*[outer] 25 | .PP 26 | The above line must be "result: *[right]", 27 | not "result: wrong". 28 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bc/t14.in: -------------------------------------------------------------------------------- 1 | if ((0 == 0)) "ok" else "nok" 2 | if ((1 == 0)) "nok" else "ok" 3 | if ((0 == 1)) "nok" else "ok" 4 | print "\n" 5 | if ((0 != 0)) "nok" else "ok" 6 | if ((1 != 0)) "ok" else "nok" 7 | if ((0 != 1)) "ok" else "nok" 8 | print "\n" 9 | if ((0 == 0)) "ok" else "nok" 10 | if ((1 == 0)) "nok" else "ok" 11 | if ((0 == 1)) "nok" else "ok" 12 | print "\n" 13 | if ((0 < 1)) "ok" else "nok" 14 | if ((1 < 0)) "nok" else "ok" 15 | if ((1 < 1)) "nok" else "ok" 16 | print "\n" 17 | if ((0 <= 1)) "ok" else "nok" 18 | if ((1 <= 0)) "nok" else "ok" 19 | if ((1 <= 1)) "ok" else "nok" 20 | print "\n" 21 | if ((0 > 1)) "nok" else "ok" 22 | if ((1 > 0)) "ok" else "nok" 23 | if ((1 > 1)) "nok" else "ok" 24 | print "\n" 25 | if ((0 >= 1)) "nok" else "ok" 26 | if ((1 >= 0)) "ok" else "nok" 27 | if ((1 >= 1)) "ok" else "nok" 28 | print "\n" 29 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t15.in: -------------------------------------------------------------------------------- 1 | [s. 2]s1 2 | [[ok1]P]s0 3 | 1d0!=1 0!=0 4 | [s. 2]s1 5 | [[nok2]P]s0 6 | [[ok2]P]s2 7 | 0d0!=1 0!=0e2 8 | [s. 0]s1 9 | [[nok3]P]s0 10 | [[ok3]P]s2 11 | 3d0!=1 0!=0e2 12 | [s. 0]s1 13 | [[nok4]P]s0 14 | [[ok4]P]s2 15 | 0d0!=1 0!=0e2 16 | [s. 0]s1 17 | [s. 0]s2 18 | [[nok5]P]s0 19 | [[ok5]P]s3 20 | 0d0!=1d0!=2 0!=0e3 21 | [s. 1]s1 22 | [s. 0]s2 23 | [[nok6]P]s0 24 | [[ok6]P]s3 25 | 0d0!=1d0!=2 0!=0e3 26 | [s. 1]s1 27 | [s. 1]s2 28 | [[ok7]P]s0 29 | [[nok7]P]s3 30 | 1d0!=1d0!=2 0!=0e3 31 | [ 32 | ]n 33 | [[f]P0 1Q]s 34 | 35 | 36 | [[g]P 1 1Q0 1Q]s 37 | 38 | 39 | [s.lx]s1 40 | [[nok8]P]s0 41 | [[ok8]P]s2 42 | lxd0!=1 0!=0e2 43 | [s.lx]s1 44 | [[ok9]P]s0 45 | [[nok9]P]s2 46 | lxNd0!=1 0!=0e2 47 | [ 48 | ]n 49 | [s. 4 3(]s1 50 | [[ok10]P]s0 51 | [[nok10]P]s2 52 | 2 1(d0!=1 0!=0e2 53 | [ 54 | ]n 55 | q -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/ds-quoting.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: quoting.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ 2 | .Dd $Mdocdate: July 4 2017 $ 3 | .Dt DS-QUOTING 1 4 | .Os 5 | .Sh NAME 6 | .Nm ds-quoting 7 | .Nd quote handling by the define string request 8 | .Sh DESCRIPTION 9 | .ds foo initial definition 10 | no quoting: \*[foo] 11 | .br 12 | .ds foo redefinition 13 | still no quoting: \*[foo] 14 | .br 15 | .ds foo "string value 16 | leading quotes: \*[foo] 17 | .br 18 | .ds foo "string value" 19 | leading and trailing quotes: \*[foo] 20 | .br 21 | .ds foo "string" value 22 | leading and middle quotes: \*[foo] 23 | .br 24 | .ds foo 'string value" 25 | leading apostrophe, trailing quotes: \*[foo] 26 | .br 27 | .ds foo string value" 28 | leading blank, trailing quotes: \*[foo] 29 | .br 30 | .ds foo 31 | empty string: x\*[foo]x 32 | .br 33 | end of test document 34 | -------------------------------------------------------------------------------- /tests/regress/test_benchmarks.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import mmap 3 | import socket 4 | 5 | 6 | def test_socket(benchmark): 7 | def socket_call(): 8 | socket.socket(socket.AF_INET, socket.SOCK_STREAM) 9 | benchmark.pedantic(socket_call, iterations=1000, rounds=100) 10 | 11 | 12 | def test_bind(benchmark): 13 | def bind_call(): 14 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 15 | s.bind(('', 9090)) 16 | benchmark.pedantic(bind_call, iterations=1000, rounds=100) 17 | 18 | 19 | def test_mmap(benchmark): 20 | with open("test_mmap.txt", "wb") as f: 21 | f.write("Hello, OpenBSD!\n") 22 | 23 | def mmap_call(): 24 | with open("test_mmap.txt", "r+b") as f: 25 | mm = mmap.mmap(f.fileno(), 0) 26 | mm.close() 27 | benchmark.pedantic(mmap_call, iterations=100, rounds=10) 28 | -------------------------------------------------------------------------------- /tests/regress/test_vmm.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import random 3 | import subprocess 4 | 5 | def make_random_c_program(): 6 | CSMITH_ARGS = "--seed %d" % random.randint(1, 1000) 7 | PROG_SOURCE_PATH = "/tmp/sample.c" 8 | PROG_BIN_PATH = "/tmp/sample" 9 | 10 | prog_text = subprocess.check_output(["csmith", CSMITH_ARGS.split(" ")]) 11 | with open(PROG_SOURCE_PATH, "w") as sample: 12 | sample.write(prog_text) 13 | 14 | subprocess.check_call(["gcc", "-I/usr/include/csmith/", "-w", PROG_SOURCE_PATH, "-o", PROG_BIN_PATH]) 15 | subprocess.check_call([PROG_BIN_PATH]) 16 | 17 | 18 | def test_random_c_program(): 19 | 20 | ITER_NUMBER = 100 21 | for i in range(0, ITER_NUMBER): 22 | make_random_c_program() 23 | 24 | 25 | def test_setup_openbsd(): 26 | 27 | # vmm_install 28 | 29 | 30 | def test_start_stop(): 31 | 32 | # vmm_states 33 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/ldpd/ldpd.conf: -------------------------------------------------------------------------------- 1 | # $OpenBSD: ldpd.conf,v 1.2 2016/06/05 03:29:33 renato Exp $ 2 | 3 | # macros 4 | password="secret" 5 | 6 | # global configuration 7 | # router-id 10.0.0.1 8 | # fib-update no 9 | # transport-preference ipv4 10 | 11 | address-family ipv4 { 12 | # explicit-null yes 13 | # keepalive 120 14 | # targeted-hello-accept yes 15 | # transport-address 10.0.0.1 16 | 17 | interface em0 18 | interface vlan5 { 19 | link-hello-holdtime 9 20 | link-hello-interval 3 21 | } 22 | targeted-neighbor 172.16.1.10 23 | } 24 | 25 | neighbor 192.168.1.10 { 26 | password $password 27 | } 28 | 29 | l2vpn CUST_A type vpls { 30 | bridge bridge0 31 | interface em1 32 | pseudowire mpw0 { 33 | # control-word no 34 | # status-tlv no 35 | neighbor-id 10.0.1.5 36 | pw-id 100 37 | } 38 | pseudowire mpw1 { 39 | neighbor-id 10.0.2.8 40 | pw-id 100 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packer-templates/README.md: -------------------------------------------------------------------------------- 1 | # OpenBSD Packer Template 2 | 3 | This directory contains template for building OpenBSD boxes using 4 | [Packer](https://packer.io). Supports VirtualBox, VMware, and QEMU/LibVirt 5 | providers. 6 | 7 | ### Using Vagrant box 8 | 9 | $ vagrant init sergeyb/openbsd 10 | $ vagrant up --provider virtualbox 11 | $ vagrant ssh 12 | 13 | ### Usage 14 | 15 | [Download](http://www.packer.io/downloads.html) the latest packer and unzip to 16 | the appropriate directory. 17 | 18 | $ packer build openbsd-snapshot.json 19 | 20 | If you want to build only VirtualBox: 21 | 22 | $ packer build -only=virtualbox-iso openbsd-snapshot.json 23 | 24 | The result box will be available in `builds/` directory. 25 | 26 | If you want to build custom OpenBSD version: 27 | 28 | $ packer build -var "iso_url=${OPENBSD_URL}" -var "iso_checksum=${OPENBSD_CHECKSUM}" openbsd-snapshot.json 29 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/ll-basic.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: basic.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ 2 | .Dd $Mdocdate: July 4 2017 $ 3 | .Dt LL-BASIC 1 4 | .Os 5 | .Sh NAME 6 | .Nm ll-basic 7 | .Nd changing the line length 8 | .Sh DESCRIPTION 9 | This is a longer text to demonstrate the default line length. 10 | In ASCII mode, it is expected to break at column 78. 11 | .Pp 12 | .ll 38n 13 | This is another long text to demonstrate shorter lines. 14 | In ASCII mode, it is expected to break at column 38. 15 | .Pp 16 | .ll 17 | This is a longer text after switching back to the default line length. 18 | In ASCII mode, it is expected to break at column 78. 19 | .Pp 20 | .ll +100n 21 | This is another long text to demonstrate longer lines. 22 | In ASCII mode, it is not expected to break at all. 23 | .Pp 24 | .ll FOO 25 | This is a longer text after switching to an invalid line length. 26 | In ASCII mode, it is expected to break at column 78. 27 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/iked/iked.conf: -------------------------------------------------------------------------------- 1 | # $OpenBSD: iked.conf,v 1.1 2014/07/11 21:20:10 deraadt Exp $ 2 | # 3 | # See iked.conf(5) for syntax and examples. 4 | 5 | # Configure users for the Extensible Authentication Protocol (EAP) 6 | user "user1" "password123" 7 | user "user2" "password456" 8 | 9 | # Configuration for clients connecting with EAP authentication. 10 | # Remember to set up a PKI, see ikectl(8) for more information. 11 | ikev2 "win7" passive esp \ 12 | from 10.1.0.0/24 to 10.2.0.0/24 \ 13 | local any peer any \ 14 | eap "mschap-v2" \ 15 | config address 10.2.0.1 \ 16 | config name-server 10.1.0.2 \ 17 | tag "$name-$id" 18 | 19 | # Configuration for a client authenticating with a pre-shared key. 20 | ikev2 esp \ 21 | from 10.3.0.0/24 to 10.1.0.0/24 \ 22 | from 10.5.0.0/24 to 10.1.0.0/24 \ 23 | from 10.5.0.0/24 to 172.16.1.0/24 \ 24 | local 192.168.1.1 peer 192.168.2.1 \ 25 | psk "you-should-not-use-psk-authentication!" 26 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/npppd/npppd.conf: -------------------------------------------------------------------------------- 1 | # $OpenBSD: npppd.conf,v 1.2 2014/03/22 04:32:39 yasuoka Exp $ 2 | # sample npppd configuration file. see npppd.conf(5) 3 | 4 | authentication LOCAL type local { 5 | users-file "/etc/npppd/npppd-users" 6 | } 7 | #authentication RADIUS type radius { 8 | # authentication-server { 9 | # address 192.168.0.1 secret "hogehoge" 10 | # } 11 | # accounting-server { 12 | # address 192.168.0.1 secret "hogehoge" 13 | # } 14 | #} 15 | 16 | tunnel L2TP protocol l2tp { 17 | listen on 0.0.0.0 18 | listen on :: 19 | } 20 | 21 | ipcp IPCP { 22 | pool-address 10.0.0.2-10.0.0.254 23 | dns-servers 8.8.8.8 24 | } 25 | 26 | # use pppx(4) interface. use an interface per a ppp session. 27 | interface pppx0 address 10.0.0.1 ipcp IPCP 28 | bind tunnel from L2TP authenticated by LOCAL to pppx0 29 | 30 | # use tun(4) interface. multiple ppp sessions concentrate one interface. 31 | #interface tun0 address 10.0.0.1 ipcp IPCP 32 | #bind tunnel from L2TP authenticated by LOCAL to tun0 33 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/eigrpd/eigrpd.conf: -------------------------------------------------------------------------------- 1 | # $OpenBSD: eigrpd.conf,v 1.2 2015/12/25 21:50:07 gsoares Exp $ 2 | 3 | # global configuration 4 | # router-id 10.0.0.1 5 | # rdomain 1 6 | # fib-update yes 7 | # fib-priority-internal 28 8 | # fib-priority-external 52 9 | 10 | # IPv4 11 | address-family ipv4 { 12 | autonomous-system 1 { 13 | maximum-paths 4 14 | variance 8 15 | 16 | default-metric 100000 10 255 1 1500 17 | redistribute default 18 | redistribute connected 19 | redistribute 30.0.1.0/24 20 | 21 | interface em1 22 | interface em2 { 23 | hello-interval 3 24 | holdtime 10 25 | delay 20 26 | bandwidth 1000000 27 | } 28 | interface em3 { 29 | passive 30 | } 31 | } 32 | } 33 | 34 | # IPv6 35 | address-family ipv6 { 36 | maximum-paths 2 37 | variance 3 38 | bandwidth 100000 39 | delay 10 40 | 41 | autonomous-system 1 { 42 | default-metric 100000 10 255 1 1500 43 | redistribute default 44 | 45 | interface em1 46 | interface em2 47 | } 48 | autonomous-system 2 { 49 | interface em3 50 | interface em4 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/httpd/httpd.conf: -------------------------------------------------------------------------------- 1 | ext_if="egress" 2 | 3 | types { include "/usr/share/misc/mime.types" } 4 | 5 | server "owncloud.example.com" { 6 | listen on $ext_if port 80 7 | directory index "index.php" 8 | root "/owncloud" 9 | 10 | # Set max upload size to 513M (in bytes) 11 | connection max request body 537919488 12 | 13 | # First deny access to the specified files 14 | location "/db_structure.xml" { block } 15 | location "/.ht*" { block } 16 | location "/README" { block } 17 | location "/data*" { block } 18 | location "/config*" { block } 19 | 20 | location "/*.php*" { 21 | fastcgi socket "/run/php-fpm.sock" 22 | } 23 | } 24 | 25 | server "owncloud.example.com1" { 26 | listen on $ext_if port 80 27 | } 28 | 29 | domain="yourdomain.com" 30 | ext_if="egress" 31 | 32 | server $domain { 33 | listen on $ext_if port 80 34 | block return 301 "https://$SERVER_NAME$REQUEST_URI" 35 | } 36 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t14.in: -------------------------------------------------------------------------------- 1 | [[ok]P]s0 2 | [[nok]P]s1 3 | 0 0G 0!=0e1 4 | [[nok]P]s0 5 | [[ok]P]s1 6 | 1 0G 0!=0e1 7 | [[nok]P]s0 8 | [[ok]P]s1 9 | 0 1G 0!=0e1 10 | [ 11 | ]n 12 | [[nok]P]s0 13 | [[ok]P]s1 14 | 0 0GN 0!=0e1 15 | [[ok]P]s0 16 | [[nok]P]s1 17 | 1 0GN 0!=0e1 18 | [[ok]P]s0 19 | [[nok]P]s1 20 | 0 1GN 0!=0e1 21 | [ 22 | ]n 23 | [[ok]P]s0 24 | [[nok]P]s1 25 | 0 0G 0!=0e1 26 | [[nok]P]s0 27 | [[ok]P]s1 28 | 1 0G 0!=0e1 29 | [[nok]P]s0 30 | [[ok]P]s1 31 | 0 1G 0!=0e1 32 | [ 33 | ]n 34 | [[ok]P]s0 35 | [[nok]P]s1 36 | 1 0( 0!=0e1 37 | [[nok]P]s0 38 | [[ok]P]s1 39 | 0 1( 0!=0e1 40 | [[nok]P]s0 41 | [[ok]P]s1 42 | 1 1( 0!=0e1 43 | [ 44 | ]n 45 | [[ok]P]s0 46 | [[nok]P]s1 47 | 1 0{ 0!=0e1 48 | [[nok]P]s0 49 | [[ok]P]s1 50 | 0 1{ 0!=0e1 51 | [[ok]P]s0 52 | [[nok]P]s1 53 | 1 1{ 0!=0e1 54 | [ 55 | ]n 56 | [[nok]P]s0 57 | [[ok]P]s1 58 | 0 1( 0!=0e1 59 | [[ok]P]s0 60 | [[nok]P]s1 61 | 1 0( 0!=0e1 62 | [[nok]P]s0 63 | [[ok]P]s1 64 | 1 1( 0!=0e1 65 | [ 66 | ]n 67 | [[nok]P]s0 68 | [[ok]P]s1 69 | 0 1{ 0!=0e1 70 | [[ok]P]s0 71 | [[nok]P]s1 72 | 1 0{ 0!=0e1 73 | [[ok]P]s0 74 | [[nok]P]s1 75 | 1 1{ 0!=0e1 76 | [ 77 | ]n 78 | q -------------------------------------------------------------------------------- /tests/afl-fuzz/static/vmd/vm.conf: -------------------------------------------------------------------------------- 1 | # $OpenBSD: vm.conf,v 1.7 2017/03/25 16:28:25 reyk Exp $ 2 | 3 | # 4 | # Macros 5 | # 6 | sets="/var/www/htdocs/pub/OpenBSD/snapshots/amd64/" 7 | 8 | # 9 | # Virtual machines 10 | # 11 | 12 | switch "uplink" { 13 | # This interface will default to bridge0, but switch(4) is supported 14 | #interface switch0 15 | 16 | # Add additional members 17 | add em0 18 | } 19 | 20 | switch "local" { 21 | add vether0 22 | down 23 | } 24 | 25 | # OpenBSD snapshot install test 26 | vm "openbsd.vm" { 27 | boot $sets "bsd.rd" 28 | 29 | # First disk from 'vmctl create "/home/vm/OpenBSD.img" -s 4G' 30 | disk "/home/vm/OpenBSD.img" 31 | 32 | # Second disk from OpenBSD contains the install sets 33 | disk $sets "install60.fs" 34 | 35 | # Interface will show up as tap(4) on the host and as vio(4) in the VM 36 | interface { switch "uplink" } 37 | interface { switch "local" } 38 | } 39 | 40 | # Another VM that is disabled on startup 41 | vm "vm1.example.com" { 42 | disable 43 | memory 1G 44 | disk "/home/vm/vm1-disk.img" 45 | 46 | # Use a specific tap(4) interface with a hardcoded MAC address 47 | interface tap3 { 48 | lladdr 00:11:22:aa:bb:cc 49 | down 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /tools/kcovprint/kcovprint.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | static void __attribute__ ((constructor)) lib_init(void); 12 | static void __attribute__ ((destructor)) lib_finish(void); 13 | 14 | int fd; 15 | unsigned long *cover; 16 | unsigned long size = 1024; 17 | 18 | static void lib_init(void) { 19 | fd = open("/dev/kcov", O_RDWR); 20 | if (fd == -1) 21 | err(1, "open"); 22 | 23 | if (ioctl(fd, KIOSETBUFSIZE, &size) == -1) 24 | err(1, "ioctl: KIOSETBUFSIZE"); 25 | cover = mmap(NULL, size * sizeof(unsigned long), 26 | PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); 27 | if (cover == MAP_FAILED) 28 | err(1, "mmap"); 29 | 30 | if (ioctl(fd, KIOENABLE) == -1) 31 | err(1, "ioctl: KIOENABLE"); 32 | read(-1, NULL, 0); 33 | 34 | return; 35 | } 36 | 37 | static void lib_finish(void) { 38 | unsigned long i; 39 | 40 | if (ioctl(fd, KIODISABLE) == -1) 41 | err(1, "ioctl: KIODISABLE"); 42 | 43 | for (i = 0; i < cover[0]; i++) 44 | printf("%p\n", (void *)cover[i + 1]); 45 | 46 | if (munmap(cover, size * sizeof(unsigned long)) == -1) 47 | err(1, "munmap"); 48 | close(fd); 49 | 50 | return; 51 | } 52 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/quotes.m4: -------------------------------------------------------------------------------- 1 | dnl $OpenBSD: quotes.m4,v 1.2 2005/09/06 15:33:21 espie Exp $ 2 | dnl Checking the way changequote() is supposed to work 3 | define(`string',`STRING')dnl 4 | 1: normal 5 | `quoted string' 6 | [quoted string] 7 | normal string 8 | `half quoted string 9 | going up to that string' 10 | 11 | 2: kill quotes 12 | changequote()dnl 13 | `quoted string' 14 | [quoted string] 15 | normal string 16 | `half quoted string 17 | going up to that string' 18 | 19 | 3: normal changed quote 20 | changequote([,])dnl 21 | `quoted string' 22 | [quoted string] 23 | normal string 24 | `half quoted string 25 | going up to that string' 26 | 27 | 4: empty quotes, kill them too 28 | changequote(,)dnl 29 | `quoted string' 30 | [quoted string] 31 | normal string 32 | `half quoted string 33 | going up to that string' 34 | 35 | 5: start quote only 36 | changequote(`)dnl 37 | `quoted string' 38 | [quoted string] 39 | normal string 40 | `half quoted string 41 | going up to that string' 42 | 43 | 6: normal quotes are back 44 | changequote 45 | `quoted string' 46 | [quoted string] 47 | normal string 48 | `half quoted string 49 | going up to that string' 50 | 51 | 7: start quote+empty end quote 52 | changequote([,)dnl 53 | `quoted string' 54 | [quoted string] 55 | normal string 56 | `half quoted string 57 | going up to that string' 58 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bc/t18.in: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: t18.in,v 1.1 2003/12/09 12:49:01 otto Exp $ */ 2 | /* 3 | * Copyright (c) 2003 Amit Singh 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | /* 19 | * The Towers Of Hanoi 20 | * bc version 21 | * http://hanoi.kernelthread.com 22 | */ 23 | 24 | define moveit(i, j) { 25 | print "move " 26 | print i 27 | print " --> " 28 | print j 29 | print "\n" 30 | } 31 | 32 | define dohanoi(n, h, d, o) { 33 | if (n > 0) { 34 | silence = dohanoi(n-1, h, o, d) 35 | silence = moveit(h, d) 36 | silence = dohanoi(n-1, o, d, h) 37 | } 38 | } 39 | 40 | define hanoi(n) { 41 | silence = dohanoi(n, 1, 3, 2) 42 | } 43 | 44 | hanoi(5) 45 | 46 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/m4/comments.m4: -------------------------------------------------------------------------------- 1 | dnl $OpenBSD: comments.m4,v 1.1 2005/09/06 15:33:21 espie Exp $ 2 | dnl checking the way changecom works. 3 | 1: normal 4 | define(`comment', `COMMENT')dnl 5 | define(`p', 'XXX')dnl 6 | # this is a comment 7 | >> this is a comment 8 | p this is a comment 9 | p this is a comment q comment too 10 | 11 | 2: `changecom(>>)dnl' 12 | changecom(>>)dnl 13 | # this is a comment 14 | >> this is a comment 15 | p this is a comment 16 | p this is a comment q comment too 17 | 18 | 3: `changecom dnl' 19 | changecom dnl 20 | # this is a comment 21 | >> this is a comment 22 | p this is a comment 23 | p this is a comment q comment too 24 | 25 | 4: `changecom()dnl' 26 | changecom()dnl 27 | # this is a comment 28 | >> this is a comment 29 | p this is a comment 30 | p this is a comment q comment too 31 | 32 | 5: `changecom(,)dnl' 33 | changecom(,)dnl 34 | # this is a comment 35 | >> this is a comment 36 | p this is a comment 37 | p this is a comment q comment too 38 | 39 | 6: `changecom(`p',q)dnl' 40 | changecom(`p',q)dnl 41 | # this is a comment 42 | >> this is a comment 43 | p this is a comment 44 | p this is a comment q comment too 45 | 46 | 7: `changecom(`p')dnl' 47 | changecom(`p')dnl 48 | # this is a comment 49 | >> this is a comment 50 | p this is a comment 51 | p this is a comment q comment too 52 | 53 | 8: `changecom(#)dnl' 54 | changecom(#)dnl 55 | # this is a comment 56 | >> this is a comment 57 | p this is a comment 58 | p this is a comment q comment too 59 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t3.in: -------------------------------------------------------------------------------- 1 | # $OpenBSD: t3.in,v 1.1 2003/12/17 15:11:36 otto Exp $ 2 | # 3 | # Copyright (c) 2003 Kevin Quick 4 | # 5 | # Permission to use, copy, modify, and distribute this software for any 6 | # purpose with or without fee is hereby granted, provided that the above 7 | # copyright notice and this permission notice appear in all copies. 8 | # 9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | 17 | [ Sing the classic '99 Bottles of Beer', using the Unix dc utility. ]sd 18 | [ ]sd 19 | [ Run this one by typing 'dc < bottles.dc' at the Unix prompt, where ]sd 20 | [ bottles.dc is the file containing these lines. ]sd 21 | [ ]sd 22 | [ bottles of beer]sb[ on the wall]sw[,]sc 23 | [take one down, pass it around]st[.]sp[no more]sk 24 | [10lplwlbln1-10lclt10lclbln32lclwlbln]sl 25 | [lzxPPPPlzxPPPPPPlzxPPPP]so[lkP]sx[dZselyxsd]su 26 | [d10le1-dse^ /d10/10*-48+P le0 funccall 19 | | atom_expr "[" subscriptlist "]" -> getitem 20 | | atom_expr "." NAME -> getattr 21 | | atom 22 | 23 | ?atom: "(" [yield_expr|testlist_comp] ")" 24 | | "[" [testlist_comp] "]" -> list 25 | | "{" [dictorsetmaker] "}" -> dict 26 | 27 | starargs: "*" test ("," "*" test)* ("," argvalue)* ["," kwargs] 28 | kwargs: "**" test 29 | 30 | ?argvalue: test ["=" test] 31 | 32 | number: DEC_NUMBER | HEX_NUMBER | BIN_NUMBER | OCT_NUMBER 33 | 34 | // Tokens 35 | 36 | NAME: /[a-zA-Z_]\w*/ 37 | // are enclosed in /* and */ 38 | // are enclosed in # and the next newline 39 | COMMENT: /#[^\n]*/ 40 | _NEWLINE: ( /\r?\n[\t ]*/ | COMMENT )+ 41 | 42 | DEC_NUMBER: /0|[1-9]\d*/i 43 | HEX_NUMBER: /0x[\da-f]*l?/i 44 | OCT_NUMBER: /0o?[0-7]*l?/i 45 | 46 | %ignore /[\t \f]+/ // WS 47 | %ignore /\\[\t \f]*\r?\n/ // LINE_CONT 48 | %ignore COMMENT 49 | %declare _INDENT _DEDENT 50 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/args-roff.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: roff.in,v 1.5 2017/07/04 14:53:26 schwarze Exp $ 2 | .TH ARGS-ROFF 1 "February 21, 2015" 3 | .SH NAME 4 | args-roff - arguments to roff macros 5 | .SH DESCRIPTION 6 | .de test 7 | .BI (\\$1) "(\\$2)" 8 | .br 9 | .. 10 | arguments containing quotes: 11 | .test a"b a"b 12 | .de test 13 | (\\$1) (\\$2) 14 | .br 15 | .. 16 | standard unquoted: 17 | .test one two 18 | escaped blanks: 19 | .test one\ one two\ two 20 | escaped 'e' character: 21 | .test one\eone two 22 | escaped backslash before blank: 23 | .test one\\ two 24 | escaped backslash before 'e' character: 25 | .test one\\e two 26 | double inter-argument space: 27 | .test one two 28 | triple inter-argument space: 29 | .test one two 30 | single eol blank: 31 | .test one two 32 | double eol blank: 33 | .test one two 34 | triple eol blank: 35 | .test one two 36 | standard quoted: 37 | .test "one" "two" 38 | quoted quotes: 39 | .test "one""one" """two""" 40 | quoted whitespace: 41 | .test "one one" "two two" 42 | escaped 'e' characters: 43 | .test "one \e one" "\e" 44 | escaped backslash before blank: 45 | .test "one\\ one" "\\ " 46 | escaped backslash before 'e' character: 47 | .test "one\\eone" "\\e" 48 | double inter-argument space: 49 | .test "one one" "two two" 50 | triple inter-argument space: 51 | .test "one one" "two two" 52 | missing inter-argument space: 53 | .test "one one"two\ two 54 | single eol blank: 55 | .test "one one" "two two" 56 | double eol blank: 57 | .test "one one" "two two" 58 | triple eol blank: 59 | .test "one one" "two two" 60 | trailing blanks in arguments: 61 | .test "one " "two " 62 | unterminated quotes: 63 | .test "one 64 | .test one "two 65 | single trailing blank in unterminated quotes: 66 | .test "one 67 | .test one "two 68 | double trailing blank in unterminated quotes: 69 | .test "one 70 | .test one "two 71 | backslash at eol: 72 | .test one two\ 73 | -------------------------------------------------------------------------------- /tools/addpromise: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # TODO: replace script by Coccinelle 4 | 5 | import os 6 | import re 7 | import sys 8 | 9 | DEFAULT_PROMISE = ["wpath", "cpath", "rpath", "flock"] 10 | 11 | 12 | def main(): 13 | if len(sys.argv) == 2: 14 | filename = sys.argv[1] 15 | promise = DEFAULT_PROMISE 16 | elif len(sys.argv) == 3: 17 | filename = sys.argv[1] 18 | promise = sys.argv[2].split(" ") 19 | else: 20 | sys.exit("ERROR: Please specify a source file and promise. Default: [\"wpath\", \"cpath\", \"rpath\", \"flock\"].") 21 | 22 | if not os.path.exists(filename): 23 | sys.exit('ERROR: %s was not found.' % sys.argv[1]) 24 | 25 | if not os.path.isfile(filename): 26 | sys.exit('ERROR: %s is not a file.' % sys.argv[1]) 27 | 28 | buf = "" 29 | # Example: pledge("stdio rpath proc exec", NULL) 30 | pledged = False 31 | with open(filename, 'r') as source: 32 | for line in source: 33 | line = line.rstrip() 34 | pledge_match = re.findall(".*pledge\(\"(.*)\",.*", line) 35 | pledge_num = len(pledge_match) 36 | if pledge_num > 0: 37 | print(filename, ":", pledge_match) 38 | pledged = True 39 | for p in promise: 40 | promise_match = re.findall( 41 | ".*pledge\(\"(.*%s.*)\",.*\)" % p, line) 42 | promise_num = len(promise_match) 43 | if promise_num < pledge_num: 44 | line = line.replace( 45 | pledge_match[0], "%s %s" % (pledge_match[0], p)) 46 | buf = "{}{}\n".format(buf, line) 47 | 48 | if not pledged: 49 | print(filename, ":", "None") 50 | 51 | source = open(filename, 'w') 52 | source.write(buf) 53 | source.close() 54 | 55 | 56 | if __name__ == "__main__": 57 | exit(main()) 58 | -------------------------------------------------------------------------------- /tools/addr2info: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | import sys 5 | from collections import Counter 6 | 7 | def read(f): 8 | """ 9 | Read lines in addr2line format: 10 | uvm_unmap_remove 11 | /usr/src/sys/uvm/uvm_map.c:2105 12 | 13 | Returns: [ { "path": path, "lines": [1, 23, 4, 4] }, { ... } ] 14 | """ 15 | 16 | touched = [] 17 | for line in f: 18 | line = line.strip() 19 | l = line.split(":") 20 | if len(l) != 2: 21 | continue 22 | source_file = l[0] 23 | line_num = int(l[1]) 24 | touched.append({ "path": source_file, "lines": [line_num] }) 25 | 26 | return touched 27 | 28 | def print_cov_file(cov): 29 | """ 30 | see geninfo(1) 31 | 32 | TN: 33 | SF:/home/sergeyb/sources/fsx-source/fsx-linux.c 34 | FN:1113,main 35 | FNDA:0,vwarnc 36 | FNDA:1,main 37 | FNF:32 38 | FNH:19 39 | DA:131,0 40 | DA:168,0 41 | DA:169,0 42 | LF:804 43 | LH:287 44 | end_of_record 45 | 46 | """ 47 | print "TN:" 48 | print "SF:%s" % cov["path"] 49 | for line_num, occurences in cov["lines"].iteritems(): 50 | print "DA:%s,%s" % (line_num, occurences) 51 | print "end_of_record" 52 | 53 | def print_cov(cov): 54 | for c in cov: 55 | if c["path"]: 56 | print_cov_file(c) 57 | 58 | def summarize_by_file(coverage): 59 | coverage_group = [] 60 | cur_file = "" 61 | cur_lines_num = [] 62 | for cov in coverage: 63 | if cur_file != cov["path"]: 64 | cur_file = cov["path"] 65 | cur_lines_num = cov["lines"] 66 | coverage_group.append( { "path": cur_file, "lines": cur_lines_num } ) 67 | else: 68 | cur_lines_num += cov["lines"] 69 | 70 | for idx, val in enumerate(coverage_group): 71 | coverage_group[idx]["lines"] = Counter(coverage_group[idx]["lines"]) 72 | 73 | return coverage_group 74 | 75 | def main(): 76 | coverage = sorted(read(sys.stdin), key=lambda k: k['path']) 77 | cov_by_file = summarize_by_file(coverage) 78 | print_cov(cov_by_file) 79 | 80 | 81 | if __name__ == '__main__': 82 | main() 83 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/ifstated/ifstated.conf: -------------------------------------------------------------------------------- 1 | # $OpenBSD: ifstated.conf,v 1.1 2014/07/11 16:36:35 deraadt Exp $ 2 | # This is a sample config for a pair of firewalls with two interfaces 3 | # 4 | # carp0 and carp1 have ip addresses on 192.168.3.0/24 and 192.168.6.0/24 5 | # respectively. 6 | 7 | # net.inet.carp.preempt must be enabled (set to 1) for this to work correctly. 8 | 9 | # Uncomment one of the following lines to force primary/backup status. 10 | # init-state primary 11 | # init-state backup 12 | 13 | carp_up = "carp0.link.up && carp1.link.up" 14 | carp_down = "!carp0.link.up && !carp1.link.up" 15 | carp_sync = "carp0.link.up && carp1.link.up || \ 16 | !carp0.link.up && !carp1.link.up" 17 | 18 | # The "net" addresses are other addresses which can be used to determine 19 | # whether we have connectivity. Make sure the hosts are always up, or 20 | # test multiple ip's, 'or'-ing the tests. 21 | net = '( "ping -q -c 1 -w 1 192.168.6.8 > /dev/null" every 10 && \ 22 | "ping -q -c 1 -w 1 192.168.3.8 > /dev/null" every 10)' 23 | 24 | # The peer addresses below are the real ip addresses of the OTHER firewallrp_sync '( "ping -q -c 1 -w 1 192.168.6.7 > /dev/null" every 10 && \ 25 | "pdev/null" every 10)' 26 | 27 | state auto { 28 | if $carp_up 29 | set-state ary 30 | if $carp_down 31 | set-state bp 32 | } 33 | 34 | state primary { 35 | init { 36 | run "nfig carp0 advskew 10" 37 | run "ifconfig carp1 advskew 10" 38 | }# if ! $net 39 | set-state demoted 40 | } 41 | 42 | state demoted { 43 | init { 44 | run "ifconfig carp0 advskew 254" 45 | run "ifconfig carp1 advskew 254" 46 | } 47 | if $net 48 | set-state primary 49 | } 50 | 51 | state promoted { 52 | init { 53 | run "ifconfig carp0 advskew 0" 54 | run "ifconfig carp1 advskew 0" 55 | } 56 | if $peer || ! $net 57 | set-state backup 58 | } 59 | 60 | state backup { 61 | init { 62 | run "ifconfig carp0 advskew 100" 63 | run "ifconfig carp1 advskew 100" 64 | } 65 | # The "sleep 5" below is a hack to dampen the $carp_sync when we come 66 | # out of promoted state. Thinking about the correct fix... 67 | if ! $carp_sync && $net && "sleep 5" every 10 68 | if ! $carp_sync && $net 69 | set-state promoted 70 | } 71 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/patch/patch: -------------------------------------------------------------------------------- 1 | 4d3 2 | < operating system. Our efforts emphasize portability, standardization, 3 | 7d5 4 | < 5 | 12d9 6 | < OpenBSD is developed entirely by volunteers. The project's development 7 | 14d10 8 | < The OpenBSD Foundation. Contributions ensure that OpenBSD will remain a vibrant 9 | 19c15 10 | < but it is possible to classify the goals we all share: 11 | --- 12 | > but it is possible to the goals we all share: 13 | 21,22c17,18 14 | < Provide the best development platform possible. Provide full source access to 15 | < developers and users, including the ability to look at CVS tree changes 16 | --- 17 | > Provide the best platform possible. Provide full source access to 18 | > developers and users, the ability to look at CVS tree changes 19 | 27d22 20 | < style licences are preferred, the GPL is not acceptable when adding new code, 21 | 29,31c24,26 22 | < can use for ANY PURPOSE, with no restrictions. We strive to make our software 23 | < robust and secure, and encourage companies to use whichever pieces they want 24 | < to. There are commercial spin-offs of OpenBSD. 25 | --- 26 | > can use for with no . We strive to make our software 27 | > robust and secure, encourage companies to use whichever pieces they want 28 | > to. There are commercial of OpenBSD. 29 | 33c28 30 | < Pay attention to security problems and fix them before anyone else does. (Try 31 | --- 32 | > Pay attention to security fix them before anyone else does. (Try 33 | 36,38c31,33 34 | < Greater integration of cryptographic software. OpenBSD is developed and 35 | < released from Canada and due to Canadian law it is legal to export crypto to 36 | < the world (as researched by a Canadian individual and as documented in the 37 | --- 38 | > Greater integration of is developed and 39 | > released from Canada and Canadian law it is legal to export crypto to 40 | > the world (as researched by a and as documented in the 41 | 41,51d35 42 | < Track and implement standards (ANSI, POSIX, parts of X/Open, etc.) 43 | < 44 | < Work towards a very machine independent source tree. Support as many different 45 | < systems and hardware as feasible. 46 | < 47 | < Be as politics-free as possible; solutions should be decided on the basis of 48 | < technical merit. 49 | < 50 | < Focus on being developer-oriented in all senses, including holding 51 | < developer-only events called hackathons. 52 | < 53 | 54c38 54 | < Make a release approximately every six months. 55 | --- 56 | > Make a release approximately six months. 57 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/deroff/args-mdoc.in: -------------------------------------------------------------------------------- 1 | .\" $OpenBSD: mdoc.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $ 2 | .Dd $Mdocdate: July 4 2017 $ 3 | .Dt ARGS-MDOC 1 4 | .Os 5 | .Sh NAME 6 | .Nm args-mdoc 7 | .Nd arguments to mdoc macros 8 | .Sh DESCRIPTION 9 | standard unquoted: 10 | .Fl one two 11 | text 12 | .br 13 | escaped blanks: 14 | .Fl one\ one two\ two 15 | text 16 | .br 17 | escaped 'e' character: 18 | .Fl one\eone two 19 | text 20 | .br 21 | .\"escaped backslash before blank: 22 | .\"Fl one\\ two 23 | .\"text 24 | .\"br 25 | escaped backslash before 'e' character: 26 | .Fl one\\e two 27 | text 28 | .br 29 | double inter-argument space: 30 | .Fl one two 31 | text 32 | .br 33 | triple inter-argument space: 34 | .Fl one two 35 | text 36 | .br 37 | single eol blank: 38 | .Fl one two 39 | text 40 | .br 41 | double eol blank: 42 | .Fl one two 43 | text 44 | .br 45 | triple eol blank: 46 | .Fl one two 47 | text 48 | .br 49 | standard quoted: 50 | .Fl "one" "two" 51 | text 52 | .br 53 | quoted quotes: 54 | .Fl "one""one" """two""" 55 | text 56 | .br 57 | quoted whitespace: 58 | .Fl "one one" "two two" 59 | text 60 | .br 61 | escaped 'e' characters: 62 | .Fl "one \e one" "\e" 63 | text 64 | .br 65 | .\"escaped backslash before blank: 66 | .\"Fl "one\\ one" "\\ " 67 | .\"text 68 | .\"br 69 | .\"escaped backslash before 'e' character: 70 | .\"Fl "one\\eone" "\\e" 71 | .\"text 72 | .\"br 73 | double inter-argument space: 74 | .Fl "one one" "two two" 75 | text 76 | .br 77 | triple inter-argument space: 78 | .Fl "one one" "two two" 79 | text 80 | .br 81 | missing inter-argument space: 82 | .Fl "one one"two\ two 83 | text 84 | .br 85 | single eol blank: 86 | .Fl "one one" "two two" 87 | text 88 | .br 89 | double eol blank: 90 | .Fl "one one" "two two" 91 | text 92 | .br 93 | triple eol blank: 94 | .Fl "one one" "two two" 95 | text 96 | .br 97 | trailing blanks in arguments: 98 | .Fl "one " "two " 99 | text 100 | .br 101 | unterminated quotes: 102 | .Fl "one 103 | .Fl one "two 104 | text 105 | .br 106 | single trailing blank in unterminated quotes: 107 | .Fl "one 108 | .Fl one "two 109 | text 110 | .br 111 | double trailing blank in unterminated quotes: 112 | .Fl "one 113 | .Fl one "two 114 | text 115 | .br 116 | tab after macro: 117 | .Fl one two 118 | text 119 | .br 120 | escape sequence after macro: 121 | .Fl\(lqone two 122 | text 123 | .br 124 | backslash at eol: 125 | .Fl one two\ 126 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t7.in: -------------------------------------------------------------------------------- 1 | [Program from http://www.cs.unh.edu/~charpov/Programming/DC/]s. 2 | [The output produced by this test is the Jabberwocky poeam by Lewis Carol, 3 | from "Through the Looking-Glass and What Alice Found There", 1872]s. 4 | 22208085721160815839326341402121883690522320029255552164456082082121507399131784888796775404393238740752073581292176033192975608648980579511790754074629932624904826033926771561352802702304711849306991432140783663141097741410673769879986682209343466281135283290275369909264160273176470124389744289584917009576579173596679560702849116170806711176042540325188738564140628164804618257135693047847192850818282310363304691273054958318318136191456275934310979155326791959077883445003166261104834773132040707456928546349673980840313948708349674193786434159922651000968311352206702569130007195445654084933953345626389764219705628257612293204376976748352217929337471880882231223685405877498688770919610871973453341673913923792234893241993439245115105190893660465508673064373840268054184063151225377582060655786260788736204677135397194609418373902725670020397378638535454535982247377168952102335040177207305844444366209308523996849245976720417612176719067483022960817121007244452665449784273243174997760034496193814960150784537785113589011725985900508524882770853637523676303240173952011467376200157457202234158542518689678707600958087139914974630505378072055818423497887022672894966264722482896163204923500950712750800537457664585469095374214293974296229117403664516032413259929513310658563843081832487569416683206341446732898062734501513714984552459725473478529038715898310732843126214088302700527765333188909878114118156328607905954179948741014531467629112351746391357169021505149742077359053197219166630939696390194435167157513452231104227665811363415438461304936968404285629177347016678518931947203796484167545101613670772251307345495413035233907657705241691280430994746768012380728375146653630623831838222282318165089162386341671976737726353273451886027886364291170031129520721957416004799824490011955162466021287535364309928388542132049900161052116530089934228815775998215778916104959359698408064987438386886161480778575982275751968826631954742887974749292068020577501261842082809483702986629865701617200056158514119921272726266484084142349717069035717802916618873448175705514451223911583066310022020808646584937752763866798004057371097500872885733222570967153949159920525516838117787583988167897342360101235912871520761154734770678309671549603175730098764310659277164535040418340982101759825495735066065501823775306294622701628580346350888711132078451931296748345416719473558304071712[d256%P256/d0<.]ds.x 5 | 6 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/patch/README: -------------------------------------------------------------------------------- 1 | Only two remote holes in the default install, in a heck of a long time! 2 | 3 | The OpenBSD project produces a FREE, multi-platform 4.4BSD-based UNIX-like 4 | operating system. Our efforts emphasize portability, standardization, 5 | correctness, proactive security and integrated cryptography. As an example of 6 | the effect OpenBSD has, the popular OpenSSH software comes from OpenBSD. 7 | 8 | OpenBSD is freely available from our download sites. 9 | 10 | The current release is OpenBSD 6.2, released Oct 9, 2017. 11 | 12 | OpenBSD is developed entirely by volunteers. The project's development 13 | environment and developer events are funded through contributions collected by 14 | The OpenBSD Foundation. Contributions ensure that OpenBSD will remain a vibrant 15 | and free operating system. 16 | 17 | 18 | Obviously, each developer working on OpenBSD has their own aims and priorities, 19 | but it is possible to classify the goals we all share: 20 | 21 | Provide the best development platform possible. Provide full source access to 22 | developers and users, including the ability to look at CVS tree changes 23 | directly. Users can even look at our source tree and changes directly on the 24 | web! 25 | 26 | Integrate good code from any source with acceptable licenses. ISC or Berkeley 27 | style licences are preferred, the GPL is not acceptable when adding new code, 28 | NDAs are never acceptable. We want to make available source code that anyone 29 | can use for ANY PURPOSE, with no restrictions. We strive to make our software 30 | robust and secure, and encourage companies to use whichever pieces they want 31 | to. There are commercial spin-offs of OpenBSD. 32 | 33 | Pay attention to security problems and fix them before anyone else does. (Try 34 | to be the #1 most secure operating system.) 35 | 36 | Greater integration of cryptographic software. OpenBSD is developed and 37 | released from Canada and due to Canadian law it is legal to export crypto to 38 | the world (as researched by a Canadian individual and as documented in the 39 | Export Control list of Canada). 40 | 41 | Track and implement standards (ANSI, POSIX, parts of X/Open, etc.) 42 | 43 | Work towards a very machine independent source tree. Support as many different 44 | systems and hardware as feasible. 45 | 46 | Be as politics-free as possible; solutions should be decided on the basis of 47 | technical merit. 48 | 49 | Focus on being developer-oriented in all senses, including holding 50 | developer-only events called hackathons. 51 | 52 | Do not let serious problems sit unsolved. 53 | 54 | Make a release approximately every six months. 55 | -------------------------------------------------------------------------------- /tests/regress/vmm_states.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # https://wiki.libvirt.org/page/VM_lifecycle 4 | # https://github.com/spotify/python-graphwalker 5 | # graphwalker --reporter=Print:output=stderr --stopcond=Coverage:edges=100 vmm.tgf vmm_states.VMM 6 | # graphwalker --reporter=Print:output=stderr --stopcond=Seconds:1 --reporter=Cartographer:dotpath=.,imgpath=. vmm.tgf vmm_states.VMM 7 | # graphwalker --reporter=Print:output=stderr --stopcond=CountSteps:steps=100 vmm.tgf vmm_states.VMM 8 | 9 | class VMM(object): 10 | 11 | def __init__(self): 12 | self.calls = [] 13 | 14 | def __getattr__(self, k): 15 | def f(*al, **kw): 16 | self.calls.append((k, al, kw)) 17 | f.__name__ = k 18 | return f 19 | 20 | def teardown(self, a): 21 | """ 22 | teardown is called the same way as setup, at the end. 23 | """ 24 | 25 | print("teardown") 26 | pass 27 | 28 | @classmethod 29 | def setup(self, a): 30 | """ 31 | setup is called at the start of the test session with a dictionary containing 32 | the other instances involved in the test: the reporter, the model, and so on. 33 | Notably, if you want to save attachments from the test methods, you should use 34 | the reporter instance here. 35 | """ 36 | 37 | print("setup") 38 | pass 39 | 40 | def step_begin(self, a): 41 | """ 42 | step_begin is called before each step with the step definition. The step 43 | definition is an iterable where the first is the id and the second the name of 44 | the step. 45 | """ 46 | 47 | print("step_begin") 48 | pass 49 | 50 | def step_end(self, a, b): 51 | """ 52 | step_end is called before after each step like step_begin, but with the 53 | addition of a failure, usually None. If the test failed, or there was some 54 | other exception, step_end is called with that exception, typically an 55 | AssertionError. The step_end method can permit the testing to continue by 56 | returning the exact string "RECOVER". 57 | """ 58 | 59 | print("step_end") 60 | pass 61 | 62 | def e_once(self): 63 | 64 | print("e_once") 65 | pass 66 | 67 | def e_stop(self): 68 | 69 | print("e_stop") 70 | pass 71 | 72 | def e_start(self): 73 | 74 | print("e_start") 75 | pass 76 | 77 | def e_pause(self): 78 | 79 | print("e_pause") 80 | pass 81 | 82 | def e_unpause(self): 83 | 84 | print("e_unpause") 85 | pass 86 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t21.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 20k 8 | [ 0lx-sx 1sw]s0 9 | [lx 2/sxly 1+sylx 2<1]s1 10 | [lglg*sglyd1-sy 0!=4]s4 11 | [ 1lg/Lxs.Las.Lbs.Lcs.Lds.Les.Lgs.Lts.Lws.Lys. 4Q]s5 12 | [lg 1/sglyd1-sy 0!=4 ltklw 1=5 lg 1/Lxs.Las.Lbs.Lcs.Lds.Les.Lgs.Lts.Lws.Lys. 3Q]s3 13 | [lblx*sblcla*lb+scldla*sdlcld/sglgle=3 lgselad1+sas. 1 1=2]s2 14 | [0Sy0Sw0St0Sg0Se0Sd0Sc0Sb0SaSxKstlt .434lx*+ 1+k 0swlx 0>0 0sylx 2<1 1sa 1sblbsc 1sd 1se 1dsas. 1 1=2 Lxs.Las.Lbs.Lcs.Lds.Les.Lgs.Lts.Lws.Lys.0 1Q]s 15 | 16 | 17 | 18 | [ 1 10K^-Lxs.Las.Lbs.Lcs.Lds.Les.Lfs.Lgs.Lus.Lss.Lts. 2Q]s6 19 | [lsk]s8 20 | [lslxZlxX- 2/+ 1+ssls 0<8 lxvsxlf 2*sflx 2<7]s7 21 | [lsk]s: 22 | [lslxZlxX- 2/+ 1+ssls 0<: lxvsxlf 2*sflx .5>9]s9 23 | [ltklulc*ld/Lxs.Las.Lbs.Lcs.Lds.Les.Lfs.Lgs.Lus.Lss.Lts. 3Q]s< 24 | [lbls*sblcla*ldlb*+scldla*sdlcld/sglgle=< lgsela 2+dsas. 1 1=;]s; 25 | [0St0Ss0Su0Sg0Sf0Se0Sd0Sc0Sb0SaSxlx 0!<6 Kst 1sfKlxX+lxZ- 1+kKsslx 2<7 lx .5>9 ltlfZ+lfX- 1+klx 1-lx 1+/suK 1.1ltZ*+ 1.1ltX*-klulu*ss 2lf*sblbsc 1sd 1se 3dsas. 1 1=; Lxs.Las.Lbs.Lcs.Lds.Les.Lfs.Lgs.Lus.Lss.Lts.0 1Q]s 26 | 27 | 28 | 29 | [ltss]s= 30 | [lx 2lp*/ 1+ 2/sn]s> 31 | [lx 2lp*/ 1- 2/sn]s? 32 | [ 0lx-sx]s@ 33 | [ltkls 1/Lxs.Las.Lbs.Lcs.Lss.Lts.Lys.Lps.Lns.Lis. 3Q]sB 34 | [laly*salbli*li 1-*sblalb/sclc 0=B lslc+ssli 2+dsis. 1 1=A]sA 35 | [0Si0Sn0Sp0Sy0St0Ss0Sc0Sb0SaSxKstlx .7853/syltlyZ+lyX-sslslt>= lsk 1lxsp 0klx 0!>> lx 0>? lx 4ln*lp*-sxln 2% 0!=@ lt 1.2lt*Z+ 1.2lt*X-k 0lx-lx*sylxsa 1sblxss 3dsis. 1 1=A Lxs.Las.Lbs.Lcs.Lss.Lts.Lys.Lps.Lns.Lis.0 1Q]s 36 | 37 | 38 | 39 | [0StSxKstK 1+klx 2 1lx*+lxsxltklx 1/Lxs.Lts. 1QLxs.Lts.0 1Q]s 40 | 41 | 42 | 43 | [ 0Lxs.Las.Lbs.Lcs.Lds.Les.Lfs.Lgs.Lss.Lts. 2Q]sC 44 | [ .7853981633974483096156608458198757210492923498437764 1/Lxs.Las.Lbs.Lcs.Lds.Les.Lfs.Lgs.Lss.Lts. 3Q]sE 45 | [K 52>E ]sD 46 | [K 1+k 0 1 1.lxlx*+v--lx/sxlf 2*sflx .5G]sG 48 | [ltklxlc*ld/Lxs.Las.Lbs.Lcs.Lds.Les.Lfs.Lgs.Lss.Lts. 3Q]sI 49 | [lbls*sblcla*ldlb*+scldla*sdlcld/sglgle=I lgsela 2+dsas. 1 1=H]sH 50 | [0St0Ss0Sg0Sf0Se0Sd0Sc0Sb0SaSxlx 0=C lx 1=D Kst 1sflx .5G 0lx-lx*sslfsblfsc 1sd 1se 3dsas. 1 1=H Lxs.Las.Lbs.Lcs.Lds.Les.Lfs.Lgs.Lss.Lts.0 1Q]s 51 | 52 | 53 | 54 | [Klk+k]sJ 55 | [ 0ln-sn 0lx-sx]sK 56 | [lalx*salc 2*li*sclid1+sis.liln!K 1sa 1sc 1dsis.liln! %s") % (platform[arch] > mtime)) 64 | logging.debug(ptime(ctime) - ptime(mtime)) 65 | if (ptime(platform[arch]) > ptime(mtime)): 66 | logging.info("[NEW SNAPSHOT] %s, builded %s ago %s" % 67 | (arch, ptime(ctime) - ptime(mtime), mtime)) 68 | platform[arch] = mtime 69 | 70 | # pp.pprint(platform) 71 | logging.info("Sleeping (%s sec)" % TIMEOUT) 72 | time.sleep(TIMEOUT) 73 | -------------------------------------------------------------------------------- /patches/oss-fuzz-opensmtpd.patch: -------------------------------------------------------------------------------- 1 | diff --git a/projects/opensmtpd/Dockerfile b/projects/opensmtpd/Dockerfile 2 | deleted file mode 100644 3 | index 4d62cc5..0000000 4 | --- a/projects/opensmtpd/Dockerfile 5 | +++ /dev/null 6 | @@ -1,27 +0,0 @@ 7 | -# Copyright 2016 Google Inc. 8 | -# 9 | -# Licensed under the Apache License, Version 2.0 (the "License"); 10 | -# you may not use this file except in compliance with the License. 11 | -# You may obtain a copy of the License at 12 | -# 13 | -# http://www.apache.org/licenses/LICENSE-2.0 14 | -# 15 | -# Unless required by applicable law or agreed to in writing, software 16 | -# distributed under the License is distributed on an "AS IS" BASIS, 17 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | -# See the License for the specific language governing permissions and 19 | -# limitations under the License. 20 | -# 21 | -################################################################################ 22 | - 23 | -FROM gcr.io/oss-fuzz-base/base-builder 24 | -MAINTAINER estetus@gmail.com 25 | - 26 | -RUN apt-get update && apt-get -y install build-essential automake libtool git python asr-dev 27 | - 28 | -WORKDIR OpenSMTPD 29 | - 30 | -RUN git clone --depth 1 https://github.com/OpenSMTPD/OpenSMTPD && \ 31 | - apt-get update 32 | - 33 | -COPY build.sh $SRC/ 34 | diff --git a/projects/opensmtpd/build.sh b/projects/opensmtpd/build.sh 35 | deleted file mode 100644 36 | index 74f7b51..0000000 37 | --- a/projects/opensmtpd/build.sh 38 | +++ /dev/null 39 | @@ -1,21 +0,0 @@ 40 | -#!/bin/bash -eu 41 | -# Copyright 2016 Google Inc. 42 | -# 43 | -# Licensed under the Apache License, Version 2.0 (the "License"); 44 | -# you may not use this file except in compliance with the License. 45 | -# You may obtain a copy of the License at 46 | -# 47 | -# http://www.apache.org/licenses/LICENSE-2.0 48 | -# 49 | -# Unless required by applicable law or agreed to in writing, software 50 | -# distributed under the License is distributed on an "AS IS" BASIS, 51 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 52 | -# See the License for the specific language governing permissions and 53 | -# limitations under the License. 54 | -# 55 | -################################################################################ 56 | - 57 | -./bootstrap 58 | -./configure 59 | - 60 | -make -j$(nproc) 61 | diff --git a/projects/opensmtpd/project.yaml b/projects/opensmtpd/project.yaml 62 | deleted file mode 100644 63 | index 4a64007..0000000 64 | --- a/projects/opensmtpd/project.yaml 65 | +++ /dev/null 66 | @@ -1,4 +0,0 @@ 67 | -homepage: "https://www.opensmtpd.org/" 68 | -primary_contact: "gilles@openbsd.org" 69 | -auto_ccs: 70 | - - "eric@openbsd.org" 71 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/hostapd/hostapd.conf: -------------------------------------------------------------------------------- 1 | # $OpenBSD: hostapd.conf,v 1.1 2014/07/11 16:36:35 deraadt Exp $ 2 | # sample hostapd configuration file 3 | # see hostapd.conf(5) 4 | 5 | # "wavelan is a battle field" 6 | 7 | # 8 | # Macros 9 | # 10 | 11 | # Define macros for the interfaces to be used by hostapd. The "wlan" 12 | # interface is optional. 13 | wlan="ath0" 14 | wired="sis0" 15 | 16 | # 17 | # Tables 18 | # 19 | 20 | # Define the MAC addresses (BSSIDs) for your accesspoints in a table. 21 | table { 22 | 00:90:4b:0d:fd:c8, 23 | 00:02:6f:21:ea:8b 24 | } 25 | 26 | # Address masks are providing a simple way to match by MAC vendor ID. 27 | # 28 | # table { 00:02:6f:ff:ff:ff & ff:ff:ff:00:00:00 } 29 | 30 | # 31 | # Global options 32 | # 33 | 34 | # Comment this option to run hostapd in passive IAPP logging mode. 35 | set hostap interface $wlan 36 | 37 | # Use default radiotap mode. 38 | set hostap mode radiotap 39 | 40 | # Uncomment these options to jump to the next channel every 2 seconds. 41 | #set hostap hopper interface $wlan 42 | #set hostap hopper delay 2000 43 | 44 | # Use multicast (according to the revised standard). 45 | set iapp interface $wired 46 | set iapp mode multicast 47 | 48 | # The following mode is compatible to some pre-standard IAPP implementations 49 | #set iapp mode broadcast port 2313 50 | 51 | # 52 | # Event rules 53 | # 54 | 55 | # Log probe requests. 56 | hostap handle type management subtype probe request \ 57 | with iapp type radiotap 58 | 59 | # Log and annoy foreign accesspoints. 60 | # 61 | # This will be logged as well but the important thing is to 62 | # annoy other accesspoints in your wireless territory. 63 | hostap handle type data bssid ! \ 64 | with frame type management subtype deauth reason auth expire \ 65 | from &bssid to ff:ff:ff:ff:ff:ff bssid &bssid 66 | 67 | # The first de-auth example will not work with some newer stuff, like 68 | # iwi(4)/ipw(4) "centrino", because they ignore management frames to 69 | # the broadcast address as a countermeasure against the "void11" 70 | # attack. 71 | # 72 | # hostap handle type data bssid ! \ 73 | # with frame type management subtype deauth reason auth expire \ 74 | # from &bssid to &from bssid &bssid 75 | 76 | # Detect flooding of management frames except beacons. 77 | # This will detect some possible Denial of Service attacks 78 | # against the IEEE 802.11 protocol (like "void11"). 79 | hostap handle skip type management subtype ! beacon \ 80 | with log \ 81 | rate 100 / 10 sec 82 | 83 | # Finally log any rogue accesspoints limited to every second. 84 | hostap handle skip type management subtype beacon bssid ! \ 85 | with iapp type radiotap limit 1 sec 86 | 87 | -------------------------------------------------------------------------------- /patches/kemufuzzer-780ef603c35bb31e941e14d19f98f696583dc2d9.patch: -------------------------------------------------------------------------------- 1 | diff --git a/README b/README 2 | index 9d7397e..acabe4e 100644 3 | --- a/README 4 | +++ b/README 5 | @@ -4,7 +4,7 @@ KEMUFUZZER 6 | KEmuFuzzer is a tool to test system virtual machines based on emulation or 7 | direct native execution. 8 | 9 | -Currently KEmuFuzzer supports: BOCHS, QEMU, VMware, and VirtualBox. 10 | +Currently KEmuFuzzer supports: BHOCS, QEMU, VMware, and VirtualBox. 11 | 12 | 13 | AUTHORS 14 | diff --git a/kemufuzzer b/kemufuzzer 15 | index 84f0149..e35ae3d 100755 16 | --- a/kemufuzzer 17 | +++ b/kemufuzzer 18 | @@ -1,4 +1,4 @@ 19 | -#!/usr/bin/env python 20 | +#!/usr/bin/python 21 | # This file is part of KEmuFuzzer. 22 | # 23 | # KEmuFuzzer is free software: you can redistribute it and/or modify it under 24 | diff --git a/tc.py b/tc.py 25 | index c877436..4de3217 100644 26 | --- a/tc.py 27 | +++ b/tc.py 28 | @@ -1,5 +1,3 @@ 29 | -#!/usr/bin/env python 30 | - 31 | # This file is part of KEmuFuzzer. 32 | # 33 | # KEmuFuzzer is free software: you can redistribute it and/or modify it under 34 | diff --git a/tc_generate b/tc_generate 35 | index ba5d846..85dde9e 100755 36 | --- a/tc_generate 37 | +++ b/tc_generate 38 | @@ -1,4 +1,4 @@ 39 | -#!/usr/bin/env python 40 | +#!/usr/bin/python 41 | # This file is part of KEmuFuzzer. 42 | # 43 | # KEmuFuzzer is free software: you can redistribute it and/or modify it under 44 | diff --git a/tc_template b/tc_template 45 | index cc9b2c8..b8f352f 100755 46 | --- a/tc_template 47 | +++ b/tc_template 48 | @@ -1,4 +1,4 @@ 49 | -#!/usr/bin/env python 50 | +#!/usr/bin/python 51 | # This file is part of KEmuFuzzer. 52 | # 53 | # KEmuFuzzer is free software: you can redistribute it and/or modify it under 54 | diff --git a/tc_view b/tc_view 55 | index 1936993..76ba1ef 100755 56 | --- a/tc_view 57 | +++ b/tc_view 58 | @@ -1,4 +1,4 @@ 59 | -#!/usr/bin/env python 60 | +#!/usr/bin/python 61 | 62 | # This file is part of KEmuFuzzer. 63 | # 64 | diff --git a/vmware_driver.py b/vmware_driver.py 65 | index 57fd454..605635f 100644 66 | --- a/vmware_driver.py 67 | +++ b/vmware_driver.py 68 | @@ -1,5 +1,3 @@ 69 | -#!/usr/bin/env python 70 | - 71 | # This file is part of KEmuFuzzer. 72 | # 73 | # KEmuFuzzer is free software: you can redistribute it and/or modify it under 74 | diff --git a/x86_cpustate.py b/x86_cpustate.py 75 | index 5c0e10b..7e78d29 100644 76 | --- a/x86_cpustate.py 77 | +++ b/x86_cpustate.py 78 | @@ -1,5 +1,3 @@ 79 | -#!/usr/bin/env python 80 | - 81 | # This file is part of KEmuFuzzer. 82 | # 83 | # KEmuFuzzer is free software: you can redistribute it and/or modify it under 84 | diff --git a/x86_cpustate_diff b/x86_cpustate_diff 85 | index 8f9b8e3..ac225f7 100755 86 | --- a/x86_cpustate_diff 87 | +++ b/x86_cpustate_diff 88 | @@ -1,4 +1,4 @@ 89 | -#!/usr/bin/env python 90 | +#!/usr/bin/python 91 | 92 | # This file is part of KEmuFuzzer. 93 | # 94 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/dc/t20.in: -------------------------------------------------------------------------------- 1 | # $OpenBSD: t20.in,v 1.1 2003/12/09 12:46:32 otto Exp $ 2 | # 3 | # Copyright (c) 2003 Amit Singh 4 | # 5 | # Permission to use, copy, modify, and distribute this software for any 6 | # purpose with or without fee is hereby granted, provided that the above 7 | # copyright notice and this permission notice appear in all copies. 8 | # 9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | # 17 | # 18 | # The Towers Of Hanoi 19 | # dc (Unix Desk Calculator) version 20 | # http://hanoi.kernelthread.com 21 | # 22 | 23 | [ # move(from, to) 24 | n # print from 25 | [ --> ]n # print " --> " 26 | p # print to\n 27 | sw # p doesn't pop, so get rid of the value 28 | ]sm 29 | 30 | [ # init(n) 31 | sw # tuck n away temporarily 32 | 9 # sentinel as bottom of stack 33 | lw # bring n back 34 | 1 # "from" tower's label 35 | 3 # "to" tower's label 36 | 0 # processed marker 37 | ]si 38 | 39 | [ # Move() 40 | lt # push to 41 | lf # push from 42 | lmx # call move(from, to) 43 | ]sM 44 | 45 | [ # code block 46 | ln # push n 47 | lf # push from 48 | lt # push to 49 | 1 # push processed marker 1 50 | ln # push n 51 | 1 # push 1 52 | - # n - 1 53 | lf # push from 54 | ll # push left 55 | 0 # push processed marker 0 56 | ]sd 57 | 58 | [ # code block 59 | ln # push n 60 | 1 # push 1 61 | - # n - 1 62 | ll # push left 63 | lt # push to 64 | 0 # push processed marker 0 65 | ]se 66 | 67 | [ # code block 68 | ln 1 =M 69 | ln 1 !=d 70 | ]sx 71 | 72 | [ # code block 73 | lMx 74 | lex 75 | ]sy 76 | 77 | [ # quit() 78 | q # exit the program 79 | ]sq 80 | 81 | [ # run() 82 | d 9 =q # if stack empty, quit() 83 | sp # processed 84 | st # to 85 | sf # from 86 | sn # n 87 | 6 # 88 | lf # 89 | - # 90 | lt # 91 | - # 6 - from - to 92 | sl # 93 | lp 0 =x # 94 | lp 0 !=y # 95 | lrx # loop 96 | ]sr 97 | 98 | 5lix # init(n) 99 | lrx # run() 100 | 101 | -------------------------------------------------------------------------------- /patches/oss-fuzz-libressl.patch: -------------------------------------------------------------------------------- 1 | diff --git a/projects/libressl/Dockerfile b/projects/libressl/Dockerfile 2 | deleted file mode 100644 3 | index 636cc75..0000000 4 | --- a/projects/libressl/Dockerfile 5 | +++ /dev/null 6 | @@ -1,22 +0,0 @@ 7 | -# Copyright 2016 Google Inc. 8 | -# 9 | -# Licensed under the Apache License, Version 2.0 (the "License"); 10 | -# you may not use this file except in compliance with the License. 11 | -# You may obtain a copy of the License at 12 | -# 13 | -# http://www.apache.org/licenses/LICENSE-2.0 14 | -# 15 | -# Unless required by applicable law or agreed to in writing, software 16 | -# distributed under the License is distributed on an "AS IS" BASIS, 17 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | -# See the License for the specific language governing permissions and 19 | -# limitations under the License. 20 | -# 21 | -################################################################################ 22 | - 23 | -FROM gcr.io/oss-fuzz-base/base-builder 24 | -MAINTAINER estetus@gmail.com 25 | -RUN apt-get update && apt-get install -y make 26 | -RUN git clone --depth 1 https://github.com/libressl-portable/portable 27 | -WORKDIR portable 28 | -COPY build.sh $SRC/ 29 | diff --git a/projects/libressl/build.sh b/projects/libressl/build.sh 30 | deleted file mode 100755 31 | index 479df57..0000000 32 | --- a/projects/libressl/build.sh 33 | +++ /dev/null 34 | @@ -1,34 +0,0 @@ 35 | -#!/bin/bash -eu 36 | -# Copyright 2016 Google Inc. 37 | -# 38 | -# Licensed under the Apache License, Version 2.0 (the "License"); 39 | -# you may not use this file except in compliance with the License. 40 | -# You may obtain a copy of the License at 41 | -# 42 | -# http://www.apache.org/licenses/LICENSE-2.0 43 | -# 44 | -# Unless required by applicable law or agreed to in writing, software 45 | -# distributed under the License is distributed on an "AS IS" BASIS, 46 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 47 | -# See the License for the specific language governing permissions and 48 | -# limitations under the License. 49 | -# 50 | -################################################################################ 51 | - 52 | -CONFIGURE_FLAGS="" 53 | - 54 | -./autogen.sh 55 | -./configure 56 | - 57 | -make -j$(nproc) 58 | - 59 | -fuzzers=$(find fuzz -executable -type f '!' -name \*.py '!' -name \*-test '!' -name \*.pl) 60 | -for f in $fuzzers; do 61 | - fuzzer=$(basename $f) 62 | - cp $f $OUT/ 63 | - zip -j $OUT/${fuzzer}_seed_corpus.zip fuzz/corpora/${fuzzer}/* 64 | -done 65 | - 66 | -cp $SRC/*.options $OUT/ 67 | -cp fuzz/oids.txt $OUT/asn0.dict 68 | -cp fuzz/oids.txt $OUT/x509.dict 69 | diff --git a/projects/libressl/project.yaml b/projects/libressl/project.yaml 70 | deleted file mode 100644 71 | index 25abd34..0000000 72 | --- a/projects/libressl/project.yaml 73 | +++ /dev/null 74 | @@ -1,9 +0,0 @@ 75 | -homepage: "https://www.libressl.org/" 76 | -primary_contact: "beck@obtuse.com" 77 | -auto_ccs: 78 | - - "libressl-security@openbsd.org" 79 | -sanitizers: 80 | - - address 81 | - - memory: 82 | - experimental: True 83 | - - undefined 84 | -------------------------------------------------------------------------------- /tests/3rdparty/mangle.c: -------------------------------------------------------------------------------- 1 | /* 2 | https://ext4.wiki.kernel.org/index.php/Filesystem_Testing_Tools/mangle.c 3 | 4 | trivial binary file fuzzer by Ilja van Sprundel. 5 | It's usage is very simple, it takes a filename and headersize 6 | as input. it will then change approximatly between 0 and 10% of 7 | the header with random bytes (biased towards the highest bit set) 8 | 9 | obviously you need a bash script or something as a wrapper ! 10 | 11 | so far this broke: - libmagic (used file) 12 | - preview (osX pdf viewer) 13 | - xpdf (hang, not a crash ...) 14 | - mach-o loading (osX 10.3.7, seems to be fixed later) 15 | - qnx elf loader (panics almost instantly, yikes !) 16 | - FreeBSD elf loading 17 | - openoffice 18 | - amp 19 | - osX image loading (.dmg) 20 | - libbfd (used objdump) 21 | - libtiff (used tiff2pdf) 22 | - xine (division by 0, took 20 minutes of fuzzing) 23 | - OpenBSD elf loading (3.7 on a sparc) 24 | - unixware 713 elf loading 25 | - DragonFlyBSD elf loading 26 | - solaris 10 elf loading 27 | - cistron-radiusd 28 | - linux ext2fs (2.4.29) image loading (division by 0) 29 | - linux reiserfs (2.4.29) image loading (instant panic !!!) 30 | - linux jfs (2.4.29) image loading (long (uninteruptable) loop, 2 oopses) 31 | - linux xfs (2.4.29) image loading (instant panic) 32 | - windows macromedia flash .swf loading (obviously the windows version of mangle needs a few tweaks to work ...) 33 | - Quicktime player 7.0.1 for MacOS X 34 | - totem 35 | - gnumeric 36 | - vlc 37 | - mplayer 38 | - python bytecode interpreter 39 | - realplayer 10.0.6.776 (GOLD) 40 | - dvips 41 | */ 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | #define DEFAULT_HEADER_SIZE 1024 48 | #define DEFAULT_NAME "test2" 49 | 50 | int getseed(void) { 51 | int fd = open("/dev/urandom", O_RDONLY); 52 | int r; 53 | if (fd < 0) { 54 | perror("open"); 55 | exit(0); 56 | } 57 | read(fd, &r, sizeof(r)); 58 | close(fd); 59 | return(r); 60 | } 61 | 62 | int main(int argc, char **argv) { 63 | 64 | int fd; 65 | char *p, *name; 66 | unsigned char c; 67 | unsigned int count, i, off, hsize; 68 | 69 | if (argc < 2) { 70 | hsize = DEFAULT_HEADER_SIZE; 71 | name = DEFAULT_NAME; 72 | } else if (argc < 3) { 73 | hsize = DEFAULT_HEADER_SIZE; 74 | name = argv[1]; 75 | } else { 76 | hsize = atoi(argv[2]); 77 | name = argv[1]; 78 | } 79 | fd = open(name, O_RDWR); 80 | if (fd < 0) { 81 | perror("open"); 82 | exit(0); 83 | } 84 | p = mmap(0, hsize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); 85 | if ((int) p == -1) { 86 | perror("mmap"); 87 | close(fd); 88 | exit(0); 89 | } 90 | srand(getseed()); 91 | count = (unsigned) rand() % (hsize / 10); 92 | for (i = 0; i < count; i++) { 93 | off = rand() % hsize; 94 | c = rand() % 256; 95 | /* we want the highest bit set more often, in case of signedness issues */ 96 | if ( (rand() % 2) && c < 128) c |= 0x80; 97 | p[off] = c; 98 | } 99 | close(fd); 100 | munmap(p, hsize); 101 | } 102 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/relayd/relayd.conf: -------------------------------------------------------------------------------- 1 | # $OpenBSD: relayd.conf,v 1.3 2014/12/12 10:05:09 reyk Exp $ 2 | # 3 | # Macros 4 | # 5 | ext_addr="192.168.1.1" 6 | webhost1="10.0.0.1" 7 | webhost2="10.0.0.2" 8 | sshhost1="10.0.0.3" 9 | 10 | # 11 | # Global Options 12 | # 13 | # interval 10 14 | # timeout 1000 15 | # prefork 5 16 | 17 | # 18 | # Each table will be mapped to a pf table. 19 | # 20 | table { $webhost1 $webhost2 } 21 | table { 127.0.0.1 } 22 | 23 | # 24 | # Services will be mapped to a rdr rule. 25 | # 26 | redirect www { 27 | listen on $ext_addr port http interface trunk0 28 | 29 | # tag every packet that goes thru the rdr rule with RELAYD 30 | pftag RELAYD 31 | 32 | forward to check http "/" code 200 33 | forward to check icmp 34 | } 35 | 36 | # 37 | # Relay and protocol for HTTP layer 7 loadbalancing and SSL/TLS acceleration 38 | # 39 | http protocol https { 40 | match request header append "X-Forwarded-For" value "$REMOTE_ADDR" 41 | match request header append "X-Forwarded-By" \ 42 | value "$SERVER_ADDR:$SERVER_PORT" 43 | match request header set "Connection" value "close" 44 | 45 | # Various TCP performance options 46 | tcp { nodelay, sack, socket buffer 65536, backlog 128 } 47 | 48 | # tls { no tlsv1.0, ciphers HIGH } 49 | # tls session cache disable 50 | } 51 | 52 | relay wwwtls { 53 | # Run as a SSL/TLS accelerator 54 | listen on $ext_addr port 443 tls 55 | protocol https 56 | 57 | # Forward to hosts in the webhosts table using a src/dst hash 58 | forward to port http mode loadbalance \ 59 | check http "/" code 200 60 | } 61 | 62 | # 63 | # Relay and protocol for simple TCP forwarding on layer 7 64 | # 65 | protocol sshtcp { 66 | # The TCP_NODELAY option is required for "smooth" terminal sessions 67 | tcp nodelay 68 | } 69 | 70 | relay sshgw { 71 | # Run as a simple TCP relay 72 | listen on $ext_addr port 2222 73 | protocol sshtcp 74 | 75 | # Forward to the shared carp(4) address of an internal gateway 76 | forward to $sshhost1 port 22 77 | } 78 | 79 | # 80 | # Relay and protocol for a transparent HTTP proxy 81 | # 82 | http protocol httpfilter { 83 | # Return HTTP/HTML error pages to the client 84 | return error 85 | 86 | # Block disallowed sites 87 | match request label "URL filtered!" 88 | block request quick url "www.example.com/" value "*" 89 | 90 | # Block disallowed browsers 91 | match request label "Please try a different Browser" 92 | block request quick header "User-Agent" \ 93 | value "Mozilla/4.0 (compatible; MSIE *" 94 | 95 | # Block some well-known Instant Messengers 96 | match request label "Instant messenger disallowed!" 97 | block response quick header "Content-Type" \ 98 | value "application/x-msn-messenger" 99 | block response quick header "Content-Type" value "app/x-hotbar-xip20" 100 | block response quick header "Content-Type" value "application/x-icq" 101 | block response quick header "Content-Type" value "AIM/HTTP" 102 | block response quick header "Content-Type" \ 103 | value "application/x-comet-log" 104 | } 105 | 106 | relay httpproxy { 107 | # Listen on localhost, accept diverted connections from pf(4) 108 | listen on 127.0.0.1 port 8080 109 | protocol httpfilter 110 | 111 | # Forward to the original target host 112 | forward to destination 113 | } 114 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/patch/patch.opt_u: -------------------------------------------------------------------------------- 1 | --- README.orig Mon Nov 27 03:11:35 2017 2 | +++ README Mon Nov 27 03:16:04 2017 3 | @@ -1,54 +1,38 @@ 4 | Only two remote holes in the default install, in a heck of a long time! 5 | 6 | The OpenBSD project produces a FREE, multi-platform 4.4BSD-based UNIX-like 7 | -operating system. Our efforts emphasize portability, standardization, 8 | correctness, proactive security and integrated cryptography. As an example of 9 | the effect OpenBSD has, the popular OpenSSH software comes from OpenBSD. 10 | - 11 | OpenBSD is freely available from our download sites. 12 | 13 | The current release is OpenBSD 6.2, released Oct 9, 2017. 14 | 15 | -OpenBSD is developed entirely by volunteers. The project's development 16 | environment and developer events are funded through contributions collected by 17 | -The OpenBSD Foundation. Contributions ensure that OpenBSD will remain a vibrant 18 | and free operating system. 19 | 20 | 21 | Obviously, each developer working on OpenBSD has their own aims and priorities, 22 | -but it is possible to classify the goals we all share: 23 | +but it is possible to the goals we all share: 24 | 25 | -Provide the best development platform possible. Provide full source access to 26 | -developers and users, including the ability to look at CVS tree changes 27 | +Provide the best platform possible. Provide full source access to 28 | +developers and users, the ability to look at CVS tree changes 29 | directly. Users can even look at our source tree and changes directly on the 30 | web! 31 | 32 | Integrate good code from any source with acceptable licenses. ISC or Berkeley 33 | -style licences are preferred, the GPL is not acceptable when adding new code, 34 | NDAs are never acceptable. We want to make available source code that anyone 35 | -can use for ANY PURPOSE, with no restrictions. We strive to make our software 36 | -robust and secure, and encourage companies to use whichever pieces they want 37 | -to. There are commercial spin-offs of OpenBSD. 38 | +can use for with no . We strive to make our software 39 | +robust and secure, encourage companies to use whichever pieces they want 40 | +to. There are commercial of OpenBSD. 41 | 42 | -Pay attention to security problems and fix them before anyone else does. (Try 43 | +Pay attention to security fix them before anyone else does. (Try 44 | to be the #1 most secure operating system.) 45 | 46 | -Greater integration of cryptographic software. OpenBSD is developed and 47 | -released from Canada and due to Canadian law it is legal to export crypto to 48 | -the world (as researched by a Canadian individual and as documented in the 49 | +Greater integration of is developed and 50 | +released from Canada and Canadian law it is legal to export crypto to 51 | +the world (as researched by a and as documented in the 52 | Export Control list of Canada). 53 | 54 | -Track and implement standards (ANSI, POSIX, parts of X/Open, etc.) 55 | - 56 | -Work towards a very machine independent source tree. Support as many different 57 | -systems and hardware as feasible. 58 | - 59 | -Be as politics-free as possible; solutions should be decided on the basis of 60 | -technical merit. 61 | - 62 | -Focus on being developer-oriented in all senses, including holding 63 | -developer-only events called hackathons. 64 | - 65 | Do not let serious problems sit unsolved. 66 | 67 | -Make a release approximately every six months. 68 | +Make a release approximately six months. 69 | -------------------------------------------------------------------------------- /tests/regress/vmm_install.py: -------------------------------------------------------------------------------- 1 | # vmm-install is a tool for automated testing of operating systems supported by 2 | # OpenBSD vmm(4). 3 | # 4 | # See also: 5 | # 6 | # - [Anita, an Automated NetBSD Installation and Test Application](http://www.gson.org/netbsd/anita/) 7 | # - [Packer](https://github.com/ligurio/openbsd-tests/tree/master/packer-templates) 8 | # - virt-install 9 | 10 | # Scenarios: 11 | # 12 | # - Debian Linux https://github.com/vext01/recipes/blob/master/recipes/debian9_inside_vmm.md 13 | # - CentOS Linux https://twitter.com/i/web/status/936108666851180544 14 | # - OpenBSD https://gist.github.com/tvlooy/fd6bc5a77bc03f4d419f395dfcf4f038 15 | # - Alpine Linux https://medium.com/@dave_voutila/docker-on-openbsd-6-1-current-c620513b8110 16 | # 17 | # https://www.openbsd.org/faq/faq16.html 18 | 19 | import pexpect 20 | from subprocess import check_call, check_output 21 | 22 | def create_machine(): 23 | create_cmd = "vmctl create ~/Downloads/vm1.img - s 500M" 24 | check_call(create_cmd.split(" ")) 25 | start_cmd = "vmctl start openbsd - c - b / home/sergeyb/Downloads/bsd.rd - m 2G - i 1 - d / home/sergeyb/Download" 26 | check_call(start_cmd.split(" ")) 27 | 28 | def stop_machine(): 29 | stop_cmd = "vmctl stop openbsd" 30 | check_call(stop_cmd.split(" ")) 31 | 32 | def run_scenario(): 33 | child = pexpect.spawn("cu /dev/ttyp4") 34 | child.expect('Enter password:') 35 | child.sendline('password') 36 | child.expect(pexpect.EOF, timeout=None) 37 | cmd_show_data = child.before 38 | cmd_output = cmd_show_data.split('\r\n') 39 | for data in cmd_output: 40 | print data 41 | 42 | # see https://github.com/gson1703/anita/blob/master/anita.py#L1200 43 | 44 | child.expect("(I)nstall, (U)pgrade, (A)utoinstall or (S)hell?") 45 | child.send("I\r") 46 | child.expect("Terminal type? [vt220]") 47 | child.send("\r") 48 | child.expect("System hostname? (short form, e.g. 'foo')") 49 | child.send("foo\r") 50 | child.expect("Which network interface do you wish to configure? (or 'done') [vio0]") 51 | child.send("\r") 52 | child.expect("IPv4 address for vio0? (or 'dhcp' or 'none') [dhcp]") 53 | child.send("\r") 54 | child.expect("IPv6 address for vio0? (or 'autoconf' or 'none') [none]") 55 | child.send("\r") 56 | child.expect("Which network interface do you wish to configure? (or 'done') [done]") 57 | child.send("\r") 58 | child.expect("DNS domain name? (e.g. 'example.com') [my.domain]") 59 | child.send("\r") 60 | child.expect("DNS nameservers? (IP address list or 'none') [none]") 61 | child.send("\r") 62 | child.expect("Password for root account? (will not echo)") 63 | child.send("1q2w3e\r") 64 | child.expect("Password for root account? (again)") 65 | child.send("1q2w3e\r") 66 | child.expect("Start sshd(8) by default? [yes]") 67 | child.send("\r") 68 | child.expect("Change the default console to com0? [yes]") 69 | child.send("\r") 70 | child.expect("Which speed should com0 use? (or 'done') [9600]") 71 | child.send("115200\r") 72 | child.expect("Setup a user? (enter a lower-case loginname, or 'no') [no]") 73 | child.send("\r") 74 | child.expect("Allow root ssh login? (yes, no, prohibit-password) [no]") 75 | child.send("\r") 76 | child.expect("Which disk is the root disk? ('?' for details) [sd0]") 77 | child.send("\r") 78 | child.expect("Use (W)hole disk MBR, whole disk (G)PT or (E)dit? [whole]") 79 | child.send("\r") 80 | child.expect("Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout? [a]") 81 | child.send("\r") 82 | child.expect("Which disk do you wish to initialize? (or 'done') [done]") 83 | child.send("\r") 84 | child.expect("Location of sets? (disk http or 'done') [http]") 85 | child.send("disk") 86 | 87 | # detach console 88 | # send: "~^D" 89 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/cap_mkdb/termcap: -------------------------------------------------------------------------------- 1 | # A atio for1) daemon. 2 | 3 | eral] 4 | Li 5 | [Ph1] 6 | 1r-west] 7 | udp 8 | .0.2 9 | Add0.1 10 | gs= 11 | 2 12 | ISr= 13 | Conode 14 | l-ID= Nast 15 | ags= 16 | 17 | [N 18 | ID-_SUBNET 19 | 0 20 | Netmask= 0 21 | 22 | [Net-] 23 | ID 24 | Network.0 25 | N.0 26 | 27 | ult-de] 28 | DE 29 | SuiteESP-3DESeer 30 | com] 31 | Add 32 | Netmask= 255.0 33 | Nam10 34 | W ID 35 | ] 36 | Authen##### 37 | # 38 | l] 39 | Polic 40 | Ret= 3 41 | Excorage 42 | [Kte] 43 | Cred 44 | [X5erti 45 | CA-direy= / 46 | Ce/ 47 | CRpd/c 48 | Prition 49 | 50 | [Dhase] 51 | EXT 52 | TransfSHA 53 | nsforms 54 | [3DES-SHA] 55 | EC 56 | HAARED 57 | GROUP_D4 58 | Life= LI 59 | [AEA] 60 | EPTIO 61 | KEY_LENGTH=8:256 62 | HA= SHA 63 | AUTHETHODARED 64 | GRO4 65 | Life= MODE 66 | 67 | # AES-128 68 | A] 69 | EBC 70 | KEY_L28:128 71 | HASH_HA 72 | AUTHED 73 | GR MO024 74 | DE 75 | 76 | SHA] 77 | ENC 78 | KEY_LEN:192,HASGORI 79 | AUTRED 80 | 4 81 | Li 82 | [AES-256-SHA] 83 | EES_CBC 84 | K56,256:256 85 | H SHA 86 | AD 87 | GROUP_024 88 | Life LIFE_MAIN_MO# Blowfish 89 | 90 | ] 91 | EN 92 | KEY_LENGTH= 128,96:192 93 | HASA 94 | AUTHENRED 95 | GROU 96 | Liflt) 97 | [BLF-SHA85] 98 | BC 99 | KEY_LENGTH= 128,96:192 100 | HM= SHA 101 | D 102 | GR5 103 | Li### 104 | DES 105 | 106 | [QM-ESPS-SH 107 | Protocols= 108 | 109 | [Q] 110 | ProtocS-SH 111 | ProtocoSHA 112 | TE] 113 | 8 114 | 115 | [QM-EHA-S] 116 | Pr 117 | 118 | [QS-SUITE] 119 | Protoco92 120 | 121 | SUITE] 122 | PS-19A 123 | 124 | [] 125 | Pr 126 | [QMTE] 127 | HA 128 | 129 | E] 130 | P= A-PF AH 131 | MD5-SUITE] 132 | Proto 133 | 134 | [QTE] 135 | lt) 136 | TE] 137 | Prots= A 138 | 139 | [QM-EDES-SHA-AH-M] 140 | Pr 141 | [QM-ESP-3DES-SHA] 142 | P IPSEC_ESP 143 | Ts= DES-SHA-XF 144 | 145 | ] 146 | PROTOCP 147 | TrF 148 | 149 | [QM-ESP-3TRP] 150 | PRO_ESP 151 | TraA-TR 152 | [QM-ESP] 153 | PROTOCP 154 | TransfM-ES 155 | 156 | [QA-PFS] 157 | PCOL_EC_ESP 158 | TF 159 | 160 | [HA-TRP] 161 | ESP 162 | XF 163 | 164 | # AE8 165 | 166 | [SP-AES-1HA] 167 | PROT_ID=C_ESP 168 | Tr-XF 169 | -128-PFS] 170 | PRESP 171 | sfor F 172 | 173 | [QM-ERP] 174 | C_ESP 175 | Tr-128-TRP-XF 176 | 192- 177 | PROTOCOL_IDSP 178 | Trans 179 | 180 | [QS-192-SHA-PFS] 181 | PCOL_ID= IPSEC 182 | TraXF 183 | 184 | TRP] 185 | PROTOCO EC_ESP 186 | Transs= 256 187 | -256] 188 | PRESP 189 | HA-XF 190 | 191 | [HA-PFS] 192 | P 193 | Transf-AES-256-PFS-XF 194 | ] 195 | PRESP 196 | TranRP-X MD5 197 | 198 | [Q] 199 | PROL_IIPSE 200 | TransfoXF 201 | 202 | [QM-FS] 203 | PROTAH 204 | TS 205 | 206 | [SP-3DES-SHA-XF] 207 | TRANM_IDDES 208 | ENCAPSULATION_MODE= EL 209 | AA 210 | Life= E 211 | 212 | [SHA-PFS-XF] 213 | TRANDES 214 | EL 215 | AUTHEC_SHA 216 | GR24 217 | Life= LDE 218 | 219 | [QM-3DES-TRP 220 | TRARM_I 221 | ENCAPSURT 222 | ANTICA 223 | Li 224 | 225 | [QA-XF] 226 | TR 227 | ENCNEL 228 | ON_ALGORHA 229 | K128 230 | CK_MODE 231 | -XF] 232 | TRAAES 233 | PSULN_MODE= EL 234 | AA 235 | GR24 236 | K128 237 | ODE 238 | -TRP-XF] 239 | TRANSFOAES 240 | ENCASPORT 241 | AUTHENTIONHM= HMAC 242 | KEY_LEN 128 243 | Li 244 | 245 | [QM-ES] 246 | TRANSF AES 247 | ENNNEL 248 | AUTHENTA 249 | KEY_LE8 250 | Li LIFE_QE 251 | 252 | [QM-EES-1F] 253 | T AES 254 | ENCAPSULAL 255 | AUTHENTICA_ALGHA 256 | G M1024 257 | KEY 258 | Lif 259 | 260 | [QM-ES8-SHP-XF] 261 | TRS 262 | ENCAPSMODEORT 263 | AUTHENTION_ALGOR 264 | KEY 265 | Lif 266 | [QM-192-XF] 267 | TRAD= AES 268 | ENCNEL 269 | ITHM 270 | KEY_LEN 271 | LifMODE 272 | 273 | [Q] 274 | TRORM_ID= AES 275 | EN 276 | AUTA 277 | GR024 278 | 192 279 | LIFEODE 280 | 281 | [QM 282 | TRANSFO 283 | ENCLATI NSPORT 284 | A HSHA 285 | 192 286 | Life56 287 | 288 | SHA-XF] 289 | AES 290 | PSULEL 291 | ANTICTHM= MAC_SHA 292 | KEY_ 256 293 | = 294 | [QM-AES 295 | TRA AES 296 | ENC TUNNEL 297 | LGOR 298 | GROUP_D24 299 | KENGTH= 56 300 | L IFE_K_MODE 301 | 302 | XF] 303 | TRANM_IDAES 304 | T 305 | AUTHENHA 306 | KEY_L56 307 | L 308 | # AH 309 | 310 | [5-XF] 311 | TR 312 | ENCNEL 313 | AUTHCATID5 314 | LIFE_K_MODE 315 | 316 | F] 317 | TRANS5 318 | ENULAT 319 | GROESCRMODP4 320 | Li_MODE 321 | 322 | [Samp] 323 | LIS 324 | LIION= 36800:7200 325 | 326 | [Se] 327 | LIFE_= K 328 | LIF:1536 329 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/patch/patch.opt_c: -------------------------------------------------------------------------------- 1 | *** README.orig Mon Nov 27 03:11:35 2017 2 | --- README Mon Nov 27 03:16:04 2017 3 | *************** 4 | *** 1,54 **** 5 | Only two remote holes in the default install, in a heck of a long time! 6 | 7 | The OpenBSD project produces a FREE, multi-platform 4.4BSD-based UNIX-like 8 | - operating system. Our efforts emphasize portability, standardization, 9 | correctness, proactive security and integrated cryptography. As an example of 10 | the effect OpenBSD has, the popular OpenSSH software comes from OpenBSD. 11 | - 12 | OpenBSD is freely available from our download sites. 13 | 14 | The current release is OpenBSD 6.2, released Oct 9, 2017. 15 | 16 | - OpenBSD is developed entirely by volunteers. The project's development 17 | environment and developer events are funded through contributions collected by 18 | - The OpenBSD Foundation. Contributions ensure that OpenBSD will remain a vibrant 19 | and free operating system. 20 | 21 | 22 | Obviously, each developer working on OpenBSD has their own aims and priorities, 23 | ! but it is possible to classify the goals we all share: 24 | 25 | ! Provide the best development platform possible. Provide full source access to 26 | ! developers and users, including the ability to look at CVS tree changes 27 | directly. Users can even look at our source tree and changes directly on the 28 | web! 29 | 30 | Integrate good code from any source with acceptable licenses. ISC or Berkeley 31 | - style licences are preferred, the GPL is not acceptable when adding new code, 32 | NDAs are never acceptable. We want to make available source code that anyone 33 | ! can use for ANY PURPOSE, with no restrictions. We strive to make our software 34 | ! robust and secure, and encourage companies to use whichever pieces they want 35 | ! to. There are commercial spin-offs of OpenBSD. 36 | 37 | ! Pay attention to security problems and fix them before anyone else does. (Try 38 | to be the #1 most secure operating system.) 39 | 40 | ! Greater integration of cryptographic software. OpenBSD is developed and 41 | ! released from Canada and due to Canadian law it is legal to export crypto to 42 | ! the world (as researched by a Canadian individual and as documented in the 43 | Export Control list of Canada). 44 | 45 | - Track and implement standards (ANSI, POSIX, parts of X/Open, etc.) 46 | - 47 | - Work towards a very machine independent source tree. Support as many different 48 | - systems and hardware as feasible. 49 | - 50 | - Be as politics-free as possible; solutions should be decided on the basis of 51 | - technical merit. 52 | - 53 | - Focus on being developer-oriented in all senses, including holding 54 | - developer-only events called hackathons. 55 | - 56 | Do not let serious problems sit unsolved. 57 | 58 | ! Make a release approximately every six months. 59 | --- 1,38 ---- 60 | Only two remote holes in the default install, in a heck of a long time! 61 | 62 | The OpenBSD project produces a FREE, multi-platform 4.4BSD-based UNIX-like 63 | correctness, proactive security and integrated cryptography. As an example of 64 | the effect OpenBSD has, the popular OpenSSH software comes from OpenBSD. 65 | OpenBSD is freely available from our download sites. 66 | 67 | The current release is OpenBSD 6.2, released Oct 9, 2017. 68 | 69 | environment and developer events are funded through contributions collected by 70 | and free operating system. 71 | 72 | 73 | Obviously, each developer working on OpenBSD has their own aims and priorities, 74 | ! but it is possible to the goals we all share: 75 | 76 | ! Provide the best platform possible. Provide full source access to 77 | ! developers and users, the ability to look at CVS tree changes 78 | directly. Users can even look at our source tree and changes directly on the 79 | web! 80 | 81 | Integrate good code from any source with acceptable licenses. ISC or Berkeley 82 | NDAs are never acceptable. We want to make available source code that anyone 83 | ! can use for with no . We strive to make our software 84 | ! robust and secure, encourage companies to use whichever pieces they want 85 | ! to. There are commercial of OpenBSD. 86 | 87 | ! Pay attention to security fix them before anyone else does. (Try 88 | to be the #1 most secure operating system.) 89 | 90 | ! Greater integration of is developed and 91 | ! released from Canada and Canadian law it is legal to export crypto to 92 | ! the world (as researched by a and as documented in the 93 | Export Control list of Canada). 94 | 95 | Do not let serious problems sit unsolved. 96 | 97 | ! Make a release approximately six months. 98 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bgpd/bgpd.conf: -------------------------------------------------------------------------------- 1 | # $OpenBSD: bgpd.conf,v 1.8 2017/09/29 11:00:39 phessler Exp $ 2 | # sample bgpd configuration file 3 | # see bgpd.conf(5) 4 | 5 | #macros 6 | peer1="10.1.0.2" 7 | peer2="10.1.0.3" 8 | 9 | # global configuration 10 | AS 65001 11 | router-id 10.0.0.1 12 | # holdtime 180 13 | # holdtime min 3 14 | # listen on 127.0.0.1 15 | # listen on ::1 16 | # fib-update no 17 | # route-collector no 18 | # log updates 19 | # network 10.0.1.0/24 20 | 21 | # restricted socket for bgplg(8) 22 | # socket "/var/www/run/bgpd.rsock" restricted 23 | 24 | # neighbors and peers 25 | group "peering AS65002" { 26 | remote-as 65002 27 | neighbor $peer1 { 28 | descr "AS 65001 peer 1" 29 | announce self 30 | tcp md5sig password mekmitasdigoat 31 | } 32 | neighbor $peer2 { 33 | descr "AS 65001 peer 2" 34 | announce all 35 | local-address 10.0.0.8 36 | ipsec esp ike 37 | } 38 | } 39 | 40 | group "peering AS65042" { 41 | descr "peering AS 65042" 42 | remote-as 65042 43 | local-address 10.0.0.8 44 | ipsec ah ike 45 | neighbor 10.2.0.1 46 | neighbor 10.2.0.2 47 | } 48 | 49 | neighbor 10.0.1.0 { 50 | remote-as 65003 51 | descr upstream 52 | multihop 2 53 | local-address 10.0.0.8 54 | passive 55 | holdtime 180 56 | holdtime min 3 57 | announce none 58 | tcp md5sig key deadbeef 59 | } 60 | 61 | neighbor 10.0.2.0 { 62 | remote-as 65004 63 | descr upstream2 64 | local-address 10.0.0.8 65 | ipsec ah ike 66 | } 67 | 68 | neighbor 10.0.0.0/24 { 69 | descr "template for local peers" 70 | enforce neighbor-as no 71 | } 72 | 73 | neighbor 10.2.1.1 { 74 | remote-as 65023 75 | local-address 10.0.0.8 76 | ipsec esp in spi 1010 sha1 0a4f1d1f1a1c4f3c9e2f6f0f2a8e9c8c5a1b0b3b \ 77 | aes 0c1b3a6c7d7a8d2e0e7b4f3d5e8e6c1e 78 | ipsec esp out spi 1012 sha1 0e9c8f6a8e2c7d3a0b5d0d0f0a3c5c1d2b8e0f8b \ 79 | aes 4e0f2f1b5c4e3c0d0e2f2d3b8c5c8f0b 80 | } 81 | 82 | # do not send or use routes from EBGP neighbors without 83 | # further explicit configuration 84 | deny from ebgp 85 | deny to ebgp 86 | 87 | # allow updates to and from IBGP neighbors 88 | allow from ibgp 89 | allow to ibgp 90 | 91 | # filter out prefixes longer than 24 or shorter than 8 bits for IPv4 92 | # and longer than 48 or shorter than 16 bits for IPv6. 93 | allow from any inet prefixlen 8 - 24 94 | allow from any inet6 prefixlen 16 - 48 95 | 96 | # accept a default route (since the previous rule blocks this) 97 | #allow from any prefix 0.0.0.0/0 98 | #allow from any prefix ::/0 99 | 100 | # Honor requests to gracefully shutdown BGP sessions 101 | # https://tools.ietf.org/html/draft-ietf-grow-bgp-gshut 102 | match from any community GRACEFUL_SHUTDOWN set { localpref 0 } 103 | 104 | # https://www.arin.net/announcements/2014/20140130.html 105 | # This block will be subject to a minimum size allocation of /28 and a 106 | # maximum size allocation of /24. ARIN should use sparse allocation when 107 | # possible within that /10 block. 108 | allow from any prefix 23.128.0.0/10 prefixlen 24 - 28 # ARIN IPv6 transition 109 | 110 | # filter bogus networks according to RFC5735 111 | deny from any prefix 0.0.0.0/8 prefixlen >= 8 # 'this' network [RFC1122] 112 | deny from any prefix 10.0.0.0/8 prefixlen >= 8 # private space [RFC1918] 113 | deny from any prefix 100.64.0.0/10 prefixlen >= 10 # CGN Shared [RFC6598] 114 | deny from any prefix 127.0.0.0/8 prefixlen >= 8 # localhost [RFC1122] 115 | deny from any prefix 169.254.0.0/16 prefixlen >= 16 # link local [RFC3927] 116 | deny from any prefix 172.16.0.0/12 prefixlen >= 12 # private space [RFC1918] 117 | deny from any prefix 192.0.2.0/24 prefixlen >= 24 # TEST-NET-1 [RFC5737] 118 | deny from any prefix 192.168.0.0/16 prefixlen >= 16 # private space [RFC1918] 119 | deny from any prefix 198.18.0.0/15 prefixlen >= 15 # benchmarking [RFC2544] 120 | deny from any prefix 198.51.100.0/24 prefixlen >= 24 # TEST-NET-2 [RFC5737] 121 | deny from any prefix 203.0.113.0/24 prefixlen >= 24 # TEST-NET-3 [RFC5737] 122 | deny from any prefix 224.0.0.0/4 prefixlen >= 4 # multicast 123 | deny from any prefix 240.0.0.0/4 prefixlen >= 4 # reserved 124 | 125 | # filter bogus IPv6 networks according to IANA 126 | deny from any prefix ::/8 prefixlen >= 8 127 | deny from any prefix 0100::/64 prefixlen >= 64 # Discard-Only [RFC6666] 128 | deny from any prefix 2001:2::/48 prefixlen >= 48 # BMWG [RFC5180] 129 | deny from any prefix 2001:10::/28 prefixlen >= 28 # ORCHID [RFC4843] 130 | deny from any prefix 2001:db8::/32 prefixlen >= 32 # docu range [RFC3849] 131 | deny from any prefix 3ffe::/16 prefixlen >= 16 # old 6bone 132 | deny from any prefix fc00::/7 prefixlen >= 7 # unique local unicast 133 | deny from any prefix fe80::/10 prefixlen >= 10 # link local unicast 134 | deny from any prefix fec0::/10 prefixlen >= 10 # old site local unicast 135 | deny from any prefix ff00::/8 prefixlen >= 8 # multicast 136 | 137 | # filter bogon AS numbers 138 | # http://www.iana.org/assignments/as-numbers/as-numbers.xhtml 139 | deny from any AS 23456 # AS_TRANS 140 | deny from any AS 64496 - 64511 # Reserved for use in docs and code RFC5398 141 | deny from any AS 64512 - 65534 # Reserved for Private Use RFC6996 142 | deny from any AS 65535 # Reserved RFC7300 143 | deny from any AS 65536 - 65551 # Reserved for use in docs and code RFC5398 144 | deny from any AS 65552 - 131071 # Reserved 145 | deny from any AS 4200000000 - 4294967294 # Reserved for Private Use RFC6996 146 | deny from any AS 4294967295 # Reserved RFC7300 147 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bc/t1.in: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: t1.in,v 1.1 2003/09/25 19:40:07 otto Exp $ */ 2 | 3 | /* 4 | * Copyright (C) Caldera International Inc. 2001-2002. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code and documentation must retain the above 11 | * copyright notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. All advertising materials mentioning features or use of this software 16 | * must display the following acknowledgement: 17 | * This product includes software developed or owned by Caldera 18 | * International, Inc. 19 | * 4. Neither the name of Caldera International, Inc. nor the names of other 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 24 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 26 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 27 | * IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE FOR ANY DIRECT, 28 | * INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 32 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 33 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 | * POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | /* 38 | * @(#)bc.library 5.1 (Berkeley) 4/17/91 39 | */ 40 | 41 | scale = 20 42 | define e(x){ 43 | auto a, b, c, d, e, g, t, w, y 44 | 45 | t = scale 46 | scale = t + .434*x + 1 47 | 48 | w = 0 49 | if(x<0){ 50 | x = -x 51 | w = 1 52 | } 53 | y = 0 54 | while(x>2){ 55 | x = x/2 56 | y = y + 1 57 | } 58 | 59 | a=1 60 | b=1 61 | c=b 62 | d=1 63 | e=1 64 | for(a=1;1==1;a++){ 65 | b=b*x 66 | c=c*a+b 67 | d=d*a 68 | g = c/d 69 | if(g == e){ 70 | g = g/1 71 | while(y--){ 72 | g = g*g 73 | } 74 | scale = t 75 | if(w==1) return(1/g) 76 | return(g/1) 77 | } 78 | e=g 79 | } 80 | } 81 | 82 | define l(x){ 83 | auto a, b, c, d, e, f, g, u, s, t 84 | if(x <=0) return(1-10^scale) 85 | t = scale 86 | 87 | f=1 88 | scale = scale + scale(x) - length(x) + 1 89 | s=scale 90 | while(x > 2){ 91 | s = s + (length(x)-scale(x))/2 + 1 92 | if(s>0) scale = s 93 | x = sqrt(x) 94 | f=f*2 95 | } 96 | while(x < .5){ 97 | s = s + (length(x)-scale(x))/2 + 1 98 | if(s>0) scale = s 99 | x = sqrt(x) 100 | f=f*2 101 | } 102 | 103 | scale = t + length(f) - scale(f) + 1 104 | u = (x-1)/(x+1) 105 | 106 | scale = scale + 1.1*length(t) - 1.1*scale(t) 107 | s = u*u 108 | b = 2*f 109 | c = b 110 | d = 1 111 | e = 1 112 | for(a=3;1==1;a=a+2){ 113 | b=b*s 114 | c=c*a+d*b 115 | d=d*a 116 | g=c/d 117 | if(g==e){ 118 | scale = t 119 | return(u*c/d) 120 | } 121 | e=g 122 | } 123 | } 124 | 125 | define s(x){ 126 | auto a, b, c, s, t, y, p, n, i 127 | t = scale 128 | y = x/.7853 129 | s = t + length(y) - scale(y) 130 | if(s=0) n = (x/(2*p)+1)/2 136 | if(x<0) n = (x/(2*p)-1)/2 137 | x = x - 4*n*p 138 | if(n%2!=0) x = -x 139 | 140 | scale = t + length(1.2*t) - scale(1.2*t) 141 | y = -x*x 142 | a = x 143 | b = 1 144 | s = x 145 | for(i=3; 1==1; i=i+2){ 146 | a = a*y 147 | b = b*i*(i-1) 148 | c = a/b 149 | if(c==0){scale=t; return(s/1)} 150 | s = s+c 151 | } 152 | } 153 | 154 | define c(x){ 155 | auto t 156 | t = scale 157 | scale = scale+1 158 | x = s(x+2*a(1)) 159 | scale = t 160 | return(x/1) 161 | } 162 | 163 | define a(x){ 164 | auto a, b, c, d, e, f, g, s, t 165 | if(x==0) return(0) 166 | if(x==1) { 167 | if(scale<52) { 168 | return(.7853981633974483096156608458198757210492923498437764/1) 169 | } 170 | } 171 | t = scale 172 | f=1 173 | while(x > .5){ 174 | scale = scale + 1 175 | x= -(1-sqrt(1.+x*x))/x 176 | f=f*2 177 | } 178 | while(x < -.5){ 179 | scale = scale + 1 180 | x = -(1-sqrt(1.+x*x))/x 181 | f=f*2 182 | } 183 | s = -x*x 184 | b = f 185 | c = f 186 | d = 1 187 | e = 1 188 | for(a=3;1==1;a=a+2){ 189 | b=b*s 190 | c=c*a+d*b 191 | d=d*a 192 | g=c/d 193 | if(g==e){ 194 | scale = t 195 | return(x*c/d) 196 | } 197 | e=g 198 | } 199 | } 200 | 201 | define j(n,x){ 202 | auto a,b,c,d,e,g,i,s,k,t 203 | 204 | t = scale 205 | k = 1.36*x + 1.16*t - n 206 | k = length(k) - scale(k) 207 | if(k>0) scale = scale + k 208 | 209 | s= -x*x/4 210 | if(n<0){ 211 | n= -n 212 | x= -x 213 | } 214 | a=1 215 | c=1 216 | for(i=1;i<=n;i++){ 217 | a=a*x 218 | c = c*2*i 219 | } 220 | b=a 221 | d=1 222 | e=1 223 | for(i=1;1;i++){ 224 | a=a*s 225 | b=b*i*(n+i) + a 226 | c=c*i*(n+i) 227 | g=b/c 228 | if(g==e){ 229 | scale = t 230 | return(g/1) 231 | } 232 | e=g 233 | } 234 | } 235 | -------------------------------------------------------------------------------- /tests/afl-fuzz/afl_run: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | # 3 | # Copyright (c) 2017 Sergey Bronnikov 4 | # 5 | # Permission to use, copy, modify, and distribute this software for any 6 | # purpose with or without fee is hereby granted, provided that the above 7 | # copyright notice and this permission notice appear in all copies. 8 | # 9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | 17 | # marc.info (23.11.2017): 18 | # sed last kdump nm bc lex libc fold tcpdump 19 | # ssh mandoc ksh ctags make m4 yacc deroff cwm 20 | # radiusd ctfdump ctfconf sasyncd libutil pfctl 21 | # 22 | # TODO: 23 | # ldomd ypldap sed nm lex fold ssh mandoc ksh ctags yacc cwm ctfdump ctfconf pfctl 24 | 25 | # libfuzzer candidates: 26 | # chio 27 | # syslogd - no option -n 28 | 29 | set -eu 30 | 31 | SRC_BASE="/usr/src" 32 | CONF_PATH="/root/openbsd-tests/tools/afl" 33 | DATE="2016-11-23" 34 | 35 | type afl-fuzz || pkg_add afl 36 | type git || pkg_add git 37 | 38 | afl_exec () 39 | { 40 | _path=$1 41 | _cmd=$2 42 | _changes=$(git log --since=$DATE "$_path") 43 | if [ -z "$_changes" ]; then 44 | echo "No changes in the $_path!" 45 | return 46 | fi 47 | 48 | _app_name=$(basename "$_path") 49 | _run_cmd="cd $_path; CC=afl-gcc make; rm -rf in out; mkdir in out; cp /root/afl-static/$_app_name/* in/; cp /root/afl-static/$_app_name.dict .; $_cmd" 50 | tmux new-window -d -n "$_path" "$_run_cmd" 51 | tmux set-window-option -t "$_path" remain-on-exit on 52 | echo "$_app_name started" 53 | } 54 | 55 | tmux new-session -d -c $SRC_BASE -s afl-run || true 56 | 57 | afl_exec "bin/ed" "afl-fuzz -i in -o out ./ed @@ < POSIX" 58 | afl_exec "sbin/dhclient" "afl-fuzz -i in -o out ./dhclient -n -c @@ em0" 59 | afl_exec "sbin/dhclient" "afl-fuzz -i in -o out -x dhclient.dict ./dhclient -n -c @@ em0" 60 | afl_exec "sbin/isakmpd" "afl-fuzz -i in -o out ./isakmpd -n -f @@" # FIXME: dict 61 | afl_exec "sbin/iked" "afl-fuzz -i in -o out ./iked -n -f @@" # FIXME: dict 62 | afl_exec "usr.bin/cap_mkdb" "afl-fuzz -i in -o out ./cap_mkdb -f outfile @@" 63 | afl_exec "usr.bin/dc" "afl-fuzz -i in -o out ./dc -x @@" # FIXME: dict 64 | afl_exec "usr.bin/deroff" "afl-fuzz -i in -o out ./deroff @@" # FIXME: dict 65 | afl_exec "usr.bin/last" "afl-fuzz -i in -o out ./last -f @@" # FIXME: dict 66 | afl_exec "usr.bin/m4" "afl-fuzz -i in -o out ./m4 @@" # FIXME: dict 67 | # FIXME: afl_exec "usr.bin/bc" "afl-fuzz -i in -o out ./bc -d < @@" 68 | afl_exec "usr.bin/doas" "afl-fuzz -i in -o out ./doas -C @@ ls" 69 | afl_exec "usr.bin/doas" "afl-fuzz -i in -o out -x doas.dict ./doas -C @@ ls" 70 | afl_exec "usr.bin/make" "afl-fuzz -i in -o out ./make -q -f @@" 71 | #afl_exec "usr.bin/patch" "afl-fuzz -i in -o out ./patch -p1 -R README @@" 72 | afl_exec "usr.bin/kdump" "afl-fuzz -i in -o out ./kdump -f @@" 73 | afl_exec "usr.bin/keynote" "afl-fuzz -i in -o out ./keynote verify -e @@" # FIXME: corpus 74 | afl_exec "usr.bin/keynote" "afl-fuzz -i in -o out ./keynote verify -l @@" # FIXME: corpus 75 | afl_exec "usr.bin/keynote" "afl-fuzz -i in -o out ./keynote verify -k @@" # FIXME: corpus 76 | afl_exec "usr.bin/keynote" "afl-fuzz -i in -o out ./keynote verify @@" # FIXME: corpus 77 | # FIXME: afl_exec "usr.sbin/acme-client" "acme-client -f acme-client.conf example.com" 78 | afl_exec "usr.sbin/bgpd" "afl-fuzz -i in -o out ./bgpd -n -f @@" # FIXME: dict 79 | afl_exec "usr.sbin/dvmrpd" "afl-fuzz -i in -o out ./dvmrpd -n -f @@" # FIXME: dict 80 | afl_exec "usr.sbin/eigrpd" "afl-fuzz -i in -o out ./eigrpd -n -f @@" # FIXME: dict 81 | afl_exec "usr.sbin/hostapd" "afl-fuzz -i in -o out ./hostapd -f @@" # NOTE: there is no option -n 82 | afl_exec "usr.sbin/httpd" "afl-fuzz -i in -o out ./httpd -n -f @@" # FIXME: dict 83 | afl_exec "usr.sbin/ifstated" "afl-fuzz -i in -o out ./ifstated -n -f @@" # FIXME: dict 84 | afl_exec "usr.sbin/ldapd" "afl-fuzz -i in -o out ./ldapd -n -f @@" # FIXME: dict 85 | afl_exec "usr.sbin/ldpd" "afl-fuzz -i in -o out ./ldpd -n -f @@" # FIXME: dict 86 | afl_exec "usr.sbin/mtree" "afl-fuzz -i in -o out ./mtree -f @@ -p /" 87 | afl_exec "usr.sbin/mtree" "afl-fuzz -i in -o out -x mtree.dict ./mtree -f @@ -p /" 88 | afl_exec "usr.sbin/npppd" "afl-fuzz -i in -o out ./npppd/npppd -n -f @@" # FIXME: dict 89 | afl_exec "usr.sbin/ntpd" "afl-fuzz -i in -o out ./ntpd -n -f @@" # FIXME: dict 90 | afl_exec "usr.sbin/ospfd" "afl-fuzz -i in -o out ./ospfd -n -f @@" # FIXME: dict 91 | afl_exec "usr.sbin/ospf6d" "afl-fuzz -i in -o out ./ospf6d -n -f @@" # FIXME: dict 92 | afl_exec "usr.sbin/radiusd" "afl-fuzz -i in -o out ./radiusd/radiusd -n -f @@" # FIXME: dict 93 | afl_exec "usr.sbin/relayd" "afl-fuzz -i in -o out ./relayd -n -f @@" # FIXME: dict 94 | afl_exec "usr.sbin/ripd" "afl-fuzz -i in -o out ./ripd -n -f @@" # FIXME: dict 95 | afl_exec "usr.sbin/sasyncd" "afl-fuzz -i in -o out ./sasyncd -n -c @@" # FIXME: dict 96 | afl_exec "usr.sbin/smtpd" "afl-fuzz -i in -o out ./smtpd/smtpd -n -f @@" # FIXME: dict 97 | afl_exec "usr.sbin/snmpd" "afl-fuzz -i in -o out ./snmpd -n -f @@" # FIXME: dict 98 | afl_exec "usr.sbin/switchd" "afl-fuzz -i in -o out ./switchd -n -f @@" 99 | afl_exec "usr.sbin/switchd" "afl-fuzz -i in -o out -x switchd.dict ./switchd -n -f @@" 100 | afl_exec "usr.sbin/tcpdump" "afl-fuzz -i in -o out ./tcpdump -r @@" 101 | afl_exec "usr.sbin/tcpdump" "afl-fuzz -i in -o out -f tcpdump.expression -- ./tcpdump -r in/sample.pcap -F @@" # FIXME: dict 102 | afl_exec "usr.sbin/vmd" "afl-fuzz -i in -o out ./vmd -n -f @@" 103 | afl_exec "usr.sbin/vmd" "afl-fuzz -i in -o out -x vmd.dict ./vmd -n -f @@" 104 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/make/Makefile: -------------------------------------------------------------------------------- 1 | # $OpenBSD: bsd.prog.mk,v 1.75 2017/07/21 11:00:24 schwarze Exp $ 2 | # $NetBSD: bsd.prog.mk,v 1.55 1996/04/08 21:19:26 jtc Exp $ 3 | # @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 4 | 5 | .if exists(${.CURDIR}/../Makefile.inc) 6 | .include "${.CURDIR}/../Makefile.inc" 7 | .endif 8 | 9 | .include 10 | 11 | .SUFFIXES: .out .o .c .cc .cpp .C .cxx .y .l .s 12 | 13 | .if (defined(LDSTATIC) && !defined(STATICPIE)) || defined(NOPIE) 14 | CFLAGS+= ${NOPIE_FLAGS} 15 | CXXFLAGS+= ${NOPIE_FLAGS} 16 | AFLAGS+= ${NOPIE_FLAGS} 17 | LDFLAGS+= ${NOPIE_LDFLAGS} 18 | .endif 19 | 20 | .if ${WARNINGS:L} == "yes" 21 | CFLAGS+= ${CDIAGFLAGS} 22 | CXXFLAGS+= ${CXXDIAGFLAGS} 23 | .endif 24 | CFLAGS+= ${COPTS} 25 | CXXFLAGS+= ${CXXOPTS} 26 | 27 | CRTBEGIN?= ${DESTDIR}/usr/lib/crtbegin.o 28 | CRTEND?= ${DESTDIR}/usr/lib/crtend.o 29 | 30 | LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o 31 | LIBC?= ${DESTDIR}/usr/lib/libc.a 32 | LIBCRYPTO?= ${DESTDIR}/usr/lib/libcrypto.a 33 | LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a 34 | LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a 35 | LIBEVENT?= ${DESTDIR}/usr/lib/libevent.a 36 | LIBEXPAT?= ${DESTDIR}/usr/lib/libexpat.a 37 | LIBFORM?= ${DESTDIR}/usr/lib/libform.a 38 | LIBFORMW?= ${DESTDIR}/usr/lib/libformw.a 39 | LIBKEYNOTE?= ${DESTDIR}/usr/lib/libkeynote.a 40 | LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a 41 | LIBL?= ${DESTDIR}/usr/lib/libl.a 42 | LIBM?= ${DESTDIR}/usr/lib/libm.a 43 | LIBMENU?= ${DESTDIR}/usr/lib/libmenu.a 44 | LIBMENUW?= ${DESTDIR}/usr/lib/libmenuw.a 45 | LIBRADIUS?= ${DESTDIR}/usr/lib/libradius.a 46 | LIBOSSAUDIO?= ${DESTDIR}/usr/lib/libossaudio.a 47 | LIBPANEL?= ${DESTDIR}/usr/lib/libpanel.a 48 | LIBPANELW?= ${DESTDIR}/usr/lib/libpanelw.a 49 | LIBPCAP?= ${DESTDIR}/usr/lib/libpcap.a 50 | LIBPERL?= ${DESTDIR}/usr/lib/libperl.a 51 | LIBPTHREAD?= ${DESTDIR}/usr/lib/libpthread.a 52 | LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a 53 | LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a 54 | LIBSNDIO?= ${DESTDIR}/usr/lib/libsndio.a 55 | LIBSSL?= ${DESTDIR}/usr/lib/libssl.a 56 | LIBTLS?= ${DESTDIR}/usr/lib/libtls.a 57 | LIBTERMCAP?= ${DESTDIR}/usr/lib/libtermcap.a 58 | LIBTERMLIB?= ${DESTDIR}/usr/lib/libtermlib.a 59 | LIBUSB?= ${DESTDIR}/usr/lib/libusbhid.a 60 | LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a 61 | LIBY?= ${DESTDIR}/usr/lib/liby.a 62 | LIBZ?= ${DESTDIR}/usr/lib/libz.a 63 | 64 | .if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "amd64" || \ 65 | ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "i386" 66 | LIBARCH?= ${DESTDIR}/usr/lib/lib${MACHINE_ARCH}.a 67 | .else 68 | LIBARCH?= 69 | .endif 70 | 71 | .if defined(PROG) 72 | SRCS ?= ${PROG}.c 73 | MAN ?= ${PROG}.1 74 | .endif 75 | 76 | # if we have several progs, define appropriate vars instead 77 | .if defined(PROGS) 78 | . for p in ${PROGS} 79 | SRCS_$p ?= $p.c 80 | OBJS_$p = ${SRCS_$p:N*.h:N*.sh:R:S/$/.o/} 81 | DPADD_$p ?= ${DPADD} 82 | LDADD_$p ?= ${LDADD} 83 | 84 | # XXX still create SRCS, because it's what bsd.dep.mk understands 85 | SRCS += ${SRCS_$p} 86 | 87 | # and we can write the actual target already 88 | . if defined(OBJS_$p) && !empty(OBJS_$p) 89 | . if !empty(SRCS_$p:M*.C) || !empty(SRCS_$p:M*.cc) || \ 90 | !empty(SRCS_$p:M*.cpp) || !empty(SRCS_$p:M*.cxx) 91 | $p: ${LIBCRT0} ${OBJS_$p} ${LIBC} ${CRTBEGIN} ${CRTEND} ${DPADD_$p} 92 | ${CXX} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS_$p} ${LDADD_$p} 93 | . else 94 | $p: ${LIBCRT0} ${OBJS_$p} ${LIBC} ${CRTBEGIN} ${CRTEND} ${DPADD_$p} 95 | ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS_$p} ${LDADD_$p} 96 | . endif 97 | . endif 98 | . endfor 99 | MAN ?= ${PROGS:=.1} 100 | .endif 101 | 102 | .if defined(PROG) || defined(PROGS) 103 | # ... so we create appropriate full list of obj, dep, lex, yacc... 104 | . if !empty(SRCS:N*.h:N*.sh) 105 | OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/} 106 | DEPS+= ${OBJS:.o=.d} 107 | . endif 108 | 109 | _LEXINTM?=${SRCS:M*.l:.l=.c} 110 | _YACCINTM?=${SRCS:M*.y:.y=.c} 111 | .endif 112 | 113 | .if defined(PROG) 114 | . if defined(OBJS) && !empty(OBJS) 115 | . if !empty(SRCS:M*.C) || !empty(SRCS:M*.cc) || \ 116 | !empty(SRCS:M*.cpp) || !empty(SRCS:M*.cxx) 117 | ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${CRTBEGIN} ${CRTEND} ${DPADD} 118 | ${CXX} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD} 119 | . else 120 | ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${CRTBEGIN} ${CRTEND} ${DPADD} 121 | ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD} 122 | . endif 123 | . endif # defined(OBJS) && !empty(OBJS) 124 | .endif 125 | 126 | .MAIN: all 127 | all: ${PROG} ${PROGS} _SUBDIRUSE 128 | 129 | BUILDAFTER += ${PROG} ${PROGS} ${OBJS} 130 | 131 | .if !target(clean) 132 | clean: _SUBDIRUSE 133 | rm -f a.out [Ee]rrs mklog *.core y.tab.h \ 134 | ${PROG} ${PROGS} ${OBJS} ${_LEXINTM} ${_YACCINTM} ${CLEANFILES} 135 | .endif 136 | 137 | cleandir: _SUBDIRUSE clean 138 | 139 | .if !target(install) 140 | .if !target(beforeinstall) 141 | beforeinstall: 142 | .endif 143 | .if !target(afterinstall) 144 | afterinstall: 145 | .endif 146 | 147 | .if !target(realinstall) 148 | realinstall: 149 | . if defined(PROG) 150 | ${INSTALL} ${INSTALL_COPY} -S ${INSTALL_STRIP} \ 151 | -o ${BINOWN} -g ${BINGRP} \ 152 | -m ${BINMODE} ${PROG} ${DESTDIR}${BINDIR}/${PROG} 153 | . endif 154 | . if defined(PROGS) 155 | . for p in ${PROGS} 156 | ${INSTALL} ${INSTALL_COPY} -S ${INSTALL_STRIP} \ 157 | -o ${BINOWN} -g ${BINGRP} \ 158 | -m ${BINMODE} $p ${DESTDIR}${BINDIR}/$p 159 | . endfor 160 | . endif 161 | .endif 162 | 163 | install: maninstall _SUBDIRUSE 164 | .if defined(LINKS) && !empty(LINKS) 165 | . for lnk file in ${LINKS} 166 | @l=${DESTDIR}${lnk}; \ 167 | t=${DESTDIR}${file}; \ 168 | echo $$t -\> $$l; \ 169 | rm -f $$t; ln $$l $$t 170 | . endfor 171 | .endif 172 | 173 | maninstall: afterinstall 174 | afterinstall: realinstall 175 | realinstall: beforeinstall 176 | .endif 177 | 178 | .if !defined(NOMAN) 179 | .include 180 | .endif 181 | 182 | # if we already got bsd.lib.mk we don't want to wreck that 183 | .if !defined(_LIBS) 184 | .s.o: 185 | ${COMPILE.S} -MD -MF ${.TARGET:R}.d -o $@ ${.IMPSRC} 186 | 187 | .S.o: 188 | ${COMPILE.S} -MD -MF ${.TARGET:R}.d -o $@ ${.IMPSRC} 189 | .endif 190 | 191 | .include 192 | .include 193 | .include 194 | .include 195 | -------------------------------------------------------------------------------- /tests/afl-fuzz/static/bc/t17.in: -------------------------------------------------------------------------------- 1 | a=97 2 | b=98 3 | c=99 4 | d=100 5 | e=101 6 | f=102 7 | g=103 8 | h=104 9 | i=105 10 | j=106 11 | k=107 12 | l=108 13 | m=109 14 | n=110 15 | o=111 16 | p=112 17 | q=113 18 | r=114 19 | s=115 20 | t=116 21 | u=117 22 | v=118 23 | w=119 24 | x=120 25 | y=121 26 | z=122 27 | _=123 28 | a0=0 29 | a1=1 30 | a2=2 31 | a3=3 32 | a4=4 33 | a5=5 34 | a6=6 35 | a7=7 36 | a8=8 37 | a9=9 38 | a10=10 39 | a11=11 40 | a12=12 41 | a13=13 42 | a14=14 43 | a15=15 44 | a16=16 45 | a17=17 46 | a18=18 47 | a19=19 48 | a20=20 49 | a21=21 50 | a22=22 51 | a23=23 52 | a24=24 53 | a25=25 54 | a26=26 55 | a27=27 56 | a28=28 57 | a29=29 58 | a30=30 59 | a31=31 60 | a32=32 61 | a33=33 62 | a34=34 63 | a35=35 64 | a36=36 65 | a37=37 66 | a38=38 67 | a39=39 68 | a40=40 69 | a41=41 70 | a42=42 71 | a43=43 72 | a44=44 73 | a45=45 74 | a46=46 75 | a47=47 76 | a48=48 77 | a49=49 78 | a50=50 79 | a51=51 80 | a52=52 81 | a53=53 82 | a54=54 83 | a55=55 84 | a56=56 85 | a57=57 86 | a58=58 87 | a59=59 88 | a60=60 89 | a61=61 90 | a62=62 91 | a63=63 92 | a64=64 93 | a65=65 94 | a66=66 95 | a67=67 96 | a68=68 97 | a69=69 98 | a70=70 99 | a71=71 100 | a72=72 101 | a73=73 102 | a74=74 103 | a75=75 104 | a76=76 105 | a77=77 106 | a78=78 107 | a79=79 108 | a80=80 109 | a81=81 110 | a82=82 111 | a83=83 112 | a84=84 113 | a85=85 114 | a86=86 115 | a87=87 116 | a88=88 117 | a89=89 118 | a90=90 119 | a91=91 120 | a92=92 121 | a93=93 122 | a94=94 123 | a95=95 124 | a96=96 125 | a97=97 126 | a98=98 127 | a99=99 128 | a100=100 129 | a101=101 130 | a102=102 131 | a103=103 132 | a104=104 133 | a105=105 134 | a106=106 135 | a107=107 136 | a108=108 137 | a109=109 138 | a110=110 139 | a111=111 140 | a112=112 141 | a113=113 142 | a114=114 143 | a115=115 144 | a116=116 145 | a117=117 146 | a118=118 147 | a119=119 148 | a120=120 149 | a121=121 150 | a122=122 151 | a123=123 152 | a124=124 153 | a125=125 154 | a126=126 155 | a127=127 156 | a128=128 157 | a129=129 158 | a130=130 159 | a131=131 160 | a132=132 161 | a133=133 162 | a134=134 163 | a135=135 164 | a136=136 165 | a137=137 166 | a138=138 167 | a139=139 168 | a140=140 169 | a141=141 170 | a142=142 171 | a143=143 172 | a144=144 173 | a145=145 174 | a146=146 175 | a147=147 176 | a148=148 177 | a149=149 178 | a150=150 179 | a151=151 180 | a152=152 181 | a153=153 182 | a154=154 183 | a155=155 184 | a156=156 185 | a157=157 186 | a158=158 187 | a159=159 188 | a160=160 189 | a161=161 190 | a162=162 191 | a163=163 192 | a164=164 193 | a165=165 194 | a166=166 195 | a167=167 196 | a168=168 197 | a169=169 198 | a170=170 199 | a171=171 200 | a172=172 201 | a173=173 202 | a174=174 203 | a175=175 204 | a176=176 205 | a177=177 206 | a178=178 207 | a179=179 208 | a180=180 209 | a181=181 210 | a182=182 211 | a183=183 212 | a184=184 213 | a185=185 214 | a186=186 215 | a187=187 216 | a188=188 217 | a189=189 218 | a190=190 219 | a191=191 220 | a192=192 221 | a193=193 222 | a194=194 223 | a195=195 224 | a196=196 225 | a197=197 226 | a198=198 227 | a199=199 228 | a200=200 229 | a201=201 230 | a202=202 231 | a203=203 232 | a204=204 233 | a205=205 234 | a206=206 235 | a207=207 236 | a208=208 237 | a209=209 238 | a210=210 239 | a211=211 240 | a212=212 241 | a213=213 242 | a214=214 243 | a215=215 244 | a216=216 245 | a217=217 246 | a218=218 247 | a219=219 248 | a220=220 249 | a221=221 250 | a222=222 251 | a223=223 252 | a224=224 253 | a225=225 254 | a226=226 255 | a227=227 256 | a228=228 257 | a229=229 258 | a230=230 259 | a231=231 260 | a232=232 261 | a233=233 262 | a234=234 263 | a235=235 264 | a236=236 265 | a237=237 266 | a238=238 267 | a239=239 268 | a240=240 269 | a241=241 270 | a242=242 271 | a243=243 272 | a244=244 273 | a245=245 274 | a246=246 275 | a247=247 276 | a248=248 277 | a249=249 278 | a250=250 279 | a251=251 280 | a252=252 281 | a253=253 282 | a254=254 283 | a255=255 284 | a 285 | b 286 | c 287 | d 288 | e 289 | f 290 | g 291 | h 292 | i 293 | j 294 | k 295 | l 296 | m 297 | n 298 | o 299 | p 300 | q 301 | r 302 | s 303 | t 304 | u 305 | v 306 | w 307 | x 308 | y 309 | z 310 | _ 311 | a0 312 | a1 313 | a2 314 | a3 315 | a4 316 | a5 317 | a6 318 | a7 319 | a8 320 | a9 321 | a10 322 | a11 323 | a12 324 | a13 325 | a14 326 | a15 327 | a16 328 | a17 329 | a18 330 | a19 331 | a20 332 | a21 333 | a22 334 | a23 335 | a24 336 | a25 337 | a26 338 | a27 339 | a28 340 | a29 341 | a30 342 | a31 343 | a32 344 | a33 345 | a34 346 | a35 347 | a36 348 | a37 349 | a38 350 | a39 351 | a40 352 | a41 353 | a42 354 | a43 355 | a44 356 | a45 357 | a46 358 | a47 359 | a48 360 | a49 361 | a50 362 | a51 363 | a52 364 | a53 365 | a54 366 | a55 367 | a56 368 | a57 369 | a58 370 | a59 371 | a60 372 | a61 373 | a62 374 | a63 375 | a64 376 | a65 377 | a66 378 | a67 379 | a68 380 | a69 381 | a70 382 | a71 383 | a72 384 | a73 385 | a74 386 | a75 387 | a76 388 | a77 389 | a78 390 | a79 391 | a80 392 | a81 393 | a82 394 | a83 395 | a84 396 | a85 397 | a86 398 | a87 399 | a88 400 | a89 401 | a90 402 | a91 403 | a92 404 | a93 405 | a94 406 | a95 407 | a96 408 | a97 409 | a98 410 | a99 411 | a100 412 | a101 413 | a102 414 | a103 415 | a104 416 | a105 417 | a106 418 | a107 419 | a108 420 | a109 421 | a110 422 | a111 423 | a112 424 | a113 425 | a114 426 | a115 427 | a116 428 | a117 429 | a118 430 | a119 431 | a120 432 | a121 433 | a122 434 | a123 435 | a124 436 | a125 437 | a126 438 | a127 439 | a128 440 | a129 441 | a130 442 | a131 443 | a132 444 | a133 445 | a134 446 | a135 447 | a136 448 | a137 449 | a138 450 | a139 451 | a140 452 | a141 453 | a142 454 | a143 455 | a144 456 | a145 457 | a146 458 | a147 459 | a148 460 | a149 461 | a150 462 | a151 463 | a152 464 | a153 465 | a154 466 | a155 467 | a156 468 | a157 469 | a158 470 | a159 471 | a160 472 | a161 473 | a162 474 | a163 475 | a164 476 | a165 477 | a166 478 | a167 479 | a168 480 | a169 481 | a170 482 | a171 483 | a172 484 | a173 485 | a174 486 | a175 487 | a176 488 | a177 489 | a178 490 | a179 491 | a180 492 | a181 493 | a182 494 | a183 495 | a184 496 | a185 497 | a186 498 | a187 499 | a188 500 | a189 501 | a190 502 | a191 503 | a192 504 | a193 505 | a194 506 | a195 507 | a196 508 | a197 509 | a198 510 | a199 511 | a200 512 | a201 513 | a202 514 | a203 515 | a204 516 | a205 517 | a206 518 | a207 519 | a208 520 | a209 521 | a210 522 | a211 523 | a212 524 | a213 525 | a214 526 | a215 527 | a216 528 | a217 529 | a218 530 | a219 531 | a220 532 | a221 533 | a222 534 | a223 535 | a224 536 | a225 537 | a226 538 | a227 539 | a228 540 | a229 541 | a230 542 | a231 543 | a232 544 | a233 545 | a234 546 | a235 547 | a236 548 | a237 549 | a238 550 | a239 551 | a240 552 | a241 553 | a242 554 | a243 555 | a244 556 | a245 557 | a246 558 | a247 559 | a248 560 | a249 561 | a250 562 | a251 563 | a252 564 | a253 565 | a254 566 | a255 567 | --------------------------------------------------------------------------------