├── OMakefile ├── regress ├── OMakefile ├── Makefile └── config │ ├── Makefile │ ├── variants.conf │ ├── strings.conf │ ├── ip.conf │ ├── lists.conf │ └── OMakefile ├── apps ├── OMakefile ├── deens │ ├── default.zones │ ├── gen_deens_ml.ml │ ├── Makefile.gen_deens_ml │ ├── Makefile │ ├── OMakefile │ ├── conf.ml │ └── test.zone ├── sshd │ ├── server.rsa.key │ ├── Makefile │ ├── sshd.conf │ ├── OMakefile │ └── ssh_openssh_formats.ml ├── Makefile ├── bonjour │ └── Makefile └── mldig │ ├── Makefile │ └── OMakefile ├── dist ├── OMakefile ├── cryptokit │ ├── doc │ │ ├── .cvsignore │ │ ├── index_module_types.html │ │ ├── index_attributes.html │ │ ├── type_Cryptokit.Block.aes_decrypt.html │ │ ├── type_Cryptokit.Block.aes_encrypt.html │ │ ├── type_Cryptokit.Block.des_decrypt.html │ │ ├── type_Cryptokit.Block.des_encrypt.html │ │ ├── type_Cryptokit.Stream.arcfour.html │ │ ├── type_Cryptokit.Block.triple_des_decrypt.html │ │ ├── type_Cryptokit.Block.triple_des_encrypt.html │ │ ├── type_Cryptokit.Block.cipher.html │ │ ├── type_Cryptokit.Stream.cipher.html │ │ ├── type_Cryptokit.Block.cbc_decrypt.html │ │ ├── type_Cryptokit.Block.cbc_encrypt.html │ │ ├── type_Cryptokit.Block.ofb.html │ │ ├── index_exceptions.html │ │ ├── type_Cryptokit.Block.cfb_decrypt.html │ │ ├── type_Cryptokit.Block.cfb_encrypt.html │ │ ├── type_Cryptokit.Block.cipher_padded_decrypt.html │ │ ├── type_Cryptokit.Block.cipher_padded_encrypt.html │ │ ├── type_Cryptokit.Padding.scheme.html │ │ ├── type_Cryptokit.Block.mac.html │ │ ├── type_Cryptokit.Random.rng.html │ │ ├── type_Cryptokit.Hexa.html │ │ ├── type_Cryptokit.Zlib.html │ │ ├── type_Cryptokit.Stream.stream_cipher.html │ │ ├── type_Cryptokit.Block.block_cipher.html │ │ ├── type_Cryptokit.Base64.html │ │ ├── type_Cryptokit.Block.mac_final_triple.html │ │ ├── Cryptokit.Stream.cipher.html │ │ ├── index.html │ │ ├── Cryptokit.Block.aes_decrypt.html │ │ ├── Cryptokit.Block.des_decrypt.html │ │ ├── Cryptokit.Block.triple_des_decrypt.html │ │ ├── Cryptokit.Block.des_encrypt.html │ │ ├── Cryptokit.Block.aes_encrypt.html │ │ ├── Cryptokit.Stream.arcfour.html │ │ ├── Cryptokit.Block.triple_des_encrypt.html │ │ ├── Cryptokit.Block.cfb_decrypt.html │ │ ├── type_Cryptokit.hash.html │ │ ├── Cryptokit.Block.cipher.html │ │ ├── type_Cryptokit.Padding.html │ │ ├── Cryptokit.Block.ofb.html │ │ ├── Cryptokit.Block.cbc_decrypt.html │ │ ├── type_Cryptokit.Stream.html │ │ ├── Cryptokit.Random.rng.html │ │ ├── Cryptokit.Block.cfb_encrypt.html │ │ ├── Cryptokit.Block.cipher_padded_decrypt.html │ │ ├── Cryptokit.Block.cipher_padded_encrypt.html │ │ ├── Cryptokit.Block.cbc_encrypt.html │ │ ├── index_types.html │ │ ├── Cryptokit.Stream.stream_cipher.html │ │ ├── style.css │ │ ├── Cryptokit.Block.mac.html │ │ ├── Cryptokit.Block.block_cipher.html │ │ ├── type_Cryptokit.transform.html │ │ ├── Cryptokit.Hexa.html │ │ ├── index_class_types.html │ │ ├── Cryptokit.Zlib.html │ │ └── Cryptokit.Block.mac_final_triple.html │ ├── Makefile.wrapper │ ├── Changes │ ├── .depend │ ├── d3des.h │ ├── OMakefile │ ├── arcfour.h │ ├── sha1.h │ ├── sha256.h │ ├── ripemd160.h │ ├── stubs-sha1.c │ ├── stubs-sha256.c │ ├── stubs-ripemd160.c │ ├── stubs-des.c │ ├── stubs-misc.c │ ├── arcfour.c │ ├── rijndael-alg-fst.h │ ├── stubs-md5.c │ └── stubs-arcfour.c ├── getopt │ ├── README │ ├── META │ ├── Makefile.wrapper │ ├── OMakefile │ ├── Changes │ ├── Makefile │ ├── sample.ml │ └── COPYING └── Makefile ├── tools ├── OMakefile ├── spl │ ├── spl_stdlib.mli │ ├── Makefile │ ├── Makefile.stdlib │ ├── Makefile.splc │ ├── OMakefile │ ├── style.css │ ├── spl_optimiser.mli │ ├── spl_utils.mli │ ├── spl_typechecker.mli │ ├── template.html │ ├── spl_stdlib.ml │ ├── spl_location.ml │ └── spl_cfg.mli ├── Makefile └── mpl │ ├── Makefile.stdlib │ ├── Makefile │ ├── Makefile.mplc │ ├── OMakefile │ ├── mpl_types.ml │ └── mpl_location.ml ├── lib ├── OMakefile ├── ssh │ ├── BUGS │ ├── ssh_env_t.ml │ ├── Makefile │ ├── ssh_tty.mli │ ├── OMakefile │ ├── ssh_keys.ml │ ├── ssh_userauth.ml │ ├── ssh_pool.ml │ └── ssh_version.ml ├── udp │ ├── Makefile │ ├── udp.mpl │ └── OMakefile ├── icmp │ ├── Makefile │ ├── OMakefile │ └── icmp.mpl ├── ipv4 │ ├── Makefile │ ├── OMakefile │ └── ipv4.mpl ├── ethernet │ ├── Makefile │ ├── OMakefile │ └── ethernet.mpl ├── dhcp │ ├── Makefile │ ├── OMakefile │ ├── dhcplib.ml │ └── dhcp.mpl ├── pcap │ ├── Makefile │ ├── pcap_entry.mpl │ └── OMakefile ├── ounix │ ├── Makefile │ ├── OMakefile │ ├── olog.mli │ └── olog.ml ├── Makefile ├── dns │ ├── dnsserver.mli │ ├── Makefile │ ├── OMakefile │ ├── dnsquery.mli │ ├── dnsserver.ml │ ├── dnstrie.mli │ ├── dnsrr.mli │ └── dns.mpl └── config │ ├── Makefile │ ├── OMakefile │ ├── config_location.ml │ ├── config_lexer.mll │ └── config_parser.mly ├── README ├── config.mk.in ├── mk ├── prog.mk ├── regress.mk ├── lib.mk └── base.mk ├── Makefile ├── configure.ac └── .gitignore /OMakefile: -------------------------------------------------------------------------------- 1 | 2 | # empty 3 | 4 | -------------------------------------------------------------------------------- /regress/OMakefile: -------------------------------------------------------------------------------- 1 | .SUBDIRS: config 2 | -------------------------------------------------------------------------------- /apps/OMakefile: -------------------------------------------------------------------------------- 1 | .SUBDIRS: deens mldig sshd 2 | -------------------------------------------------------------------------------- /apps/deens/default.zones: -------------------------------------------------------------------------------- 1 | test.zone 2 | . 3 | -------------------------------------------------------------------------------- /dist/OMakefile: -------------------------------------------------------------------------------- 1 | .SUBDIRS: getopt cryptokit 2 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/.cvsignore: -------------------------------------------------------------------------------- 1 | *.html 2 | style.css 3 | -------------------------------------------------------------------------------- /tools/OMakefile: -------------------------------------------------------------------------------- 1 | .SUBDIRS: mpl spl 2 | include OMakefile 3 | export 4 | -------------------------------------------------------------------------------- /lib/OMakefile: -------------------------------------------------------------------------------- 1 | .SUBDIRS: config ounix dns udp ethernet ssh dhcp icmp ipv4 pcap 2 | -------------------------------------------------------------------------------- /lib/ssh/BUGS: -------------------------------------------------------------------------------- 1 | - olog needs to move to ounix 2 | - server.ml needs to disappear 3 | -------------------------------------------------------------------------------- /dist/getopt/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avsm/melange/HEAD/dist/getopt/README -------------------------------------------------------------------------------- /lib/udp/Makefile: -------------------------------------------------------------------------------- 1 | RESULT= udp 2 | MPL_AUTOGEN= udp 3 | 4 | include ../../mk/lib.mk 5 | 6 | -------------------------------------------------------------------------------- /apps/sshd/server.rsa.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avsm/melange/HEAD/apps/sshd/server.rsa.key -------------------------------------------------------------------------------- /lib/icmp/Makefile: -------------------------------------------------------------------------------- 1 | RESULT= icmp 2 | MPL_AUTOGEN= icmp 3 | 4 | include ../../mk/lib.mk 5 | 6 | -------------------------------------------------------------------------------- /lib/ipv4/Makefile: -------------------------------------------------------------------------------- 1 | MPL_AUTOGEN= ipv4 2 | RESULT= ipv4 3 | 4 | include ../../mk/lib.mk 5 | 6 | -------------------------------------------------------------------------------- /tools/spl/spl_stdlib.mli: -------------------------------------------------------------------------------- 1 | val get_tcp_sock_factory : int -> unit -> out_channel * in_channel 2 | -------------------------------------------------------------------------------- /lib/ethernet/Makefile: -------------------------------------------------------------------------------- 1 | MPL_AUTOGEN= ethernet 2 | RESULT= ethernet 3 | 4 | include ../../mk/lib.mk 5 | 6 | -------------------------------------------------------------------------------- /regress/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS=config 2 | 3 | %: 4 | for i in $(SUBDIRS); do (cd $$i && $(MAKE) $@); done 5 | 6 | -------------------------------------------------------------------------------- /tools/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS=mpl spl 2 | 3 | all: 4 | %: 5 | for i in $(SUBDIRS); do (cd $$i && $(MAKE) $@); done 6 | -------------------------------------------------------------------------------- /apps/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS=deens sshd bonjour mldig 2 | 3 | %: 4 | for i in $(SUBDIRS); do (cd $$i && $(MAKE) $@); done 5 | -------------------------------------------------------------------------------- /lib/dhcp/Makefile: -------------------------------------------------------------------------------- 1 | MPL_AUTOGEN= dhcp 2 | SOURCES= dhcplib.ml 3 | RESULT= dhcp 4 | 5 | include ../../mk/lib.mk 6 | 7 | -------------------------------------------------------------------------------- /lib/pcap/Makefile: -------------------------------------------------------------------------------- 1 | MPL_AUTOGEN= pcap_entry 2 | SOURCES= pcap 3 | RESULT= pcap 4 | 5 | include ../../mk/lib.mk 6 | 7 | -------------------------------------------------------------------------------- /dist/getopt/META: -------------------------------------------------------------------------------- 1 | requires = "" 2 | version = "20040420" 3 | archive(byte) = "getopt.cma" 4 | archive(native) = "getopt.cmxa" 5 | -------------------------------------------------------------------------------- /dist/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIR=cryptokit getopt 2 | 3 | all: 4 | %: 5 | for i in $(SUBDIR); do (cd $$i && $(MAKE) -f Makefile.wrapper $@); done 6 | -------------------------------------------------------------------------------- /lib/ounix/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES = ounix_stubs.c pty_stubs.c olog.mli olog.ml ounix.mli ounix.ml 2 | RESULT = ounix 3 | 4 | include ../../mk/lib.mk 5 | -------------------------------------------------------------------------------- /apps/deens/gen_deens_ml.ml: -------------------------------------------------------------------------------- 1 | 2 | (* Create the autogenerated variant ML file *) 3 | 4 | let _ = 5 | print_endline (Config.generate_ml Conf.vt) 6 | 7 | -------------------------------------------------------------------------------- /regress/config/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES = regress.ml 2 | RESULT = regress 3 | 4 | LIBS= unix str 5 | MELANGE_LIBS= config 6 | 7 | include ../../mk/regress.mk 8 | 9 | -------------------------------------------------------------------------------- /regress/config/variants.conf: -------------------------------------------------------------------------------- 1 | # test out simple variants, Foo Bar Alpha Beta 2 | 3 | config1 = Foo; 4 | config2 = Bar; 5 | config3 = [ Foo, Bar]; 6 | config4 = []; 7 | -------------------------------------------------------------------------------- /dist/getopt/Makefile.wrapper: -------------------------------------------------------------------------------- 1 | all: 2 | $(MAKE) all 3 | $(MAKE) allopt 4 | 5 | depend: 6 | $(MAKE) depend 7 | 8 | install: 9 | 10 | clean: 11 | $(MAKE) clean 12 | -------------------------------------------------------------------------------- /lib/pcap/pcap_entry.mpl: -------------------------------------------------------------------------------- 1 | packet pcap_entry { 2 | sec: uint32; 3 | usec: uint32; 4 | caplen: uint32 value(sizeof(data)); 5 | reallen: uint32; 6 | data: byte[caplen]; 7 | } 8 | -------------------------------------------------------------------------------- /dist/cryptokit/Makefile.wrapper: -------------------------------------------------------------------------------- 1 | all: 2 | $(MAKE) all 3 | $(MAKE) allopt 4 | 5 | depend: 6 | $(MAKE) depend 7 | 8 | install: 9 | 10 | clean: 11 | $(MAKE) clean 12 | -------------------------------------------------------------------------------- /dist/getopt/OMakefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean 2 | 3 | FILES[] = getopt 4 | PROGRAM = getopt 5 | 6 | .DEFAULT: $(OCamlLibrary $(PROGRAM), $(FILES)) 7 | 8 | clean: 9 | $(CLEAN) 10 | -------------------------------------------------------------------------------- /lib/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS=ounix ipv4 ethernet udp dhcp pcap ounix ssh dns icmp config 2 | BUILD_ROOT=.. 3 | 4 | all: 5 | %: 6 | for i in $(SUBDIRS); do (cd $$i && $(MAKE) $@); done 7 | 8 | -------------------------------------------------------------------------------- /apps/bonjour/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES= bonjour_app.ml 2 | RESULT= bonjour 3 | THREADS=yes 4 | 5 | USE_MPL= Yes 6 | LIBS= str 7 | MELANGE_LIBS= ounix dns 8 | 9 | include ../../mk/prog.mk 10 | 11 | -------------------------------------------------------------------------------- /lib/dns/dnsserver.mli: -------------------------------------------------------------------------------- 1 | (* 2 | dnsserver.ml -- an authoritative DNS server 3 | Copyright (c) 2005-2006 Tim Deegan 4 | *) 5 | val load_zone : string list -> string -> unit 6 | -------------------------------------------------------------------------------- /tools/spl/Makefile: -------------------------------------------------------------------------------- 1 | 2 | FILES=splc stdlib 3 | 4 | depend: 5 | native: 6 | bytecode: 7 | 8 | all: 9 | %: 10 | for i in $(FILES); do $(MAKE) -f Makefile.$$i $@; done 11 | 12 | depend: 13 | -------------------------------------------------------------------------------- /apps/mldig/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES = utils.ml resolvconf.ml dig.ml 2 | RESULT = mldig 3 | 4 | USE_MPL= Yes 5 | LIBS= unix str mpl_stdlib 6 | MELANGE_LIBS= ounix udp dns 7 | 8 | include ../../mk/prog.mk 9 | 10 | -------------------------------------------------------------------------------- /regress/config/strings.conf: -------------------------------------------------------------------------------- 1 | # just test string parsing 2 | 3 | config1 = "foo"; 4 | 5 | config2 = "bar"; 6 | 7 | config3 = "foobar"; 8 | config4.blah = "blahblah"; 9 | config4.blah2 = "blah2blah2"; 10 | -------------------------------------------------------------------------------- /regress/config/ip.conf: -------------------------------------------------------------------------------- 1 | # test out ip address parsing 2 | 3 | config1 = "1.2.3.4"; 4 | config2 = 0.0.0.0; 5 | config3 = ["5.6.7.8", "192.168.1.3", "12.34.56.78"]; 6 | config4 = []; 7 | config5 = [0.0.0.0, 1.2.3.4]; 8 | 9 | -------------------------------------------------------------------------------- /dist/getopt/Changes: -------------------------------------------------------------------------------- 1 | 2000-07-15 Initial release 2 | 3 | 2000-08-04 Findlib installation 4 | 5 | 2003-03-01 Bug fix in Makefile 6 | 7 | 2004-04-20 Cleanup, ocamldoc'ed, MIT license 8 | 9 | 2004-08-11 Typos in COPYING -------------------------------------------------------------------------------- /tools/mpl/Makefile.stdlib: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | OCAMLMAKEFILE = ../../OCamlMakefile 4 | 5 | SOURCES = mpl_stdlib.mli mpl_stdlib.ml 6 | LIBS = unix str 7 | RESULT = mpl_stdlib 8 | all: ncl dcl 9 | 10 | include $(OCAMLMAKEFILE) 11 | -------------------------------------------------------------------------------- /tools/mpl/Makefile: -------------------------------------------------------------------------------- 1 | depend: 2 | 3 | native: 4 | bytecode: 5 | all: 6 | ${MAKE} -f Makefile.mplc all 7 | ${MAKE} -f Makefile.stdlib all 8 | 9 | clean: 10 | ${MAKE} -f Makefile.mplc clean 11 | ${MAKE} -f Makefile.stdlib clean 12 | 13 | -------------------------------------------------------------------------------- /lib/udp/udp.mpl: -------------------------------------------------------------------------------- 1 | packet udp { 2 | source_port: uint16; 3 | dest_port: uint16; 4 | length: uint16 min(8) value(offset(total_length)); 5 | checksum: uint16 default(0); 6 | data: byte[length - offset(checksum)]; 7 | total_length: label; 8 | } -------------------------------------------------------------------------------- /lib/ethernet/OMakefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean 2 | 3 | OCAMLINCLUDES += $(MPL_DIR) 4 | 5 | MPL_FILES[] = ethernet 6 | MPLGenerated($(MPL_FILES)) 7 | 8 | .DEFAULT: $(OCamlLibrary ethernet, ethernet) 9 | 10 | clean: 11 | $(CLEAN) $(addsuffix .ml, $(MPL_FILES)) ethernet 12 | -------------------------------------------------------------------------------- /lib/udp/OMakefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean 2 | 3 | OCAMLINCLUDES += $(MPL_DIR) 4 | 5 | MPL_FILES[] = udp 6 | MPLGenerated($(MPL_FILES)) 7 | 8 | FILES[] = udp 9 | PROGRAM = udp 10 | 11 | .DEFAULT: $(OCamlLibrary $(PROGRAM),$(FILES)) 12 | 13 | clean: 14 | $(CLEAN) $(PROGRAM) 15 | -------------------------------------------------------------------------------- /lib/icmp/OMakefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean 2 | 3 | OCAMLINCLUDES += $(MPL_DIR) 4 | 5 | MPL_FILES[] = icmp 6 | MPLGenerated($(MPL_FILES)) 7 | 8 | FILES[] = icmp 9 | PROGRAM = icmp 10 | 11 | .DEFAULT: $(OCamlLibrary $(PROGRAM),$(FILES)) 12 | 13 | clean: 14 | $(CLEAN) $(PROGRAM) 15 | -------------------------------------------------------------------------------- /lib/ipv4/OMakefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean 2 | 3 | OCAMLINCLUDES += $(MPL_DIR) 4 | 5 | MPL_FILES[] = ipv4 6 | MPLGenerated($(MPL_FILES)) 7 | 8 | FILES[] = ipv4 9 | PROGRAM = ipv4 10 | 11 | .DEFAULT: $(OCamlLibrary $(PROGRAM),$(FILES)) 12 | 13 | clean: 14 | $(CLEAN) $(PROGRAM) 15 | -------------------------------------------------------------------------------- /tools/spl/Makefile.stdlib: -------------------------------------------------------------------------------- 1 | OCAMLMAKEFILE = ../../OCamlMakefile 2 | 3 | SOURCES = spl_stdlib.mli spl_stdlib.ml 4 | LIBS = unix str 5 | RESULT = spl_stdlib 6 | 7 | native: ncl 8 | bytecode: bcl 9 | all: native bytecode 10 | 11 | depend: 12 | 13 | include $(OCAMLMAKEFILE) 14 | -------------------------------------------------------------------------------- /apps/sshd/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES = server.ml ssh_openssh_formats.ml sshd.ml 2 | RESULT = sshd 3 | 4 | LIBS= unix nums cryptokit str mpl_stdlib spl_stdlib 5 | USE_MPL= Yes 6 | USE_SPL= Yes 7 | MELANGE_LIBS= ounix ssh config 8 | DISTS= cryptokit 9 | 10 | include ../../mk/prog.mk 11 | -------------------------------------------------------------------------------- /lib/config/Makefile: -------------------------------------------------------------------------------- 1 | RESULT= config 2 | SOURCES= config_location.ml config_t.ml config_parser.mli \ 3 | config_lexer.ml config_parser.ml config.ml 4 | TRASH= config_parser.output config_parser.ml \ 5 | config_lexer.ml config_parser.mli 6 | DISTS=getopt 7 | include ../../mk/lib.mk 8 | 9 | -------------------------------------------------------------------------------- /regress/config/lists.conf: -------------------------------------------------------------------------------- 1 | # just test list parsing 2 | 3 | config1 = ["foo"]; 4 | 5 | config2 = [ Bar ]; 6 | 7 | config3 = [ ]; 8 | config4.blah = [ "Foo", "Is", "Bar" ]; 9 | config4.blah2 = [ Variant1, Variant2, Variant3 ]; 10 | config5 = [ 1, 2, 3]; 11 | config6 = [ 100 ]; 12 | 13 | -------------------------------------------------------------------------------- /lib/dhcp/OMakefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean 2 | 3 | OCAMLINCLUDES += $(MPL_DIR) 4 | 5 | MPL_FILES[] = dhcp 6 | MPLGenerated($(MPL_FILES)) 7 | 8 | FILES[] = 9 | dhcp 10 | dhcplib 11 | 12 | PROGRAM = dhcp 13 | 14 | .DEFAULT: $(OCamlLibrary $(PROGRAM),$(FILES)) 15 | 16 | clean: 17 | $(CLEAN) $(PROGRAM) 18 | -------------------------------------------------------------------------------- /apps/deens/Makefile.gen_deens_ml: -------------------------------------------------------------------------------- 1 | SOURCES = conf.ml gen_deens_ml.ml 2 | RESULT = gen_deens_ml 3 | 4 | LIBS= unix str getopt config 5 | CONFDIR= ../../lib/config ../../dist/getopt 6 | LIBDIRS= $(CONFDIR) 7 | INCDIRS= $(CONFDIR) 8 | 9 | OCAMLMAKEFILE=../../OCamlMakefile 10 | include $(OCAMLMAKEFILE) 11 | 12 | -------------------------------------------------------------------------------- /lib/pcap/OMakefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean 2 | 3 | OCAMLINCLUDES += $(MPL_DIR) 4 | 5 | MPL_FILES[] = pcap_entry 6 | MPLGenerated($(MPL_FILES)) 7 | 8 | FILES[] = 9 | pcap_entry 10 | pcap 11 | 12 | PROGRAM = pcap 13 | 14 | .DEFAULT: $(OCamlLibrary $(PROGRAM),$(FILES)) 15 | 16 | clean: 17 | $(CLEAN) $(PROGRAM) 18 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Stub, mail anil@recoil.org with questions 2 | 3 | Useful targets: 4 | 5 | $ make world 6 | This will do a clean, dependency and full build 7 | 8 | $ make clean 9 | Cleans all subdirectories 10 | 11 | $ make depend 12 | Recursively builds dependencies 13 | 14 | $ make all 15 | Builds all components 16 | -------------------------------------------------------------------------------- /config.mk.in: -------------------------------------------------------------------------------- 1 | LDFLAGS=@LDFLAGS@ 2 | CFLAGS=@CFLAGS@ 3 | CLIBS=$(subst -l,,@LIBS@) 4 | DEFS=@DEFS@ 5 | CC=@CC@ 6 | PREFIX=@prefix@ 7 | DEBUG_PPFLAGS=-D'DEBUG(X)=(if log\#debug_active then log\#debug (X))' -D'DEBUG_CMD(X)=(if log\#debug_active then (X))' 8 | NORMAL_PPFLAGS=-D'DEBUG(X)' -D'DEBUG_CMD(X)' 9 | PPFLAGS=$(@DEBUG_MODE@_PPFLAGS) 10 | -------------------------------------------------------------------------------- /lib/dns/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES= hashcons.mli hashcons.ml dnsparameters.ml dnsrr.mli \ 2 | dnstrie.mli dnsrr.ml dnstrie.ml dnsquery.ml dnsloader.ml \ 3 | dnsparser.mli dnslexer.mll dnsparser.mly dnsserver.mli \ 4 | dnsserver.ml bonjour.ml 5 | RESULT= dns 6 | MPL_AUTOGEN= dns_rr dns 7 | MELANGE_LIBS= ounix 8 | 9 | include ../../mk/lib.mk 10 | -------------------------------------------------------------------------------- /mk/prog.mk: -------------------------------------------------------------------------------- 1 | BUILD_ROOT=../.. 2 | all:: depend build 3 | 4 | include $(BUILD_ROOT)/mk/base.mk 5 | include $(BUILD_ROOT)/config.mk 6 | 7 | ifeq ($(BMODE),1) 8 | include $(BUILD_ROOT)/OCamlMakefile 9 | endif 10 | 11 | depend:: 12 | 13 | build:: 14 | $(MAKE) BMODE=1 nc 15 | 16 | clean:: 17 | ifneq ($(BMODE),1) 18 | $(MAKE) BMODE=1 clean 19 | endif 20 | -------------------------------------------------------------------------------- /mk/regress.mk: -------------------------------------------------------------------------------- 1 | BUILD_ROOT=../.. 2 | 3 | all:: depend build 4 | 5 | include $(BUILD_ROOT)/mk/base.mk 6 | include $(BUILD_ROOT)/config.mk 7 | 8 | ifeq ($(BMODE),1) 9 | include $(BUILD_ROOT)/OCamlMakefile 10 | endif 11 | 12 | depend:: 13 | 14 | build:: 15 | $(MAKE) BMODE=1 nc 16 | 17 | clean:: 18 | ifneq ($(BMODE),1) 19 | $(MAKE) BMODE=1 clean 20 | endif 21 | 22 | regress:: build 23 | ./$(RESULT) 24 | -------------------------------------------------------------------------------- /dist/cryptokit/Changes: -------------------------------------------------------------------------------- 1 | Release 1.3: 2 | - Added hash functions SHA-256 and RIPEMD-160. 3 | - Added "flush" method to transforms. 4 | - Fixed infinite loop in decompression of incorrect data. 5 | 6 | Release 1.2: 7 | - MS Windows port 8 | 9 | Release 1.1: 10 | - Added Diffie-Hellman key agreement 11 | - Exported raw modular arithmetic operations (mod_power, mod_mult) 12 | 13 | Release 1.0: 14 | - First public release 15 | -------------------------------------------------------------------------------- /lib/ssh/ssh_env_t.ml: -------------------------------------------------------------------------------- 1 | type t = { 2 | fd: Ounix.tcp_odescr; 3 | log: Olog.base_log; 4 | rng: Cryptokit.Random.rng; 5 | osel: Ounix.oselect; 6 | kex_methods: Ssh_kex.Methods.t list; 7 | mac_methods: Ssh_algorithms.MAC.t list; 8 | cipher_methods: Ssh_algorithms.Cipher.t list; 9 | hostkey_algorithms: Ssh_keys.PublicKey.t list; 10 | debugger: bool; (* Is the SPL debugger active? *) 11 | } 12 | 13 | -------------------------------------------------------------------------------- /tools/mpl/Makefile.mplc: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | OCAMLMAKEFILE = ../../OCamlMakefile 4 | 5 | SOURCES = printer_utils.ml mpl_utils.ml mpl_types.ml mpl_location.ml mpl_bits.ml \ 6 | mpl_syntaxtree.ml mpl_typechk.ml mpl_parser.mli \ 7 | mpl_lexer.ml mpl_parser.ml mpl_cfg.ml mpl_ocaml.ml mplc.ml 8 | RESULT = mplc 9 | TRASH = mpl_parser.output mpl_parser.ml mpl_lexer.ml mpl_parser.mli 10 | LIBS = unix 11 | 12 | all: dc nc 13 | 14 | include $(OCAMLMAKEFILE) 15 | -------------------------------------------------------------------------------- /apps/deens/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES = conf.ml conf_autogen.ml deens.ml 2 | RESULT = deens 3 | 4 | USE_MPL= Yes 5 | LIBS= unix str mpl_stdlib getopt config 6 | MELANGE_LIBS= dns ounix config 7 | DISTS= getopt 8 | 9 | include ../../mk/prog.mk 10 | 11 | depend:: conf_autogen.ml 12 | @ : 13 | 14 | conf_autogen.ml: 15 | $(MAKE) -f Makefile.gen_deens_ml 16 | ./gen_deens_ml > $@ 17 | 18 | clean:: 19 | $(MAKE) -f Makefile.gen_deens_ml clean 20 | rm -f conf_autogen.ml 21 | 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS=dist tools lib apps 2 | 3 | world: 4 | @if [ ! -f config.mk ]; then echo Run ./configure first; exit 1; fi 5 | $(MAKE) clean 6 | $(MAKE) depend 7 | $(MAKE) all 8 | 9 | clean: 10 | rm -f config.log config.status 11 | for i in $(SUBDIRS); do (cd $$i && $(MAKE) $@); done 12 | 13 | distclean: clean 14 | rm -f config.h config.mk 15 | 16 | %: 17 | for i in $(SUBDIRS); do (cd $$i && $(MAKE) $@); done 18 | 19 | install: 20 | @echo Not done yet, sorry! 21 | 22 | -------------------------------------------------------------------------------- /apps/sshd/sshd.conf: -------------------------------------------------------------------------------- 1 | # sshd configuration file 2 | 3 | id.server_name = "MLSSH Anil"; 4 | 5 | crypto.kex = [ DHGexSHA1, DHGroup14SHA1, DHGroup1SHA1 ]; 6 | crypto.macs = [ SHA1, SHA1_96, MD5, MD5_96 ]; 7 | crypto.ciphers = [ AES256_CBC, AES192_CBC, AES_128_CBC, Arcfour, TripleDES_CBC ]; 8 | crypto.host_key_algs = [ RSAKey ]; 9 | 10 | debugger.enabled = false; 11 | 12 | log.mode = Stderr; 13 | log.verbosity = Debug; 14 | 15 | network.port = 2222; 16 | network.interface = "0.0.0.0"; 17 | 18 | -------------------------------------------------------------------------------- /lib/config/OMakefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean 2 | 3 | CONFIG_DIR = $(ROOT)/lib/config 4 | 5 | GEN_FILES[] = 6 | config_parser.ml 7 | config_parser.mli 8 | config_lexer.ml 9 | 10 | OCamlGeneratedFiles($(GEN_FILES)) 11 | 12 | FILES[] = 13 | config_location 14 | config_t 15 | config_lexer 16 | config_parser 17 | config 18 | 19 | OCAMLINCLUDES += $(ROOT)/dist/getopt 20 | 21 | PROGRAM = config 22 | 23 | .DEFAULT: $(OCamlLibrary $(PROGRAM), $(FILES)) 24 | 25 | clean: 26 | $(CLEAN) $(GEN_FILES) 27 | -------------------------------------------------------------------------------- /lib/ethernet/ethernet.mpl: -------------------------------------------------------------------------------- 1 | packet ethernet { 2 | dest_mac: byte[6]; 3 | src_mac: byte[6]; 4 | length: uint16 value(offset(end_of_packet)-offset(length)); 5 | classify (length) { 6 | |46..1500:"E802_2" -> 7 | data: byte[length]; 8 | |0x800:"IPv4" -> 9 | data: byte[remaining()]; 10 | |0x806:"Arp" -> 11 | data: byte[remaining()]; 12 | |0x86dd:"IPv6" -> 13 | data: byte[remaining()]; 14 | }; 15 | end_of_packet: label; 16 | } 17 | -------------------------------------------------------------------------------- /lib/ssh/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES= ssh_classify.ml \ 2 | ssh_utils.ml \ 3 | ssh_tty.mli ssh_tty.ml ssh_algorithms.ml ssh_version.ml ssh_pool.ml \ 4 | ssh_keys.ml ssh_kex.ml ssh_channel.mli ssh_channel.ml \ 5 | ssh_env_t.ml ssh_transport.ml ssh_userauth.ml ssh_config.ml \ 6 | ssh_env.ml ssh_server.ml 7 | RESULT= ssh 8 | SPL_AUTOGEN0= ssh_server_automaton ssh_server_channel 9 | SPL_STATECALL0= ssh_statecalls 10 | MPL_FLAGS= -s 11 | MPL_AUTOGEN= ssh_message 12 | MELANGE_LIBS= ounix 13 | DISTS= cryptokit 14 | 15 | include ../../mk/lib.mk 16 | -------------------------------------------------------------------------------- /regress/config/OMakefile: -------------------------------------------------------------------------------- 1 | .PHONY: run-regress clean 2 | 3 | OCAMLINCLUDES[] += 4 | $(MPL_DIR) 5 | $(DIST_DIR)/getopt 6 | $(LIB_DIR)/config 7 | 8 | OCAML_LIBS[] += 9 | $(DIST_DIR)/getopt/getopt 10 | $(LIB_DIR)/config/config 11 | 12 | OCAML_OTHER_LIBS[] += 13 | unix 14 | str 15 | 16 | PROGRAM = $(OCamlProgram regress, regress) 17 | 18 | run-regress: $(PROGRAM) 19 | ./regress 20 | env REGRESS_CMDLINE=1 ./regress -s THIS_SHOULD_BE_THE_VALUE 21 | 22 | clean: 23 | $(CLEAN) regress regress.opt regress.run 24 | -------------------------------------------------------------------------------- /apps/mldig/OMakefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean 2 | 3 | OCAMLINCLUDES[] += 4 | $(MPL_DIR) 5 | $(LIB_DIR)/dns 6 | $(LIB_DIR)/udp 7 | $(LIB_DIR)/ounix 8 | 9 | OCAML_LIBS[] += 10 | $(MPL_DIR)/mpl_stdlib 11 | $(LIB_DIR)/dns/dns 12 | $(LIB_DIR)/udp/udp 13 | $(LIB_DIR)/ounix/ounix 14 | 15 | OCAML_CLIBS[] += 16 | $(LIB_DIR)/ounix/ounix_stubs 17 | 18 | OCAML_OTHER_LIBS[] += 19 | unix 20 | str 21 | 22 | OCAML_LIB_FLAGS += -cclib -lounix_stubs 23 | 24 | .DEFAULT: $(OCamlProgram mldig, utils resolvconf dig) 25 | 26 | clean: 27 | $(CLEAN) mldig mldig.opt mldig.run 28 | -------------------------------------------------------------------------------- /tools/spl/Makefile.splc: -------------------------------------------------------------------------------- 1 | 2 | # $Id$ 3 | 4 | OCAMLMAKEFILE = ../../OCamlMakefile 5 | 6 | SOURCES = spl_utils.mli spl_utils.ml spl_location.ml spl_syntaxtree.ml \ 7 | spl_parser.mli spl_lexer.ml spl_parser.ml spl_typechecker.mli \ 8 | spl_typechecker.ml spl_cfg.mli spl_cfg.ml spl_optimiser.mli \ 9 | spl_optimiser.ml spl_dot.ml spl_promela.ml spl_ocaml.ml \ 10 | spl_debug.ml spl_gui.ml splc.ml 11 | RESULT = splc 12 | TRASH = spl_parser.output spl_parser.ml spl_lexer.ml 13 | LIBS= str 14 | 15 | depend: 16 | 17 | native: nc 18 | bytecode: bc 19 | 20 | all: native bytecode 21 | 22 | include $(OCAMLMAKEFILE) 23 | -------------------------------------------------------------------------------- /lib/dns/OMakefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean 2 | 3 | OCAMLINCLUDES += $(MPL_DIR) 4 | 5 | GEN_FILES[] = 6 | dnsparser.ml 7 | dnsparser.mli 8 | dnslexer.ml 9 | 10 | OCamlGeneratedFiles($(GEN_FILES)) 11 | 12 | MPL_FILES[] = 13 | dns 14 | dns_rr 15 | MPLGenerated($(MPL_FILES)) 16 | 17 | FILES[] = 18 | dns_rr 19 | dns 20 | hashcons 21 | dnsparameters 22 | dnsrr 23 | dnstrie 24 | dnsloader 25 | dnsquery 26 | dnsparser 27 | dnslexer 28 | dnsserver 29 | 30 | PROGRAM = dns 31 | 32 | .DEFAULT: $(OCamlLibrary $(PROGRAM),$(FILES)) 33 | 34 | clean: 35 | $(CLEAN) $(PROGRAM) $(GEN_FILES) 36 | -------------------------------------------------------------------------------- /tools/spl/OMakefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean 2 | 3 | GEN_FILES[] = 4 | spl_parser.ml 5 | spl_parser.mli 6 | spl_lexer.ml 7 | 8 | OCamlGeneratedFiles($(GEN_FILES)) 9 | 10 | FILES[] = 11 | spl_utils 12 | spl_location 13 | spl_syntaxtree 14 | spl_lexer 15 | spl_parser 16 | spl_typechecker 17 | spl_cfg 18 | spl_optimiser 19 | spl_dot 20 | spl_promela 21 | spl_ocaml 22 | spl_debug 23 | spl_gui 24 | splc 25 | 26 | SPL_COMPILER = $(OCamlProgram splc, $(FILES)) 27 | SPL_STDLIB = $(OCamlLibrary spl_stdlib, spl_stdlib) 28 | export SPL_COMPILER SPL_STDLIB 29 | 30 | .DEFAULT: $(SPL_COMPILER) $(SPL_STDLIB) 31 | 32 | clean: 33 | $(CLEAN) $(SPL_COMPILER) $(SPL_STDLIB) $(GEN_FILES) 34 | -------------------------------------------------------------------------------- /tools/spl/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: sans-serif; 3 | font-size: small; 4 | } 5 | 6 | .statecall { 7 | color: #000031; 8 | font-weight: normal; 9 | } 10 | 11 | .identifier { 12 | color: #410040; 13 | } 14 | 15 | .location { 16 | font-family: monospace; 17 | font-size: smaller; 18 | } 19 | 20 | h1 { 21 | font-size: 14px; 22 | } 23 | 24 | .autoheader { 25 | color: #222244; 26 | background-color: #DDDDDD; 27 | } 28 | 29 | .autobody { 30 | border-style: dashed; 31 | border-width: 1px; 32 | } 33 | 34 | table { 35 | position: relative; 36 | } 37 | 38 | tr { 39 | position: relative; 40 | } 41 | 42 | td { 43 | position: relative; 44 | } 45 | 46 | .starthidden { 47 | display: none; 48 | } 49 | -------------------------------------------------------------------------------- /apps/sshd/OMakefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean 2 | 3 | OCAMLINCLUDES[] += 4 | $(MPL_DIR) 5 | $(DIST_DIR)/getopt 6 | $(LIB_DIR)/config 7 | $(LIB_DIR)/ssh 8 | $(LIB_DIR)/ounix 9 | $(DIST_DIR)/cryptokit 10 | 11 | OCAML_LIBS[] += 12 | $(DIST_DIR)/cryptokit/cryptokit 13 | $(DIST_DIR)/getopt/getopt 14 | $(MPL_DIR)/mpl_stdlib 15 | $(SPL_DIR)/spl_stdlib 16 | $(LIB_DIR)/config/config 17 | $(LIB_DIR)/ounix/ounix 18 | $(LIB_DIR)/ssh/ssh 19 | 20 | OCAML_CLIBS[] += 21 | $(LIB_DIR)/ounix/ounix_stubs 22 | 23 | OCAML_OTHER_LIBS[] += 24 | unix 25 | nums 26 | str 27 | 28 | CONF_PROGRAM = $(OCamlProgram sshd, server ssh_openssh_formats sshd) 29 | 30 | .DEFAULT: $(CONF_PROGRAM) 31 | 32 | clean: 33 | $(CLEAN) sshd.run sshd.opt sshd 34 | -------------------------------------------------------------------------------- /tools/mpl/OMakefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean 2 | 3 | GEN_FILES[] = 4 | mpl_parser.ml 5 | mpl_parser.mli 6 | mpl_lexer.ml 7 | 8 | OCamlGeneratedFiles($(GEN_FILES)) 9 | 10 | FILES[] = 11 | printer_utils 12 | mpl_utils 13 | mpl_types 14 | mpl_location 15 | mpl_bits 16 | mpl_syntaxtree 17 | mpl_typechk 18 | mpl_parser 19 | mpl_lexer 20 | mpl_cfg 21 | mpl_ocaml 22 | mplc 23 | 24 | PROGRAM = mplc 25 | 26 | STDLIB = mpl_stdlib 27 | STDLIB_FILES[] = mpl_stdlib 28 | 29 | MPL_COMPILER = $(OCamlProgram $(PROGRAM), $(FILES)) 30 | MPL_STDLIB = $(OCamlLibrary $(STDLIB), $(STDLIB_FILES)) 31 | export MPL_COMPILER MPL_STDLIB 32 | 33 | .DEFAULT: $(MPL_COMPILER) $(MPL_STDLIB) 34 | 35 | clean: 36 | $(CLEAN) $(MPL_COMPILER) $(MPL_STDLIB) $(GEN_FILES) 37 | -------------------------------------------------------------------------------- /dist/cryptokit/.depend: -------------------------------------------------------------------------------- 1 | arcfour.o: arcfour.c arcfour.h 2 | d3des.o: d3des.c d3des.h 3 | rijndael-alg-fst.o: rijndael-alg-fst.c rijndael-alg-fst.h 4 | ripemd160.o: ripemd160.c ripemd160.h 5 | sha1.o: sha1.c sha1.h 6 | sha256.o: sha256.c sha256.h 7 | stubs-aes.o: stubs-aes.c rijndael-alg-fst.h 8 | stubs-arcfour.o: stubs-arcfour.c arcfour.h 9 | stubs-des.o: stubs-des.c d3des.h 10 | stubs-md5.o: stubs-md5.c 11 | stubs-misc.o: stubs-misc.c 12 | stubs-ripemd160.o: stubs-ripemd160.c ripemd160.h 13 | stubs-rng.o: stubs-rng.c 14 | stubs-sha1.o: stubs-sha1.c sha1.h 15 | stubs-sha256.o: stubs-sha256.c sha256.h 16 | stubs-zlib.o: stubs-zlib.c 17 | cryptokit.cmo: cryptokit.cmi 18 | cryptokit.cmx: cryptokit.cmi 19 | speedtest.cmo: cryptokit.cmi 20 | speedtest.cmx: cryptokit.cmx 21 | test.cmo: cryptokit.cmi 22 | test.cmx: cryptokit.cmx 23 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | AC_PREREQ(2.59) 2 | AC_INIT(melange, 0.1, melange-devel@recoil.org) 3 | AC_CONFIG_SRCDIR([OCamlMakefile]) 4 | AC_CONFIG_HEADER([config.h]) 5 | 6 | AC_CONFIG_FILES([config.mk]) 7 | 8 | # Checks for programs. 9 | AC_PROG_CC 10 | AC_PROG_INSTALL 11 | 12 | # Checks for header files. 13 | AC_HEADER_STDC 14 | AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h paths.h stdlib.h string.h sys/ioctl.h sys/socket.h termios.h unistd.h util.h pty.h]) 15 | 16 | AC_SEARCH_LIBS(openpty, util, [], [], []) 17 | 18 | # Checks for typedefs, structures, and compiler characteristics. 19 | AC_C_CONST 20 | 21 | # Checks for library functions. 22 | AC_PROG_GCC_TRADITIONAL 23 | AC_CHECK_FUNCS([inet_ntoa memset strerror]) 24 | 25 | AC_ARG_ENABLE(debug, [ --enable-debug output verbose debug messages], [DEBUG_MODE="DEBUG"], [DEBUG_MODE="NORMAL"]) 26 | 27 | AC_SUBST(DEBUG_MODE) 28 | AC_OUTPUT 29 | -------------------------------------------------------------------------------- /lib/dns/dnsquery.mli: -------------------------------------------------------------------------------- 1 | (* 2 | dnsquery.mli -- map DNS query-response mechanism onto trie database 3 | Copyright (c) 2005-2006 Tim Deegan 4 | *) 5 | 6 | 7 | type query_answer = { 8 | rcode : Dns.Dns.rcode_t; 9 | aa : bool; 10 | answer : (Mpl_stdlib.env -> Dns.Dns.Answers.o) list; 11 | authority : (Mpl_stdlib.env -> Dns.Dns.Authority.o) list; 12 | additional : (Mpl_stdlib.env -> Dns.Dns.Additional.o) list; 13 | } 14 | 15 | val answer_query : string list -> 16 | [> `A 17 | | `AAAA 18 | | `AFSDB 19 | | `ANY 20 | | `CNAME 21 | | `HINFO 22 | | `ISDN 23 | | `MAILB 24 | | `MB 25 | | `MG 26 | | `MINFO 27 | | `MR 28 | | `MX 29 | | `NS 30 | | `PTR 31 | | `RP 32 | | `RT 33 | | `SOA 34 | | `SRV 35 | | `TXT 36 | | `UNSPEC 37 | | `Unknown of int 38 | | `WKS 39 | | `X25 ] -> 40 | Dnstrie.dnstrie -> query_answer 41 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/index_module_types.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Index of module types 13 | 14 | 15 |

Index of module types

16 | 17 |

18 | 19 | -------------------------------------------------------------------------------- /apps/deens/OMakefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean 2 | 3 | OCAMLINCLUDES[] += 4 | $(MPL_DIR) 5 | $(DIST_DIR)/getopt 6 | $(LIB_DIR)/config 7 | $(LIB_DIR)/dns 8 | $(LIB_DIR)/ounix 9 | 10 | OCAML_LIBS[] += 11 | $(DIST_DIR)/getopt/getopt 12 | $(MPL_DIR)/mpl_stdlib 13 | $(LIB_DIR)/config/config 14 | $(LIB_DIR)/dns/dns 15 | $(LIB_DIR)/ounix/ounix 16 | 17 | OCAML_CLIBS[] += 18 | $(LIB_DIR)/ounix/ounix_stubs 19 | 20 | OCAML_OTHER_LIBS[] += 21 | unix 22 | str 23 | 24 | CONF_PROGRAM = $(OCamlProgram gen_deens_ml, conf gen_deens_ml) 25 | 26 | GEN_FILES[] = conf_autogen.ml 27 | OCamlGeneratedFiles($(GEN_FILES)) 28 | conf_autogen.ml: $(CONF_PROGRAM) 29 | $< > $@ 30 | 31 | OCAML_LIB_FLAGS += -cclib -lounix_stubs 32 | 33 | .DEFAULT: $(OCamlProgram deens, conf conf_autogen deens) 34 | 35 | clean: 36 | $(CLEAN) $(GEN_FILES) gen_deens_ml gen_deens_ml.opt deens deens.opt deens.run gen_deens_ml.run 37 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/index_attributes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Index of class attributes 13 | 14 | 15 |

Index of class attributes

16 | 17 |

18 | 19 | -------------------------------------------------------------------------------- /dist/cryptokit/d3des.h: -------------------------------------------------------------------------------- 1 | /* d3des.h - 2 | * 3 | * Headers and defines for d3des.c 4 | * Graven Imagery, 1992. 5 | * 6 | * Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge 7 | * (GEnie : OUTER; CIS : [71755,204]) 8 | * 9 | * Modified and adapted by Xavier Leroy, 2002. 10 | */ 11 | 12 | #define EN0 0 /* MODE == encrypt */ 13 | #define DE1 1 /* MODE == decrypt */ 14 | 15 | typedef unsigned char u8; 16 | typedef unsigned int u32; 17 | 18 | extern void d3des_cook_key(u8 key[8], int mode, u32 res[32]); 19 | /* Sets the key register [res] according to the hexadecimal 20 | * key contained in the 8 bytes of [key], according to the DES, 21 | * for encryption or decryption according to [mode]. 22 | */ 23 | 24 | extern void d3des_transform(u32 key[32], u8 from[8], u8 to[8]); 25 | /* Encrypts/Decrypts (according to the key [key]) 26 | * one block of eight bytes at address 'from' 27 | * into the block at address 'to'. They can be the same. 28 | */ 29 | -------------------------------------------------------------------------------- /dist/getopt/Makefile: -------------------------------------------------------------------------------- 1 | all: doc getopt.cmi getopt.cma 2 | allopt: doc getopt.cmi getopt.cma getopt.cmxa 3 | 4 | getopt.cmo: getopt.cmi getopt.ml 5 | ocamlc -c getopt.ml 6 | 7 | getopt.cmi: getopt.mli 8 | ocamlc -c getopt.mli 9 | 10 | getopt.cma: getopt.cmo 11 | ocamlc -o getopt.cma -a getopt.cmo 12 | 13 | getopt.cmxa: getopt.cmx 14 | ocamlopt -o getopt.cmxa -a getopt.cmx 15 | 16 | getopt.cmx: getopt.cmi getopt.ml 17 | ocamlopt -c getopt.ml 18 | 19 | sample.cmo: getopt.cmi sample.ml 20 | ocamlc -c sample.ml 21 | 22 | sample: getopt.cma sample.cmo 23 | ocamlc -o sample unix.cma getopt.cma sample.cmo 24 | 25 | install: 26 | ocamlfind install getopt META getopt.cmi getopt.cma $(wildcard getopt.cmxa) $(wildcard getopt.o) $(wildcard getopt.a) 27 | 28 | uninstall: 29 | ocamlfind remove getopt 30 | 31 | .PHONY: doc 32 | doc: 33 | mkdir -p doc 34 | ocamldoc -d doc -html getopt.mli 35 | 36 | clean: 37 | rm -f *.cm[ioxa] *.cmxa *.a *.o sample *~ 38 | rm -Rf doc 39 | -------------------------------------------------------------------------------- /mk/lib.mk: -------------------------------------------------------------------------------- 1 | BUILD_ROOT=../.. 2 | 3 | all:: depend build 4 | 5 | include $(BUILD_ROOT)/mk/base.mk 6 | 7 | # implicit rule to convert mpl -> ml 8 | %.ml : %.mpl 9 | $(MPLC) $(MPL_FLAGS) $< > $@ 10 | 11 | mpl_to_ml = $(call f_ml,$(MPL_AUTOGEN)) 12 | spl_to_spl0 = $(call f_spl,$(SPL_AUTOGEN0)) 13 | spl_to_ml0 = $(call f_mli,$(SPL_AUTOGEN0)) $(call f_ml,$(SPL_AUTOGEN0)) 14 | spl_sc0 = $(call f_ml,$(SPL_STATECALL0)) 15 | 16 | $(spl_to_ml0) $(spl_sc0): $(spl_to_spl0) 17 | $(SPLC) -t ocaml -s $(SPL_STATECALL0) -hdir $(SPL_DIR) -d false $(spl_to_spl0) 18 | 19 | TRASH ?= 20 | TRASH += $(spl_to_ml0) $(spl_sc0) $(mpl_to_ml) 21 | SOURCES := $(mpl_to_ml) $(spl_sc0) $(spl_to_ml0) $(SOURCES) 22 | 23 | include $(BUILD_ROOT)/config.mk 24 | 25 | ifeq ($(BMODE),1) 26 | include $(BUILD_ROOT)/OCamlMakefile 27 | endif 28 | 29 | depend:: $(mpl_to_ml) $(spl_to_ml0) 30 | 31 | build:: 32 | $(MAKE) BMODE=1 ncl bcl 33 | 34 | clean:: 35 | ifneq ($(BMODE),1) 36 | $(MAKE) BMODE=1 clean 37 | endif 38 | -------------------------------------------------------------------------------- /lib/icmp/icmp.mpl: -------------------------------------------------------------------------------- 1 | packet icmp { 2 | ptype: byte; 3 | code: byte default(0); 4 | checksum: uint16 default(0); 5 | classify (ptype) { 6 | |0:"EchoReply" -> 7 | identifier: uint16; 8 | sequence: uint16; 9 | data: byte[remaining()]; 10 | |3:"DestinationUnreachable" -> 11 | reserved: uint32 const(0); 12 | ip_header: byte[remaining()]; 13 | |4:"SourceQuench" -> 14 | reserved: uint32 const(0); 15 | ip_header: byte[remaining()]; 16 | |5:"Redirect" -> 17 | gateway_ip: uint32; 18 | ip_header: byte[remaining()]; 19 | |8:"EchoRequest" -> 20 | identifier: uint16; 21 | sequence: uint16; 22 | data: byte[remaining()]; 23 | |9:"RouterAdvertisement" -> (); 24 | |10:"RouterSolicitation" -> (); 25 | |11:"TimeExceeded" -> 26 | reserved: uint32 const(0); 27 | ip_header: byte[remaining()]; 28 | |13:"TimestampRequest" -> 29 | identifier: uint16; 30 | sequence: uint16; 31 | origin_timestamp: uint32; 32 | receive_timestamp: uint32; 33 | transmit_timestamp: uint32; 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Block.aes_decrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Block.aes_decrypt 12 | 13 | 14 | string -> Cryptokit.Block.block_cipher -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Block.aes_encrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Block.aes_encrypt 12 | 13 | 14 | string -> Cryptokit.Block.block_cipher -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Block.des_decrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Block.des_decrypt 12 | 13 | 14 | string -> Cryptokit.Block.block_cipher -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Block.des_encrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Block.des_encrypt 12 | 13 | 14 | string -> Cryptokit.Block.block_cipher -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Stream.arcfour.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Stream.arcfour 12 | 13 | 14 | string -> Cryptokit.Stream.stream_cipher -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Block.triple_des_decrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Block.triple_des_decrypt 12 | 13 | 14 | string -> Cryptokit.Block.block_cipher -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Block.triple_des_encrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Block.triple_des_encrypt 12 | 13 | 14 | string -> Cryptokit.Block.block_cipher -------------------------------------------------------------------------------- /dist/cryptokit/OMakefile: -------------------------------------------------------------------------------- 1 | ZLIB_LIBDIR=/usr/lib 2 | ZLIB_LIB=-lz 3 | CAMLLIB=$(shell ocamlc -where) 4 | CFLAGS += -O -DHAVE_ZLIB 5 | OCAML_CLIBS += z 6 | INCLUDES += $(CAMLLIB) . 7 | OCAMLFLAGS += -w y 8 | MKLIB=ocamlmklib 9 | 10 | CRYPTOKIT_C = rijndael-alg-fst stubs-aes d3des stubs-des arcfour stubs-arcfour sha1 stubs-sha1 sha256 stubs-sha256 ripemd160 stubs-ripemd160 stubs-md5 stubs-zlib stubs-misc stubs-rng 11 | 12 | C_OBJS = $(addsuffix .o, $(CRYPTOKIT_C)) 13 | 14 | cryptokit.cma: cryptokit.cmo $(C_OBJS) 15 | $(MKLIB) -o cryptokit $(C_OBJS) -L$(ZLIB_LIBDIR) $(ZLIB_LIB) 16 | $(MKLIB) -o cryptokit $< -L$(ZLIB_LIBDIR) $(ZLIB_LIB) 17 | 18 | cryptokit.a cryptokit.cmxa: cryptokit.cmx $(C_OBJS) 19 | $(MKLIB) -o cryptokit $(C_OBJS) -L$(ZLIB_LIBDIR) $(ZLIB_LIB) 20 | $(MKLIB) -o cryptokit $< -L$(ZLIB_LIBDIR) $(ZLIB_LIB) 21 | 22 | speedtest: libcryptokit.a cryptokit.cmxa speedtest.ml 23 | $(OCAMLOPT) -o speedtest -ccopt -L. unix.cmxa nums.cmxa cryptokit.cmxa speedtest.ml 24 | 25 | clean: 26 | $(CLEAN) dllcryptokit.so 27 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Block.cipher.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Block.cipher 12 | 13 | 14 | Cryptokit.Block.block_cipher -> Cryptokit.transform -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Stream.cipher.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Stream.cipher 12 | 13 | 14 | Cryptokit.Stream.stream_cipher -> Cryptokit.transform -------------------------------------------------------------------------------- /tools/spl/spl_optimiser.mli: -------------------------------------------------------------------------------- 1 | (* 2 | * Copyright (c) 2005 Anil Madhavapeddy 3 | * 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | * 16 | * $Id: spl_optimiser.mli,v 1.2 2006/02/12 18:59:11 avsm Exp $ 17 | *) 18 | 19 | val optimise : Spl_cfg.global_env -> int 20 | val fold : Spl_syntaxtree.expr -> Spl_syntaxtree.expr 21 | -------------------------------------------------------------------------------- /lib/ssh/ssh_tty.mli: -------------------------------------------------------------------------------- 1 | (* 2 | * Copyright (c) 2004 Anil Madhavapeddy 3 | * 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | * 16 | * $Id: ssh_tty.mli,v 1.1 2005/08/09 15:21:46 avsm Exp $ 17 | *) 18 | 19 | module Tty : 20 | sig 21 | exception Malformed_terminal_string 22 | val parse_modes : Unix.terminal_io -> string -> unit 23 | end 24 | -------------------------------------------------------------------------------- /dist/getopt/sample.ml: -------------------------------------------------------------------------------- 1 | (* Demonstration of the Getopt module *) 2 | 3 | open Getopt 4 | 5 | let archive = ref false 6 | and update = ref false 7 | and verbose = ref 0 8 | and includ = ref [] 9 | and output = ref "" 10 | 11 | let bip () = Printf.printf "\007"; flush stdout 12 | let wait () = Unix.sleep 1 13 | 14 | let specs = 15 | [ 16 | ( 'x', "execute", None, Some (fun x -> Printf.printf "execute %s\n" x)); 17 | ( 'I', "include", None, (append includ)); 18 | ( 'o', "output", None, (atmost_once output (Error "only one output"))); 19 | ( 'a', "archive", (set archive true), None); 20 | ( 'u', "update", (set update true), None); 21 | ( 'v', "verbose", (incr verbose), None); 22 | ( 'X', "", Some bip, None); 23 | ( 'w', "wait", Some wait, None) 24 | 25 | ] 26 | 27 | let _ = 28 | parse_cmdline specs print_endline; 29 | 30 | Printf.printf "archive = %b\n" !archive; 31 | Printf.printf "update = %b\n" !update; 32 | Printf.printf "verbose = %i\n" !verbose; 33 | Printf.printf "output = %s\n" !output; 34 | List.iter (fun x -> Printf.printf "include %s\n" x) !includ;; 35 | -------------------------------------------------------------------------------- /lib/ipv4/ipv4.mpl: -------------------------------------------------------------------------------- 1 | packet ipv4 { 2 | version: bit[4] const(4); 3 | ihl: bit[4] min(5) value(offset(options) / 4); 4 | tos_precedence: bit[3] variant { 5 | |0 => Routine |1 -> Priority 6 | |2 -> Immediate |3 -> Flash 7 | |4 -> Flash_override |5 -> ECP 8 | |6 -> Internetwork_control |7 -> Network_control 9 | }; 10 | tos_delay: bit[1] variant {|0 => Normal |1 -> Low}; 11 | tos_throughput: bit[1] variant {|0 => Normal |1 -> Low}; 12 | tos_reliability: bit[1] variant {|0 => Normal |1 -> Low}; 13 | tos_reserved: bit[2] const(0); 14 | length: uint16 value(offset(data)); 15 | id: uint16; 16 | reserved: bit[1] const(0); 17 | dont_fragment: bit[1] default(0); 18 | can_fragment: bit[1] default(0); 19 | frag_offset: bit[13] default(0); 20 | ttl: byte; 21 | protocol: byte variant {|1->ICMP |2->IGMP |6->TCP |17->UDP}; 22 | checksum: uint16 default(0); 23 | src: uint32; 24 | dest: uint32; 25 | options: byte[(ihl * 4) - offset(dest)] align(32); 26 | header_end: label; 27 | data: byte[length-(ihl*4)]; 28 | } 29 | -------------------------------------------------------------------------------- /tools/spl/spl_utils.mli: -------------------------------------------------------------------------------- 1 | val hashtbl_add_list : ('a, 'b list) Hashtbl.t -> 'a -> 'b -> unit 2 | val list_unique : 'a list -> 'a list 3 | val safe_chop : string -> string 4 | val list_filter_map : ('a -> 'b option) -> 'a list -> 'b list 5 | val may : 'a -> ('b -> 'a) -> 'b option -> 'a 6 | val string_of_file : string -> string 7 | 8 | module Logger : sig 9 | type level = Quiet | Normal | Verbose 10 | val set_log_level : level -> unit 11 | val log_quiet : string -> unit 12 | val log : string -> unit 13 | val log_verbose : string -> unit 14 | end 15 | 16 | module Printer : sig 17 | type env = { 18 | fn : int -> string -> unit; 19 | p : string -> unit; 20 | i : int; 21 | nl : unit -> unit; 22 | } 23 | val indent : env -> env 24 | val indent_fn : env -> (env -> 'a) -> 'a 25 | val list_iter_indent : env -> (env -> 'a -> unit) -> 'a list -> unit 26 | val hashtbl_iter_indent : 27 | env -> (env -> 'a -> 'b -> unit) -> ('a, 'b) Hashtbl.t -> unit 28 | val init_printer : ?header:bool -> ?comment:string * string -> out_channel -> env 29 | end 30 | -------------------------------------------------------------------------------- /tools/spl/spl_typechecker.mli: -------------------------------------------------------------------------------- 1 | (* 2 | * Copyright (c) 2005 Anil Madhavapeddy 3 | * 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | * 16 | * $Id: spl_typechecker.mli,v 1.1 2005/04/15 17:13:28 avsm Exp $ 17 | *) 18 | 19 | exception Type_error of (string * Spl_location.t) 20 | exception Type_internal_error of string 21 | 22 | val type_check : Spl_syntaxtree.func list -> unit 23 | -------------------------------------------------------------------------------- /apps/deens/conf.ml: -------------------------------------------------------------------------------- 1 | open Config_t 2 | 3 | let network_port = "network.port" 4 | let network_ip = "network.ip" 5 | let zones_file = "zones.file" 6 | let cache_mode = "cache.mode" 7 | 8 | let vt = [ 9 | { t_name = network_port; t_atom=T_int (0,65535); 10 | t_descr=Some "IPv4 port to listen on"; 11 | t_default=Some (V_int 53); t_short=Some 'p'; t_long=Some "port" }; 12 | 13 | { t_name = network_ip; t_atom=T_ip; t_descr=Some "IP addresses to listen on"; 14 | t_default=Some (V_ip Unix.inet_addr_any); 15 | t_short=Some 'i'; t_long=Some "interface" }; 16 | 17 | { t_name = zones_file; t_atom=T_string; t_descr=Some "Filename for zones"; 18 | t_default=Some (V_string "default.zones"); 19 | t_short=Some 'z'; t_long=Some "zone-list" }; 20 | 21 | { t_name = cache_mode; t_atom=T_variant ["None"; "Weak"; "Leaky"]; 22 | t_descr=None; t_default=Some (V_variant "None"); 23 | t_short=Some 'm'; t_long=Some "mode" } 24 | ] 25 | 26 | let init () = 27 | let c = new Config.config vt "./deens.conf" in 28 | c 29 | 30 | let default () = 31 | prerr_endline (Config.default_config vt) 32 | -------------------------------------------------------------------------------- /dist/getopt/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004 by Alain Frisch 2 | 3 | The package "getopt" is copyright by Alain Frisch. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of the "getopt" software (the "Software"), to deal in the 7 | Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or 9 | sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included 13 | in all copies or substantial portions of the Software. 14 | 15 | The Software is provided ``as is'', without warranty of any kind, express 16 | or implied, including but not limited to the warranties of 17 | merchantability, fitness for a particular purpose and noninfringement. 18 | In no event shall Alain Frisch be liable for any claim, damages or 19 | other liability, whether in an action of contract, tort or otherwise, 20 | arising from, out of or in connection with the Software or the use or 21 | other dealings in the software. 22 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Block.cbc_decrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Block.cbc_decrypt 12 | 13 | 14 | ?iv:string -> Cryptokit.Block.block_cipher -> Cryptokit.Block.block_cipher -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Block.cbc_encrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Block.cbc_encrypt 12 | 13 | 14 | ?iv:string -> Cryptokit.Block.block_cipher -> Cryptokit.Block.block_cipher -------------------------------------------------------------------------------- /tools/mpl/mpl_types.ml: -------------------------------------------------------------------------------- 1 | (* 2 | * Copyright (c) 2005 Anil Madhavapeddy 3 | * 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | * 16 | * $Id: mpl_types.ml,v 1.1 2005/11/29 20:51:50 avsm Exp $ 17 | *) 18 | 19 | exception Unknown_custom_type 20 | 21 | type custom = { 22 | c_module: string; 23 | } 24 | 25 | let custom_of_string = function 26 | |"dns_label" -> { 27 | c_module="Mpl_dns_label" 28 | } 29 | |_ -> raise Unknown_custom_type -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Block.ofb.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Block.ofb 12 | 13 | 14 | ?iv:string ->
15 | int -> Cryptokit.Block.block_cipher -> Cryptokit.Block.block_cipher
-------------------------------------------------------------------------------- /tools/spl/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | SPL Debugger 16 | 17 | 18 | 25 |
26 | 27 |
28 | $AUTO 29 | 30 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/index_exceptions.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Index of exceptions 13 | 14 | 15 |

Index of exceptions

16 | 17 | 18 | 19 | 24 |

E
Error [Cryptokit]
20 | Exception raised by functions in this library 21 | to report error conditions. 22 |
23 |

25 | 26 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Block.cfb_decrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Block.cfb_decrypt 12 | 13 | 14 | ?iv:string ->
15 | int -> Cryptokit.Block.block_cipher -> Cryptokit.Block.block_cipher
-------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Block.cfb_encrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Block.cfb_encrypt 12 | 13 | 14 | ?iv:string ->
15 | int -> Cryptokit.Block.block_cipher -> Cryptokit.Block.block_cipher
-------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Block.cipher_padded_decrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Block.cipher_padded_decrypt 12 | 13 | 14 | Cryptokit.Padding.scheme ->
15 | Cryptokit.Block.block_cipher -> Cryptokit.transform
-------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Block.cipher_padded_encrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Block.cipher_padded_encrypt 12 | 13 | 14 | Cryptokit.Padding.scheme ->
15 | Cryptokit.Block.block_cipher -> Cryptokit.transform
-------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Padding.scheme.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Padding.scheme 12 | 13 | 14 | object method pad : string -> int -> unit method strip : string -> int end -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /config.h 2 | /config.status 3 | /config.log 4 | /config.mk 5 | *.omc 6 | /.omakedb 7 | *.cmi 8 | *.cmo 9 | *.cma 10 | *.cmx 11 | *.cmxa 12 | *.opt 13 | *.run 14 | *.a 15 | *.o 16 | *.annot 17 | *.so 18 | ._d/ 19 | ._bcdi/ 20 | ._ncdi/ 21 | /lib/ssh/ssh_message.ml 22 | /lib/ssh/ssh_server_automaton.ml 23 | /lib/ssh/ssh_server_automaton.mli 24 | /lib/ssh/ssh_server_channel.ml 25 | /lib/ssh/ssh_server_channel.mli 26 | /lib/ssh/ssh_statecalls.ml 27 | /tools/mpl/mpl_lexer.ml 28 | /tools/mpl/mpl_parser.ml 29 | /tools/mpl/mpl_parser.mli 30 | /tools/mpl/mplc 31 | /tools/spl/spl_lexer.ml 32 | /tools/spl/spl_parser.ml 33 | /tools/spl/splc 34 | /apps/deens/deens 35 | /apps/deens/deens.pid 36 | /apps/deens/deens.conf 37 | /apps/deens/gen_deens_ml 38 | /dist/getopt/doc/ 39 | /apps/deens/conf_autogen.ml 40 | /apps/mldig/mldig 41 | /apps/sshd/sshd 42 | /lib/config/config_lexer.ml 43 | /lib/config/config_parser.ml 44 | /lib/config/config_parser.mli 45 | /lib/dhcp/dhcp.ml 46 | /lib/dns/dns.ml 47 | /lib/dns/dns_rr.ml 48 | /lib/dns/dnslexer.ml 49 | /lib/dns/dnsparser.ml 50 | /lib/dns/dnsparser.mli 51 | /lib/ethernet/ethernet.ml 52 | /lib/icmp/icmp.ml 53 | /lib/ipv4/ipv4.ml 54 | /lib/pcap/pcap_entry.ml 55 | /lib/udp/udp.ml 56 | /tools/spl/spl_parser.mli 57 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Block.mac.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Block.mac 12 | 13 | 14 | ?iv:string ->
15 | ?pad:Cryptokit.Padding.scheme ->
16 | Cryptokit.Block.block_cipher -> Cryptokit.hash
-------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Random.rng.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Random.rng 12 | 13 | 14 | object
15 |   method random_bytes : string -> int -> int -> unit
16 |   method wipe : unit
17 | end
-------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Hexa.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Hexa 12 | 13 | 14 | sig
15 |   val encode : unit -> Cryptokit.transform
16 |   val decode : unit -> Cryptokit.transform
17 | end
-------------------------------------------------------------------------------- /lib/ssh/OMakefile: -------------------------------------------------------------------------------- 1 | # MPL generation 2 | # 3 | GEN_FILES[] = 4 | ssh_server_automaton.ml 5 | ssh_server_channel.ml 6 | ssh_statecalls.ml 7 | 8 | OCamlGeneratedFiles($(GEN_FILES)) 9 | 10 | OCAMLINCLUDES += $(SPL_DIR) 11 | OCAMLINCLUDES += $(MPL_DIR) 12 | OCAMLINCLUDES += $(LIB_DIR)/ounix 13 | OCAMLINCLUDES += $(DIST_DIR)/cryptokit 14 | 15 | MPL_FILES = ssh_message 16 | MPL_FLAGS = -s 17 | MPLGenerated($(MPL_FILES)) 18 | 19 | SPL_FILES = ssh_server_automaton ssh_server_channel 20 | 21 | SPLGenerated(ssh_statecalls, $(SPL_FILES), false) 22 | 23 | # Main library compilation 24 | # 25 | 26 | FILES[] = 27 | ssh_statecalls 28 | ssh_server_automaton 29 | ssh_server_channel 30 | ssh_message 31 | ssh_classify 32 | ssh_utils 33 | ssh_tty 34 | ssh_algorithms 35 | ssh_version 36 | ssh_pool 37 | ssh_keys 38 | ssh_kex 39 | ssh_channel 40 | ssh_env_t 41 | ssh_transport 42 | ssh_userauth 43 | ssh_config 44 | ssh_env 45 | ssh_server 46 | 47 | SSH_OCAML = $(OCamlLibrary ssh, $(FILES)) 48 | 49 | $(SSH_OCAML): $(ROOT)/dist/cryptokit/cryptokit.cmi $(ROOT)/tools/mpl/mpl_stdlib.cmi $(LIB_DIR)/ounix/ounix.cmxa $(ROOT)/tools/spl/spl_stdlib.cmi 50 | 51 | 52 | .DEFAULT: $(SSH_OCAML) 53 | 54 | clean: 55 | $(CLEAN) $(GEN_FILES) dllssh_stubs.so 56 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Zlib.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Zlib 12 | 13 | 14 | sig
15 |   val compress : ?level:int -> unit -> Cryptokit.transform
16 |   val uncompress : unit -> Cryptokit.transform
17 | end
-------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Stream.stream_cipher.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Stream.stream_cipher 12 | 13 | 14 | object
15 |   method transform : string -> int -> string -> int -> int -> unit
16 |   method wipe : unit
17 | end
-------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Block.block_cipher.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Block.block_cipher 12 | 13 | 14 | object
15 |   method blocksize : int
16 |   method transform : string -> int -> string -> int -> unit
17 |   method wipe : unit
18 | end
-------------------------------------------------------------------------------- /dist/cryptokit/arcfour.h: -------------------------------------------------------------------------------- 1 | /***********************************************************************/ 2 | /* */ 3 | /* The Cryptokit library */ 4 | /* */ 5 | /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ 6 | /* */ 7 | /* Copyright 2002 Institut National de Recherche en Informatique et */ 8 | /* en Automatique. All rights reserved. This file is distributed */ 9 | /* under the terms of the GNU Library General Public License, with */ 10 | /* the special exception on linking described in file LICENSE. */ 11 | /* */ 12 | /***********************************************************************/ 13 | 14 | /* $Id: arcfour.h,v 1.1 2002/03/31 17:44:34 xleroy Exp $ */ 15 | 16 | struct arcfour_key 17 | { 18 | unsigned char state[256]; 19 | unsigned char x, y; 20 | }; 21 | 22 | extern void arcfour_cook_key(struct arcfour_key * key, 23 | unsigned char * key_data, 24 | int key_data_len); 25 | 26 | extern void arcfour_encrypt(struct arcfour_key * key, 27 | char * src, char * dst, long len); 28 | 29 | -------------------------------------------------------------------------------- /tools/spl/spl_stdlib.ml: -------------------------------------------------------------------------------- 1 | (* 2 | * Copyright (c) 2006 Anil Madhavapeddy 3 | * 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | * 16 | *) 17 | 18 | (* Standard Helper functions for using SPL automata *) 19 | 20 | let get_tcp_sock_factory port = 21 | let s = Unix.socket Unix.PF_INET Unix.SOCK_STREAM 0 in 22 | Unix.setsockopt s Unix.SO_REUSEADDR true; 23 | Unix.bind s (Unix.ADDR_INET(Unix.inet_addr_any,port)); 24 | Unix.listen s 5; 25 | let sock_factory () = 26 | let fd,_ = Unix.accept s in 27 | let ic = Unix.in_channel_of_descr fd in 28 | let oc = Unix.out_channel_of_descr fd in 29 | oc,ic 30 | in 31 | sock_factory -------------------------------------------------------------------------------- /dist/cryptokit/sha1.h: -------------------------------------------------------------------------------- 1 | /***********************************************************************/ 2 | /* */ 3 | /* The Cryptokit library */ 4 | /* */ 5 | /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ 6 | /* */ 7 | /* Copyright 2002 Institut National de Recherche en Informatique et */ 8 | /* en Automatique. All rights reserved. This file is distributed */ 9 | /* under the terms of the GNU Library General Public License, with */ 10 | /* the special exception on linking described in file LICENSE. */ 11 | /* */ 12 | /***********************************************************************/ 13 | 14 | /* $Id: sha1.h,v 1.1 2002/03/31 17:44:35 xleroy Exp $ */ 15 | 16 | /* SHA-1 hashing */ 17 | 18 | typedef unsigned int u32; 19 | 20 | struct SHA1Context { 21 | u32 state[5]; 22 | u32 length[2]; 23 | int numbytes; 24 | unsigned char buffer[64]; 25 | }; 26 | 27 | extern void SHA1_init(struct SHA1Context * ctx); 28 | extern void SHA1_add_data(struct SHA1Context * ctx, unsigned char * data, 29 | unsigned long len); 30 | extern void SHA1_finish(struct SHA1Context * ctx, unsigned char output[20]); 31 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Base64.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Base64 12 | 13 | 14 | sig
15 |   val encode_multiline : unit -> Cryptokit.transform
16 |   val encode_compact : unit -> Cryptokit.transform
17 |   val decode : unit -> Cryptokit.transform
18 | end
-------------------------------------------------------------------------------- /mk/base.mk: -------------------------------------------------------------------------------- 1 | USE_MPL ?= No 2 | MPL_FLAGS ?= 3 | 4 | ifneq ($(MPL_AUTOGEN),"") 5 | USE_MPL := Yes 6 | endif 7 | 8 | USE_SPL ?= No 9 | ifneq ($(SPL_AUTOGEN),"") 10 | USE_SPL := Yes 11 | endif 12 | 13 | SPL_DIR=$(BUILD_ROOT)/tools/spl 14 | MPL_DIR=$(BUILD_ROOT)/tools/mpl 15 | MPLC=$(MPL_DIR)/mplc 16 | SPLC=$(SPL_DIR)/splc 17 | 18 | OCAMLMAKEFILE=$(BUILD_ROOT)/OCamlMakefile 19 | 20 | $(MPLC): 21 | $(MAKE) -C $(BUILD_ROOT)/tools/mpl all 22 | 23 | $(SPLC): 24 | $(MAKE) -C $(BUILD_ROOT)/tools/spl all 25 | 26 | tool_dep = 27 | 28 | ifeq ($(USE_MPL),Yes) 29 | LIBDIRS += $(BUILD_ROOT)/tools/mpl 30 | INCDIRS += $(BUILD_ROOT)/tools/mpl 31 | tool_dep += $(MPLC) 32 | endif 33 | 34 | ifeq ($(USE_SPL),Yes) 35 | LIBDIRS += $(BUILD_ROOT)/tools/spl 36 | INCDIRS += $(BUILD_ROOT)/tools/spl 37 | tool_dep += $(SPLC) 38 | endif 39 | 40 | depend:: $(tool_dep) 41 | 42 | extra_mel_libs+=$(patsubst %,$(BUILD_ROOT)/dist/%,$(DISTS)) 43 | extra_mel_libs+= $(patsubst %,$(BUILD_ROOT)/lib/%,$(MELANGE_LIBS)) 44 | LIBS+= $(MELANGE_LIBS) 45 | LIBDIRS+= $(extra_mel_libs) 46 | INCDIRS+= $(extra_mel_libs) 47 | 48 | depend:: 49 | @set -e; for i in $(MELANGE_LIBS); do $(MAKE) -C $(BUILD_ROOT)/lib/$$i depend all; done 50 | @set -e; for i in $(DISTS); do $(MAKE) -C $(BUILD_ROOT)/dist/$$i -f Makefile.wrapper all; done 51 | 52 | f_spl = $(call patsubst,%,%.spl,$1) 53 | f_mpl = $(call patsubst,%,%.mpl,$1) 54 | f_ml = $(call patsubst,%,%.ml,$1) 55 | f_mli = $(call patsubst,%,%.mli,$1) 56 | 57 | ANNOTATE := yes 58 | -------------------------------------------------------------------------------- /lib/dhcp/dhcplib.ml: -------------------------------------------------------------------------------- 1 | (* 2 | * Copyright (c) 2006 Anil Madhavapeddy 3 | * 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | * 16 | * $Id: dhcplib.ml,v 1.1 2006/05/31 05:30:46 avsm Exp $ 17 | *) 18 | 19 | open Dhcp 20 | 21 | let parse_options env = 22 | let module M = Mpl_stdlib in 23 | let _ (* cookie *) = M.Mpl_uint32.unmarshal env in 24 | let cont = ref true in 25 | let pos = ref (M.curpos env) in 26 | while !cont do 27 | let env' = M.env_at env !pos (M.size env) in 28 | let o = Dhcp_option.unmarshal env' in 29 | pos := !pos + (M.curpos env'); 30 | Dhcp_option.prettyprint o; 31 | match o with 32 | |`Pad x -> () 33 | |`End x -> cont := false 34 | |_ -> () 35 | done 36 | -------------------------------------------------------------------------------- /dist/cryptokit/sha256.h: -------------------------------------------------------------------------------- 1 | /***********************************************************************/ 2 | /* */ 3 | /* The Cryptokit library */ 4 | /* */ 5 | /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ 6 | /* */ 7 | /* Copyright 2002 Institut National de Recherche en Informatique et */ 8 | /* en Automatique. All rights reserved. This file is distributed */ 9 | /* under the terms of the GNU Library General Public License, with */ 10 | /* the special exception on linking described in file LICENSE. */ 11 | /* */ 12 | /***********************************************************************/ 13 | 14 | /* $Id: sha256.h,v 1.1 2004/08/20 12:05:55 xleroy Exp $ */ 15 | 16 | /* SHA-256 hashing */ 17 | 18 | typedef unsigned int u32; 19 | 20 | struct SHA256Context { 21 | u32 state[8]; 22 | u32 length[2]; 23 | int numbytes; 24 | unsigned char buffer[64]; 25 | }; 26 | 27 | extern void SHA256_init(struct SHA256Context * ctx); 28 | extern void SHA256_add_data(struct SHA256Context * ctx, unsigned char * data, 29 | unsigned long len); 30 | extern void SHA256_finish(struct SHA256Context * ctx, 31 | unsigned char output[32]); 32 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Block.mac_final_triple.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Block.mac_final_triple 12 | 13 | 14 | ?iv:string ->
15 | ?pad:Cryptokit.Padding.scheme ->
16 | Cryptokit.Block.block_cipher ->
17 | Cryptokit.Block.block_cipher ->
18 | Cryptokit.Block.block_cipher -> Cryptokit.hash
-------------------------------------------------------------------------------- /lib/ssh/ssh_keys.ml: -------------------------------------------------------------------------------- 1 | (* 2 | * Copyright (c) 2004 Anil Madhavapeddy 3 | * 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | * 16 | * $Id: ssh_keys.ml,v 1.4 2006/01/17 18:33:49 avsm Exp $ 17 | *) 18 | 19 | module PublicKey = struct 20 | type t = DSSKey | RSAKey 21 | 22 | let of_string = function 23 | |"ssh-dss" -> Some DSSKey 24 | |"ssh-rsa" -> Some RSAKey 25 | |_ -> None 26 | 27 | let to_string = function 28 | |DSSKey -> "ssh-dss" 29 | |RSAKey -> "ssh-rsa" 30 | end 31 | 32 | module PublicKeySig = struct 33 | type t = DSSSig | RSASig 34 | let of_string = function 35 | |"ssh-dss" -> Some DSSSig 36 | |"ssh-rsa" -> Some RSASig 37 | |_ -> None 38 | 39 | let to_string = function 40 | |DSSSig -> "ssh-dss" 41 | |RSASig -> "ssh-rsa" 42 | 43 | end 44 | -------------------------------------------------------------------------------- /lib/ssh/ssh_userauth.ml: -------------------------------------------------------------------------------- 1 | (* 2 | * Copyright (c) 2005 Anil Madhavapeddy 3 | * 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | * 16 | * $Id: ssh_userauth.ml,v 1.2 2006/01/14 17:46:00 avsm Exp $ 17 | *) 18 | 19 | open Ssh_utils 20 | 21 | exception Unknown_userauth 22 | 23 | type t = 24 | |Password 25 | |Public_key 26 | |Keyboard_interactive 27 | |Host_based 28 | 29 | let to_string = function 30 | |Password -> "password" 31 | |Public_key -> "publickey" 32 | |Keyboard_interactive -> "keyboard-interactive" 33 | |Host_based -> "hostbased" 34 | 35 | let of_string = function 36 | |"password" -> Password 37 | |"publickey" -> Public_key 38 | |"keyboard-interactive" -> Keyboard_interactive 39 | |"hostbased" -> Host_based 40 | |_ -> raise Unknown_userauth 41 | 42 | let to_string x = String.concat "," (List.map to_string x) -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Stream.cipher.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Cryptokit.Stream.cipher 15 | 16 | 17 | 20 |

Class Cryptokit.Stream.cipher

21 |
22 |
class cipher : stream_cipher -> Cryptokit.transform
Wraps an arbitrary stream cipher as a transform. 23 | The transform has input and output block size of 1.
24 |
25 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

16 | Index of types
17 | Index of exceptions
18 | Index of values
19 | Index of class methods
20 | Index of classes
21 | Index of class types
22 | Index of modules
23 |

24 | 25 | 31 |
Cryptokit
26 | The Cryptokit library provides a variety of cryptographic primitives 27 | that can be used to implement cryptographic protocols in 28 | security-sensitive applications. 29 |
30 |
32 | 33 | -------------------------------------------------------------------------------- /dist/cryptokit/ripemd160.h: -------------------------------------------------------------------------------- 1 | /***********************************************************************/ 2 | /* */ 3 | /* The Cryptokit library */ 4 | /* */ 5 | /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ 6 | /* */ 7 | /* Copyright 2005 Institut National de Recherche en Informatique et */ 8 | /* en Automatique. All rights reserved. This file is distributed */ 9 | /* under the terms of the GNU Library General Public License, with */ 10 | /* the special exception on linking described in file LICENSE. */ 11 | /* */ 12 | /***********************************************************************/ 13 | 14 | /* $Id: ripemd160.h,v 1.1 2005/02/21 13:49:19 xleroy Exp $ */ 15 | 16 | /* RIPEMD160 hashing */ 17 | 18 | typedef unsigned int u32; 19 | 20 | struct RIPEMD160Context { 21 | u32 state[5]; 22 | u32 length[2]; 23 | int numbytes; 24 | unsigned char buffer[64]; 25 | }; 26 | 27 | extern void RIPEMD160_init(struct RIPEMD160Context * ctx); 28 | extern void RIPEMD160_add_data(struct RIPEMD160Context * ctx, 29 | unsigned char * data, 30 | unsigned long len); 31 | extern void RIPEMD160_finish(struct RIPEMD160Context * ctx, 32 | unsigned char output[20]); 33 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Block.aes_decrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Cryptokit.Block.aes_decrypt 16 | 17 | 18 | 22 |

Class Cryptokit.Block.aes_decrypt

23 |
24 |
class aes_decrypt : string -> block_cipher
The AES block cipher, in decryption mode.
25 |
26 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Block.des_decrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Cryptokit.Block.des_decrypt 16 | 17 | 18 | 22 |

Class Cryptokit.Block.des_decrypt

23 |
24 |
class des_decrypt : string -> block_cipher
The DES block cipher, in decryption mode.
25 |
26 | -------------------------------------------------------------------------------- /lib/dns/dnsserver.ml: -------------------------------------------------------------------------------- 1 | (* 2 | dnsserver.ml -- an authoritative DNS server 3 | Copyright (c) 2005-2006 Tim Deegan 4 | *) 5 | 6 | open Dnsloader 7 | 8 | let filefn fname fn = 9 | let c = open_in fname in 10 | let ret = try 11 | fn c 12 | with ex -> ( close_in c; raise ex ); 13 | in close_in c; 14 | ret 15 | 16 | (* Load a zone from a master file *) 17 | let load_zone origin filename = 18 | filefn filename (fun channel -> 19 | try 20 | let lexbuf = Lexing.from_channel channel in 21 | state.paren <- 0; 22 | state.filename <- filename; 23 | state.lineno <- 1; 24 | state.origin <- List.map String.lowercase origin; 25 | state.ttl <- Int32.of_int 3600; 26 | state.owner <- state.origin; 27 | Dnsparser.zfile Dnslexer.token lexbuf 28 | with 29 | Sys_error s -> prerr_endline ("Error: can't open \"" ^ filename 30 | ^ "\": " ^ s ^ "\"") 31 | | Parsing.Parse_error -> () 32 | ) 33 | 34 | 35 | (* Testing *) 36 | (* 37 | 38 | open Dnsloader;; 39 | open Dnsquery;; 40 | open Dnsserver;; 41 | module L = Dnslexer;; 42 | 43 | let do_lookup qname qtype = 44 | print_string (";; QUERY " ^ (String.concat "." qname) ^ " " 45 | ^ (qtype_to_string qtype) ^ "\n"); 46 | let answer = answer_query qname qtype `IN L.state.L.db.trie 47 | in print_string (answer_to_string answer) 48 | ;; 49 | 50 | load_zone [] "root.hints";; 51 | load_zone ["example";"COM"] "test.zone";; 52 | 53 | do_lookup ["example";"com"] `MX;; 54 | 55 | do_lookup ["lists";"example";"com"] `ANY;; 56 | 57 | do_lookup ["badname";"example";"com"] `TXT;; 58 | do_lookup ["one";"example";"com"] `ANY;; 59 | 60 | *) 61 | -------------------------------------------------------------------------------- /lib/ounix/OMakefile: -------------------------------------------------------------------------------- 1 | # Compilation detection for pty code (util.h needed on OpenBSD, -lutil needed on Linux.) 2 | static. = 3 | CAMLLIB=$(shell ocamlc -where) 4 | PTY_H_AVAILABLE = $(VerboseCheckCHeader pty.h) 5 | UTIL_H_AVAILABLE = $(VerboseCheckCHeader util.h) 6 | UTIL_LIB_AVAILABLE = $(VerboseCheckCLib util, openpty) 7 | PTY_CFLAGS[] = $(if $(PTY_H_AVAILABLE), -DHAVE_PTY_H. $(EMPTY_ARRAY)) 8 | PTY_CFLAGS[] += $(if $(UTIL_H_AVAILABLE), -DHAVE_UTIL_H, $(EMPTY_ARRAY)) 9 | PTY_OCAML_LIB_FLAGS = $(if $(UTIL_LIB_AVAILABLE), -cclib -lutil, $(EMPTY)) 10 | ConfMsgChecking(for a sane termios.h) 11 | SANE_TERMIOS_AVAILABLE = $(TryCompileC $"" 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | int main(int argc, const char **argv) { 21 | int fd = 0; 22 | ioctl(fd, TIOCNOTTY, NULL); 23 | ioctl(fd, TIOCSCTTY, NULL); 24 | ioctl(fd, TIOCSWINSZ, NULL); 25 | } 26 | "") 27 | ConfMsgFound($(SANE_TERMIOS_AVAILABLE)) 28 | export 29 | 30 | if $(not $(SANE_TERMIOS_AVAILABLE)) 31 | eprintln($"The termios.h on this system appears to lack some defines. Melange will not build on this system.") 32 | exit(1) 33 | 34 | .PHONY: clean 35 | 36 | INCLUDES += $(CAMLLIB) 37 | CFLAGS += $(PTY_CFLAGS) 38 | 39 | UNIX_CLIB = $(StaticCLibrary ounix_stubs, ounix_stubs pty_stubs) 40 | 41 | FILES[] = 42 | olog 43 | ounix 44 | 45 | PROGRAM = ounix 46 | 47 | OCAML_CLIBS += ounix_stubs 48 | OCAML_LIB_FLAGS += $(PTY_OCAML_LIB_FLAGS) 49 | 50 | .DEFAULT: $(OCamlLibrary $(PROGRAM),$(FILES)) $(UNIX_CLIB) 51 | 52 | clean: 53 | $(CLEAN) $(PROGRAM) dllounix_stubs.so 54 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Block.triple_des_decrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Cryptokit.Block.triple_des_decrypt 16 | 17 | 18 | 22 |

Class Cryptokit.Block.triple_des_decrypt

23 |
24 |
class triple_des_decrypt : string -> block_cipher
The Triple-DES block cipher, in decryption mode.
25 |
26 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Block.des_encrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Cryptokit.Block.des_encrypt 16 | 17 | 18 | 22 |

Class Cryptokit.Block.des_encrypt

23 |
24 |
class des_encrypt : string -> block_cipher
The DES block cipher, in encryption mode. The string argument 25 | is the key; its length must be 8 bytes.
26 |
27 | -------------------------------------------------------------------------------- /lib/dns/dnstrie.mli: -------------------------------------------------------------------------------- 1 | (* 2 | dnstrie.mli -- interface to 256-way radix trie for DNS lookups 3 | Copyright (c) 2005-2006 Tim Deegan 4 | *) 5 | 6 | type dnstrie (* Node of the trie *) 7 | type key (* Lookup key for the trie *) 8 | 9 | exception BadDomainName of string (* Malformed input to canon2key *) 10 | exception TrieCorrupt (* Missing data from a soa/cut node *) 11 | 12 | (* Convert a canonical [ "www"; "example"; "com" ] domain name into a key 13 | N.B. Requires that the input is already lower-case! *) 14 | val canon2key : string list -> key 15 | 16 | (* Make a new, empty trie. *) 17 | val new_trie : unit -> dnstrie 18 | 19 | (* Simple lookup function: just walk the trie *) 20 | val simple_lookup : key -> dnstrie -> Dnsrr.dnsnode option 21 | 22 | (* Look up a DNS entry in the trie, with full return *) 23 | val lookup : key -> dnstrie -> 24 | [> `Delegated of bool * Dnsrr.dnsnode 25 | | `Found of bool * Dnsrr.dnsnode * Dnsrr.dnsnode 26 | | `NXDomain of Dnsrr.dnsnode 27 | | `NXDomainNSEC of Dnsrr.dnsnode * Dnsrr.dnsnode * Dnsrr.dnsnode 28 | | `NoError of Dnsrr.dnsnode 29 | | `NoErrorNSEC of Dnsrr.dnsnode * Dnsrr.dnsnode 30 | | `Wildcard of Dnsrr.dnsnode * Dnsrr.dnsnode 31 | | `WildcardNSEC of Dnsrr.dnsnode * Dnsrr.dnsnode * Dnsrr.dnsnode ] 32 | 33 | (* Return the data mapped from this key, making new data if there is 34 | none there yet. *) 35 | val lookup_or_insert : key -> dnstrie -> ?parent:dnstrie 36 | -> (unit -> Dnsrr.dnsnode) 37 | -> Dnsrr.dnsnode 38 | 39 | (* Sort out flags for a key's node: call after adding or removing 40 | NS, SOA and KEY RRs *) 41 | val fix_flags : key -> dnstrie -> unit 42 | 43 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Block.aes_encrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Cryptokit.Block.aes_encrypt 16 | 17 | 18 | 22 |

Class Cryptokit.Block.aes_encrypt

23 |
24 |
class aes_encrypt : string -> block_cipher
The AES block cipher, in encryption mode. The string argument 25 | is the key; its length must be 16, 24 or 32 bytes.
26 |
27 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Stream.arcfour.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Cryptokit.Stream.arcfour 15 | 16 | 17 | 20 |

Class Cryptokit.Stream.arcfour

21 |
22 |
class arcfour : string -> stream_cipher
The ARCfour (``alleged RC4'') stream cipher. 23 | The argument is the key, and must be of length 1 to 256. 24 | This stream cipher works by xor-ing the input with the 25 | output of a key-dependent pseudo random number generator. 26 | Thus, decryption is the same function as encryption.
27 |
28 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Block.triple_des_encrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Cryptokit.Block.triple_des_encrypt 16 | 17 | 18 | 22 |

Class Cryptokit.Block.triple_des_encrypt

23 |
24 |
class triple_des_encrypt : string -> block_cipher
The Triple-DES block cipher, in encryption mode. 25 | The key argument must have length 16 (two keys) or 24 (three keys).
26 |
27 | -------------------------------------------------------------------------------- /dist/cryptokit/stubs-sha1.c: -------------------------------------------------------------------------------- 1 | /***********************************************************************/ 2 | /* */ 3 | /* The Cryptokit library */ 4 | /* */ 5 | /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ 6 | /* */ 7 | /* Copyright 2002 Institut National de Recherche en Informatique et */ 8 | /* en Automatique. All rights reserved. This file is distributed */ 9 | /* under the terms of the GNU Library General Public License, with */ 10 | /* the special exception on linking described in file LICENSE. */ 11 | /* */ 12 | /***********************************************************************/ 13 | 14 | /* $Id: stubs-sha1.c,v 1.2 2003/07/10 14:20:31 xleroy Exp $ */ 15 | 16 | #include "sha1.h" 17 | #include 18 | #include 19 | #include 20 | 21 | #define Context_val(v) ((struct SHA1Context *) String_val(v)) 22 | 23 | CAMLprim value caml_sha1_init(value unit) 24 | { 25 | value ctx = alloc_string(sizeof(struct SHA1Context)); 26 | SHA1_init(Context_val(ctx)); 27 | return ctx; 28 | } 29 | 30 | CAMLprim value caml_sha1_update(value ctx, value src, value ofs, value len) 31 | { 32 | SHA1_add_data(Context_val(ctx), &Byte_u(src, Long_val(ofs)), Long_val(len)); 33 | return Val_unit; 34 | } 35 | 36 | CAMLprim value caml_sha1_final(value ctx) 37 | { 38 | CAMLparam1(ctx); 39 | CAMLlocal1(res); 40 | 41 | res = alloc_string(20); 42 | SHA1_finish(Context_val(ctx), &Byte_u(res, 0)); 43 | CAMLreturn(res); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Block.cfb_decrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Cryptokit.Block.cfb_decrypt 16 | 17 | 18 | 22 |

Class Cryptokit.Block.cfb_decrypt

23 |
24 |
class cfb_decrypt : ?iv:string -> int -> block_cipher -> block_cipher
Add Cipher Feedback Block (CFB) to the given block cipher 25 | in decryption mode. See Cryptokit.Block.cfb_encrypt.
26 |
27 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.hash.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.hash 12 | 13 | 14 | object
15 |   method add_byte : int -> unit
16 |   method add_char : char -> unit
17 |   method add_string : string -> unit
18 |   method add_substring : string -> int -> int -> unit
19 |   method hash_size : int
20 |   method result : string
21 |   method wipe : unit
22 | end
-------------------------------------------------------------------------------- /dist/cryptokit/stubs-sha256.c: -------------------------------------------------------------------------------- 1 | /***********************************************************************/ 2 | /* */ 3 | /* The Cryptokit library */ 4 | /* */ 5 | /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ 6 | /* */ 7 | /* Copyright 2004 Institut National de Recherche en Informatique et */ 8 | /* en Automatique. All rights reserved. This file is distributed */ 9 | /* under the terms of the GNU Library General Public License, with */ 10 | /* the special exception on linking described in file LICENSE. */ 11 | /* */ 12 | /***********************************************************************/ 13 | 14 | /* $Id: stubs-sha256.c,v 1.1 2004/08/20 12:05:55 xleroy Exp $ */ 15 | 16 | #include "sha256.h" 17 | #include 18 | #include 19 | #include 20 | 21 | #define Context_val(v) ((struct SHA256Context *) String_val(v)) 22 | 23 | CAMLprim value caml_sha256_init(value unit) 24 | { 25 | value ctx = alloc_string(sizeof(struct SHA256Context)); 26 | SHA256_init(Context_val(ctx)); 27 | return ctx; 28 | } 29 | 30 | CAMLprim value caml_sha256_update(value ctx, value src, value ofs, value len) 31 | { 32 | SHA256_add_data(Context_val(ctx), &Byte_u(src, Long_val(ofs)), Long_val(len)); 33 | return Val_unit; 34 | } 35 | 36 | CAMLprim value caml_sha256_final(value ctx) 37 | { 38 | CAMLparam1(ctx); 39 | CAMLlocal1(res); 40 | 41 | res = alloc_string(32); 42 | SHA256_finish(Context_val(ctx), &Byte_u(res, 0)); 43 | CAMLreturn(res); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Block.cipher.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Cryptokit.Block.cipher 15 | 16 | 17 | 20 |

Class Cryptokit.Block.cipher

21 |
22 |
class cipher : block_cipher -> Cryptokit.transform
Wraps a block cipher as a general transform. The transform 23 | has input block size and output block size equal to the 24 | block size of the block cipher. No padding is performed. 25 | Example: new cipher (new cbc_encrypt (new aes_encrypt key)) 26 | returns a transform that performs AES encryption in CBC mode.
27 |
28 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Padding.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Padding 12 | 13 | 14 | sig
15 |   class type scheme =
16 |     object
17 |       method pad : string -> int -> unit
18 |       method strip : string -> int
19 |     end
20 |   val length : Cryptokit.Padding.scheme
21 |   val _8000 : Cryptokit.Padding.scheme
22 | end
-------------------------------------------------------------------------------- /dist/cryptokit/stubs-ripemd160.c: -------------------------------------------------------------------------------- 1 | /***********************************************************************/ 2 | /* */ 3 | /* The Cryptokit library */ 4 | /* */ 5 | /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ 6 | /* */ 7 | /* Copyright 2005 Institut National de Recherche en Informatique et */ 8 | /* en Automatique. All rights reserved. This file is distributed */ 9 | /* under the terms of the GNU Library General Public License, with */ 10 | /* the special exception on linking described in file LICENSE. */ 11 | /* */ 12 | /***********************************************************************/ 13 | 14 | /* $Id: stubs-ripemd160.c,v 1.1 2005/02/21 13:49:19 xleroy Exp $ */ 15 | 16 | #include "ripemd160.h" 17 | #include 18 | #include 19 | #include 20 | 21 | #define Context_val(v) ((struct RIPEMD160Context *) String_val(v)) 22 | 23 | CAMLprim value caml_ripemd160_init(value unit) 24 | { 25 | value ctx = alloc_string(sizeof(struct RIPEMD160Context)); 26 | RIPEMD160_init(Context_val(ctx)); 27 | return ctx; 28 | } 29 | 30 | CAMLprim value caml_ripemd160_update(value ctx, value src, value ofs, value len) 31 | { 32 | RIPEMD160_add_data(Context_val(ctx), &Byte_u(src, Long_val(ofs)), Long_val(len)); 33 | return Val_unit; 34 | } 35 | 36 | CAMLprim value caml_ripemd160_final(value ctx) 37 | { 38 | CAMLparam1(ctx); 39 | CAMLlocal1(res); 40 | 41 | res = alloc_string(20); 42 | RIPEMD160_finish(Context_val(ctx), &Byte_u(res, 0)); 43 | CAMLreturn(res); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /lib/ounix/olog.mli: -------------------------------------------------------------------------------- 1 | type level = Debug | Warning | Info | Critical 2 | class virtual base_log : 3 | object 4 | val mutable dl : level 5 | method virtual critical : string -> unit 6 | method critical_active : bool 7 | method virtual debug : string -> unit 8 | method debug_active : bool 9 | method virtual info : string -> unit 10 | method info_active : bool 11 | method virtual init : unit 12 | method set_critical : unit 13 | method set_debug : unit 14 | method set_info : unit 15 | method private set_level : level -> unit 16 | method set_warning : unit 17 | method virtual warning : string -> unit 18 | method warning_active : bool 19 | end 20 | class stderr_log : 21 | object 22 | val mutable dl : level 23 | method critical : string -> unit 24 | method critical_active : bool 25 | method debug : string -> unit 26 | method debug_active : bool 27 | method info : string -> unit 28 | method info_active : bool 29 | method init : unit 30 | method set_critical : unit 31 | method set_debug : unit 32 | method set_info : unit 33 | method private set_level : level -> unit 34 | method set_warning : unit 35 | method warning : string -> unit 36 | method warning_active : bool 37 | end 38 | class null_log : 39 | object 40 | val mutable dl : level 41 | method critical : string -> unit 42 | method critical_active : bool 43 | method debug : string -> unit 44 | method debug_active : bool 45 | method info : string -> unit 46 | method info_active : bool 47 | method init : unit 48 | method set_critical : unit 49 | method set_debug : unit 50 | method set_info : unit 51 | method private set_level : level -> unit 52 | method set_warning : unit 53 | method warning : string -> unit 54 | method warning_active : bool 55 | end 56 | -------------------------------------------------------------------------------- /tools/spl/spl_location.ml: -------------------------------------------------------------------------------- 1 | (* 2 | * Copyright (c) 2005 Anil Madhavapeddy 3 | * 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | * 16 | * $Id: spl_location.ml,v 1.3 2006/02/05 21:49:52 avsm Exp $ 17 | *) 18 | 19 | open Lexing 20 | open Printf 21 | 22 | (* Keep track of our location *) 23 | type t = { 24 | file_name: string option; 25 | line_num: int; 26 | column_num: int; 27 | } 28 | 29 | let start = ref 1 30 | let line = ref 1 31 | let file_name = ref None 32 | 33 | let initial_location = { file_name=None; line_num=0; column_num=0 } 34 | let current_location = ref initial_location 35 | 36 | let start_parse f = 37 | start := 1; 38 | line := 1; 39 | file_name := Some f 40 | 41 | let new_line lexbuf = 42 | start := lexeme_end lexbuf; 43 | incr line 44 | 45 | let next_token lexbuf = 46 | let col = lexeme_start lexbuf - !start in 47 | let l = {file_name= !file_name; line_num= !line; column_num=col} in 48 | current_location := l; 49 | l 50 | 51 | let string_of_location l = 52 | let c = if l.column_num > 0 then sprintf " char %d" l.column_num else 53 | "" in 54 | sprintf " at line %d%s:" l.line_num c 55 | -------------------------------------------------------------------------------- /dist/cryptokit/stubs-des.c: -------------------------------------------------------------------------------- 1 | /***********************************************************************/ 2 | /* */ 3 | /* The Cryptokit library */ 4 | /* */ 5 | /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ 6 | /* */ 7 | /* Copyright 2002 Institut National de Recherche en Informatique et */ 8 | /* en Automatique. All rights reserved. This file is distributed */ 9 | /* under the terms of the GNU Library General Public License, with */ 10 | /* the special exception on linking described in file LICENSE. */ 11 | /* */ 12 | /***********************************************************************/ 13 | 14 | /* $Id: stubs-des.c,v 1.2 2002/04/04 12:27:33 xleroy Exp $ */ 15 | 16 | /* Stub code for DES */ 17 | 18 | #include "d3des.h" 19 | #include 20 | #include 21 | #include 22 | 23 | #define Cooked_key_size (32 * sizeof(u32)) 24 | 25 | CAMLprim value caml_des_cook_key(value key, value ofs, value direction) 26 | { 27 | CAMLparam2(key,direction); 28 | value ckey = alloc_string(Cooked_key_size); 29 | d3des_cook_key((u8 *) &Byte(key, Long_val(ofs)), 30 | Int_val(direction), 31 | (u32 *) String_val(ckey)); 32 | CAMLreturn(ckey); 33 | } 34 | 35 | CAMLprim value caml_des_transform(value ckey, value src, value src_ofs, 36 | value dst, value dst_ofs) 37 | { 38 | d3des_transform((u32 *) String_val(ckey), 39 | (u8 *) &Byte(src, Long_val(src_ofs)), 40 | (u8 *) &Byte(dst, Long_val(dst_ofs))); 41 | return Val_unit; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Block.ofb.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Cryptokit.Block.ofb 15 | 16 | 17 | 20 |

Class Cryptokit.Block.ofb

21 |
22 |
class ofb : ?iv:string -> int -> block_cipher -> block_cipher
Add Output Feedback Block (OFB) to the given block cipher. 23 | The integer argument n is the number of 24 | bytes processed at a time; it must lie between 1 and 25 | the block size of the underlying cipher, included. 26 | The returned block cipher has block size n. 27 | It is usable both for encryption and decryption.
28 |
29 | -------------------------------------------------------------------------------- /dist/cryptokit/stubs-misc.c: -------------------------------------------------------------------------------- 1 | /***********************************************************************/ 2 | /* */ 3 | /* The Cryptokit library */ 4 | /* */ 5 | /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ 6 | /* */ 7 | /* Copyright 2002 Institut National de Recherche en Informatique et */ 8 | /* en Automatique. All rights reserved. This file is distributed */ 9 | /* under the terms of the GNU Library General Public License, with */ 10 | /* the special exception on linking described in file LICENSE. */ 11 | /* */ 12 | /***********************************************************************/ 13 | 14 | /* $Id: stubs-misc.c,v 1.2 2005/02/21 14:03:30 xleroy Exp $ */ 15 | 16 | #include 17 | 18 | #define ALIGNMENT_OF(x) ((long)(x) & (sizeof(long) - 1)) 19 | 20 | CAMLprim value caml_xor_string(value src, value src_ofs, 21 | value dst, value dst_ofs, 22 | value len) 23 | { 24 | char * s = &Byte(src, Long_val(src_ofs)); 25 | char * d = &Byte(dst, Long_val(dst_ofs)); 26 | long l = Long_val(len); 27 | 28 | if (l >= 64 && ALIGNMENT_OF(s) == ALIGNMENT_OF(d)) { 29 | while (ALIGNMENT_OF(s) != 0 && l > 0) { 30 | *d ^= *s; 31 | s += 1; 32 | d += 1; 33 | l -= 1; 34 | } 35 | while (l >= sizeof(long)) { 36 | *((long *) d) ^= *((long *) s); 37 | s += sizeof(long); 38 | d += sizeof(long); 39 | l -= sizeof(long); 40 | } 41 | } 42 | while (l > 0) { 43 | *d ^= *s; 44 | s += 1; 45 | d += 1; 46 | l -= 1; 47 | } 48 | return Val_unit; 49 | } 50 | 51 | 52 | -------------------------------------------------------------------------------- /tools/mpl/mpl_location.ml: -------------------------------------------------------------------------------- 1 | (* 2 | * Copyright (c) 2005 Anil Madhavapeddy 3 | * 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | 16 | * $Id: mpl_location.ml,v 1.1 2005/09/15 14:21:18 avsm Exp $ 17 | *) 18 | 19 | open Lexing 20 | open Printf 21 | 22 | (* Keep track of our location *) 23 | type t = { 24 | file_name: string option; 25 | line_num: int; 26 | column_num: int; 27 | } 28 | 29 | let start = ref 1 30 | let line = ref 1 31 | let file_name = ref None 32 | 33 | let initial_location = { file_name=None; line_num=0; column_num=0 } 34 | let current_location = ref initial_location 35 | 36 | let start_parse f = 37 | start := 1; 38 | line := 1; 39 | file_name := Some f 40 | 41 | let new_line lexbuf = 42 | start := lexeme_end lexbuf; 43 | incr line 44 | 45 | let next_token lexbuf = 46 | let col = lexeme_start lexbuf - !start in 47 | let l = {file_name= !file_name; line_num= !line; column_num=col} in 48 | current_location := l; 49 | l 50 | 51 | let string_of_location l = 52 | match l.file_name with 53 | |None -> ":" 54 | |Some f -> 55 | let c = if l.column_num > 0 then sprintf " char %d" l.column_num else 56 | "" in 57 | sprintf " at line %d%s:" l.line_num c 58 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Block.cbc_decrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Cryptokit.Block.cbc_decrypt 16 | 17 | 18 | 22 |

Class Cryptokit.Block.cbc_decrypt

23 |
24 |
class cbc_decrypt : ?iv:string -> block_cipher -> block_cipher
Add Cipher Block Chaining (CBC) to the given block cipher 25 | in decryption mode. This works like Cryptokit.Block.cbc_encrypt, 26 | except that input blocks are first decrypted by the block 27 | cipher before being xor-ed with the previous input block.
28 |
29 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.Stream.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.Stream 12 | 13 | 14 | sig
15 |   class type stream_cipher =
16 |     object
17 |       method transform : string -> int -> string -> int -> int -> unit
18 |       method wipe : unit
19 |     end
20 |   class cipher : Cryptokit.Stream.stream_cipher -> transform
21 |   class arcfour : string -> stream_cipher
22 | end
-------------------------------------------------------------------------------- /lib/dns/dnsrr.mli: -------------------------------------------------------------------------------- 1 | (* 2 | dnsrr.mli --- datatypes and handling for DNS RRs and RRSets 3 | Copyright (c) 2005-2006 Tim Deegan 4 | *) 5 | 6 | type serial = int32 7 | and ipv4 = int32 8 | and cstr = string Hashcons.hash_consed 9 | and dnsnode = { owner : string list Hashcons.hash_consed; 10 | mutable rrsets : rrset list; } 11 | and rrset = { ttl : int32; rdata : rdata; } 12 | and rdata = 13 | A of ipv4 list 14 | | NS of dnsnode list 15 | | CNAME of dnsnode list 16 | | SOA of (dnsnode * dnsnode * serial * int32 * int32 * int32 * int32) list 17 | | MB of dnsnode list 18 | | MG of dnsnode list 19 | | MR of dnsnode list 20 | | WKS of (int32 * int * cstr) list 21 | | PTR of dnsnode list 22 | | HINFO of (cstr * cstr) list 23 | | MINFO of (dnsnode * dnsnode) list 24 | | MX of (int * dnsnode) list 25 | | TXT of cstr list list 26 | | RP of (dnsnode * dnsnode) list 27 | | AFSDB of (int * dnsnode) list 28 | | X25 of cstr list 29 | | ISDN of (cstr * cstr option) list 30 | | RT of (int * dnsnode) list 31 | | AAAA of cstr list 32 | | SRV of (int * int * int * dnsnode) list 33 | | UNSPEC of cstr list 34 | | Unknown of int * cstr list 35 | 36 | (* Hashcons values *) 37 | val hashcons_charstring : string -> cstr 38 | val hashcons_domainname : string list -> string list Hashcons.hash_consed 39 | val clear_cons_tables : unit -> unit 40 | 41 | (* Extract relevant RRSets given a query type, a list of RRSets 42 | and a flag to say whether to return Cnames too *) 43 | val get_rrsets : 44 | [> `A | `AAAA | `AFSDB | `ANY | `CNAME | `HINFO | `ISDN | `MAILB | `MB 45 | | `MG | `MINFO | `MR | `MX | `NS | `PTR | `RP | `RT | `SOA 46 | | `SRV | `TXT | `UNSPEC | `Unknown of int | `WKS | `X25 ] -> 47 | rrset list -> bool -> rrset list 48 | 49 | (* Merge a new RRSet into a list of RRSets. 50 | Returns the new list and the ttl of the resulting RRset. 51 | Reverses the order of the RRsets in the list *) 52 | val merge_rrset : rrset -> rrset list -> int32 * rrset list 53 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Random.rng.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Cryptokit.Random.rng 14 | 15 | 16 | 18 |

Class type Cryptokit.Random.rng

19 |
20 |
class type rng = object .. end
Generic interface for a random number generator.
21 |
22 |
method random_bytes : string -> int -> int -> unit
23 | random_bytes buf pos len stores len random bytes 24 | in string buf, starting at position pos.
25 |
26 |
method wipe : unit
27 | Erases the internal state of the generator. 28 | Do not call random_bytes after calling wipe.
29 |
30 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Block.cfb_encrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Cryptokit.Block.cfb_encrypt 16 | 17 | 18 | 22 |

Class Cryptokit.Block.cfb_encrypt

23 |
24 |
class cfb_encrypt : ?iv:string -> int -> block_cipher -> block_cipher
Add Cipher Feedback Block (CFB) to the given block cipher 25 | in encryption mode. The integer argument n is the number of 26 | bytes processed at a time; it must lie between 1 and 27 | the block size of the underlying cipher, included. 28 | The returned block cipher has block size n.
29 |
30 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Block.cipher_padded_decrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Cryptokit.Block.cipher_padded_decrypt 16 | 17 | 18 | 22 |

Class Cryptokit.Block.cipher_padded_decrypt

23 |
24 |
class cipher_padded_decrypt : Cryptokit.Padding.scheme -> block_cipher -> Cryptokit.transform
Like Cryptokit.Block.cipher, but removes padding on the output data 25 | as specified by the first argument. The output block size of 26 | the returned transform is 1; the input block size is the 27 | block size of the block cipher.
28 |
29 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Block.cipher_padded_encrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Cryptokit.Block.cipher_padded_encrypt 16 | 17 | 18 | 22 |

Class Cryptokit.Block.cipher_padded_encrypt

23 |
24 |
class cipher_padded_encrypt : Cryptokit.Padding.scheme -> block_cipher -> Cryptokit.transform
Like Cryptokit.Block.cipher, but performs padding on the input data 25 | as specified by the first argument. The input block size of 26 | the returned transform is 1; the output block size is the 27 | block size of the block cipher.
28 |
29 | -------------------------------------------------------------------------------- /apps/sshd/ssh_openssh_formats.ml: -------------------------------------------------------------------------------- 1 | (* 2 | * Copyright (c) 2005 Anil Madhavapeddy 3 | * 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | * 16 | * $Id: ssh_openssh_formats.ml,v 1.3 2006/03/17 02:55:43 avsm Exp $ 17 | * 18 | * Compatibility routines for OpenSSH file formats 19 | *) 20 | 21 | open Ssh_utils 22 | 23 | exception Parse_failure 24 | 25 | (* Parse /etc/moduli format, documented in moduli(5) from OpenSSH, 26 | raises Parse_failure if anything messes up *) 27 | let moduli file primes = 28 | Random.self_init (); 29 | try begin 30 | let fin = open_in file in 31 | try while true do 32 | let line = input_line fin in 33 | if String.length line > 0 && String.get line 0 != '#' then begin 34 | let spl = Str.split (Str.regexp_string " ") line in 35 | let nth = List.nth spl in 36 | let size = Int32.succ (Int32.of_string (nth 4)) in 37 | let generator = Mpl_stdlib.Mpl_mpint.of_string 38 | (binary_of_hex (Printf.sprintf "%02x" (int_of_string (nth 5)))) in 39 | let prime = Mpl_stdlib.Mpl_mpint.of_string (binary_of_hex (nth 6)) in 40 | hashtbl_add_to_list primes size (prime, generator) 41 | end 42 | done; 43 | with End_of_file -> close_in fin 44 | end with _ -> raise Parse_failure 45 | -------------------------------------------------------------------------------- /lib/config/config_location.ml: -------------------------------------------------------------------------------- 1 | (* 2 | * Copyright (c) 2006 Anil Madhavapeddy 3 | * 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | * 16 | *) 17 | 18 | open Lexing 19 | open Printf 20 | 21 | (* Keep track of our location *) 22 | type t = { 23 | file_name: string option; 24 | line_num: int; 25 | column_num: int; 26 | } 27 | 28 | exception Syntax_error of t 29 | 30 | let start = ref 1 31 | let line = ref 1 32 | let file_name = ref None 33 | 34 | let initial_location = { file_name=None; line_num=0; column_num=0 } 35 | let current_location = ref initial_location 36 | let cmd_location c = { file_name=Some c; line_num= -1; column_num= -1 } 37 | 38 | let start_parse f = 39 | start := 1; 40 | line := 1; 41 | file_name := Some f 42 | 43 | let new_line lexbuf = 44 | start := lexeme_end lexbuf; 45 | incr line 46 | 47 | let next_token lexbuf = 48 | let col = lexeme_start lexbuf - !start in 49 | let l = {file_name= !file_name; line_num= !line; column_num=col} in 50 | current_location := l; 51 | l 52 | 53 | let string_of_location l = 54 | let filestr = match l.file_name with |None ->"" |Some x -> sprintf " (%s)" x in 55 | let c = if l.column_num > 0 then sprintf " char %d" l.column_num else 56 | "" in 57 | if l.line_num >= 0 then 58 | sprintf " at line %d%s%s:" l.line_num c filestr 59 | else 60 | sprintf " in command line%s: " filestr 61 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Block.cbc_encrypt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Cryptokit.Block.cbc_encrypt 16 | 17 | 18 | 22 |

Class Cryptokit.Block.cbc_encrypt

23 |
24 |
class cbc_encrypt : ?iv:string -> block_cipher -> block_cipher
Add Cipher Block Chaining (CBC) to the given block cipher 25 | in encryption mode. 26 | Each block of input is xor-ed with the previous output block 27 | before being encrypted through the given block cipher. 28 | The optional iv argument specifies the string to be xor-ed 29 | with the first input block, and defaults to all zeroes. 30 | The returned block cipher has the same block size as the 31 | underlying block cipher.
32 |
33 | -------------------------------------------------------------------------------- /dist/cryptokit/arcfour.c: -------------------------------------------------------------------------------- 1 | /***********************************************************************/ 2 | /* */ 3 | /* The Cryptokit library */ 4 | /* */ 5 | /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ 6 | /* */ 7 | /* Copyright 2002 Institut National de Recherche en Informatique et */ 8 | /* en Automatique. All rights reserved. This file is distributed */ 9 | /* under the terms of the GNU Library General Public License, with */ 10 | /* the special exception on linking described in file LICENSE. */ 11 | /* */ 12 | /***********************************************************************/ 13 | 14 | /* $Id: arcfour.c,v 1.1 2002/03/31 17:44:34 xleroy Exp $ */ 15 | 16 | #include "arcfour.h" 17 | 18 | void arcfour_cook_key(struct arcfour_key * key, 19 | unsigned char * key_data, 20 | int key_data_len) 21 | { 22 | unsigned char * s; 23 | int i; 24 | unsigned char t, index1, index2; 25 | 26 | s = &key->state[0]; 27 | for (i = 0; i < 256; i++) s[i] = i; 28 | key->x = 0; 29 | key->y = 0; 30 | index1 = 0; 31 | index2 = 0; 32 | for (i = 0; i < 256; i++) { 33 | index2 = key_data[index1] + s[i] + index2; 34 | t = s[i]; s[i] = s[index2]; s[index2] = t; 35 | index1++; 36 | if (index1 >= key_data_len) index1 = 0; 37 | } 38 | } 39 | 40 | void arcfour_encrypt(struct arcfour_key * key, 41 | char * src, char * dst, long len) 42 | { 43 | int x, y, kx, ky; 44 | 45 | x = key->x; 46 | y = key->y; 47 | for (/*nothing*/; len > 0; len--) { 48 | x = (x + 1) & 0xFF; 49 | kx = key->state[x]; 50 | y = (kx + y) & 0xFF; 51 | ky = key->state[y]; 52 | key->state[x] = ky; key->state[y] = kx; 53 | *dst++ = *src++ ^ key->state[(kx + ky) & 0xFF]; 54 | } 55 | key->x = x; 56 | key->y = y; 57 | } 58 | 59 | 60 | -------------------------------------------------------------------------------- /dist/cryptokit/rijndael-alg-fst.h: -------------------------------------------------------------------------------- 1 | /** 2 | * rijndael-alg-fst.h 3 | * 4 | * @version 3.0 (December 2000) 5 | * 6 | * Optimised ANSI C code for the Rijndael cipher (now AES) 7 | * 8 | * @author Vincent Rijmen 9 | * @author Antoon Bosselaers 10 | * @author Paulo Barreto 11 | * 12 | * This code is hereby placed in the public domain. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS 15 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 21 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 24 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | #ifndef __RIJNDAEL_ALG_FST_H 27 | #define __RIJNDAEL_ALG_FST_H 28 | 29 | #define MAXKC (256/32) 30 | #define MAXKB (256/8) 31 | #define MAXNR 14 32 | 33 | typedef unsigned char u8; 34 | typedef unsigned short u16; 35 | typedef unsigned int u32; 36 | 37 | int rijndaelKeySetupEnc(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits); 38 | int rijndaelKeySetupDec(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits); 39 | void rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 pt[16], u8 ct[16]); 40 | void rijndaelDecrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 ct[16], u8 pt[16]); 41 | 42 | #ifdef INTERMEDIATE_VALUE_KAT 43 | void rijndaelEncryptRound(const u32 rk[/*4*(Nr + 1)*/], int Nr, u8 block[16], int rounds); 44 | void rijndaelDecryptRound(const u32 rk[/*4*(Nr + 1)*/], int Nr, u8 block[16], int rounds); 45 | #endif /* INTERMEDIATE_VALUE_KAT */ 46 | 47 | #endif /* __RIJNDAEL_ALG_FST_H */ 48 | -------------------------------------------------------------------------------- /dist/cryptokit/stubs-md5.c: -------------------------------------------------------------------------------- 1 | /***********************************************************************/ 2 | /* */ 3 | /* The Cryptokit library */ 4 | /* */ 5 | /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ 6 | /* */ 7 | /* Copyright 2002 Institut National de Recherche en Informatique et */ 8 | /* en Automatique. All rights reserved. This file is distributed */ 9 | /* under the terms of the GNU Library General Public License, with */ 10 | /* the special exception on linking described in file LICENSE. */ 11 | /* */ 12 | /***********************************************************************/ 13 | 14 | /* $Id: stubs-md5.c,v 1.3 2004/08/20 12:05:55 xleroy Exp $ */ 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | struct MD5Context { 21 | uint32 buf[4]; 22 | uint32 bits[2]; 23 | unsigned char in[64]; 24 | }; 25 | 26 | CAMLextern void caml_MD5Init (struct MD5Context *context); 27 | CAMLextern void caml_MD5Update (struct MD5Context *context, 28 | unsigned char *buf, unsigned len); 29 | CAMLextern void caml_MD5Final (unsigned char *digest, struct MD5Context *ctx); 30 | 31 | #define Context_val(v) ((struct MD5Context *) String_val(v)) 32 | 33 | CAMLprim value caml_md5_init(value unit) 34 | { 35 | value ctx = alloc_string(sizeof(struct MD5Context)); 36 | caml_MD5Init(Context_val(ctx)); 37 | return ctx; 38 | } 39 | 40 | CAMLprim value caml_md5_update(value ctx, value src, value ofs, value len) 41 | { 42 | caml_MD5Update(Context_val(ctx), &Byte_u(src, Long_val(ofs)), Long_val(len)); 43 | return Val_unit; 44 | } 45 | 46 | CAMLprim value caml_md5_final(value ctx) 47 | { 48 | CAMLparam1(ctx); 49 | CAMLlocal1(res); 50 | 51 | res = alloc_string(16); 52 | caml_MD5Final(&Byte_u(res, 0), Context_val(ctx)); 53 | CAMLreturn(res); 54 | } 55 | 56 | -------------------------------------------------------------------------------- /dist/cryptokit/stubs-arcfour.c: -------------------------------------------------------------------------------- 1 | /***********************************************************************/ 2 | /* */ 3 | /* The Cryptokit library */ 4 | /* */ 5 | /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ 6 | /* */ 7 | /* Copyright 2002 Institut National de Recherche en Informatique et */ 8 | /* en Automatique. All rights reserved. This file is distributed */ 9 | /* under the terms of the GNU Library General Public License, with */ 10 | /* the special exception on linking described in file LICENSE. */ 11 | /* */ 12 | /***********************************************************************/ 13 | 14 | /* $Id: stubs-arcfour.c,v 1.1 2002/03/31 17:44:35 xleroy Exp $ */ 15 | 16 | /* Stub code for ARC4 */ 17 | 18 | #include "arcfour.h" 19 | #include 20 | #include 21 | #include 22 | 23 | #define Cooked_key_size (sizeof(struct arcfour_key)) 24 | #define Key_val(v) ((struct arcfour_key *) String_val(v)) 25 | 26 | CAMLprim value caml_arcfour_cook_key(value key) 27 | { 28 | CAMLparam1(key); 29 | value ckey = alloc_string(Cooked_key_size); 30 | arcfour_cook_key(Key_val(ckey), 31 | (unsigned char *) String_val(key), 32 | string_length(key)); 33 | CAMLreturn(ckey); 34 | } 35 | 36 | CAMLprim value caml_arcfour_transform(value ckey, value src, value src_ofs, 37 | value dst, value dst_ofs, value len) 38 | { 39 | arcfour_encrypt(Key_val(ckey), 40 | &Byte(src, Long_val(src_ofs)), 41 | &Byte(dst, Long_val(dst_ofs)), 42 | Long_val(len)); 43 | return Val_unit; 44 | } 45 | 46 | CAMLprim value caml_arcfour_transform_bytecode(value * argv, int argc) 47 | { 48 | return caml_arcfour_transform(argv[0], argv[1], argv[2], 49 | argv[3], argv[4], argv[5]); 50 | } 51 | -------------------------------------------------------------------------------- /lib/ssh/ssh_pool.ml: -------------------------------------------------------------------------------- 1 | (*pp cpp *) 2 | (* 3 | * Copyright (c) 2006 Anil Madhavapeddy 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 | open Printf 20 | open Ssh_utils 21 | 22 | let max_packet_size = 35000 23 | 24 | type pool = { 25 | size: int; (* bytes in pool pages *) 26 | mutable free_list: string list; (* list of buffers *) 27 | mutable used_list: string list; (* used buffers *) 28 | } 29 | let pool = 30 | let size = max_packet_size in 31 | let l = List.map (fun _ -> String.create size) [1;2;3;4;5;6;7;8;9;10;11;12] in 32 | { size=size; free_list=l; used_list=[] } 33 | 34 | let get () = 35 | match pool.free_list with 36 | |hd::tl -> 37 | pool.free_list <- tl; 38 | pool.used_list <- hd :: pool.used_list; 39 | Mpl_stdlib.new_env hd 40 | |[] -> failwith "out of luck" 41 | 42 | let reset () = 43 | List.iter (fun b -> 44 | (* String.fill b 0 (String.length b) 'X'; *) 45 | pool.free_list <- b :: pool.free_list; 46 | ) pool.used_list; 47 | pool.used_list <- [] 48 | 49 | let get_fn fn = 50 | let buf = match pool.free_list with 51 | |hd::tl -> 52 | pool.free_list <- tl; 53 | hd 54 | |[] -> failwith "out of luck" in 55 | always (fun () -> pool.free_list <- buf :: pool.free_list) 56 | (fun () -> fn (Mpl_stdlib.new_env buf)) 57 | 58 | let get_string_fn fn = 59 | get_fn (fun env -> fn env; Mpl_stdlib.string_of_env env) 60 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/index_types.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Index of types 13 | 14 | 15 |

Index of types

16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 29 | 30 | 31 | 35 | 36 | 37 | 41 | 42 | 46 |

C
chaining_mode [Cryptokit.Cipher]

D
direction [Cryptokit.Cipher]

E
error [Cryptokit]
26 | Error codes for this library. 27 |
28 |

K
key [Cryptokit.RSA]
32 | The type of RSA keys. 33 |
34 |

P
parameters [Cryptokit.DH]
38 | The type of Diffie-Hellman parameters. 39 |
40 |
private_secret [Cryptokit.DH]
43 | The abstract type of private secrets generated during key agreement. 44 |
45 |

47 | 48 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Stream.stream_cipher.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Cryptokit.Stream.stream_cipher 14 | 15 | 16 | 18 |

Class type Cryptokit.Stream.stream_cipher

19 |
20 |
class type stream_cipher = object .. end
Abstract interface for a stream cipher.
21 |
22 |
method transform : string -> int -> string -> int -> int -> unit
23 | transform src spos dst dpos len encrypts or decrypts 24 | len characters, read from string src starting at 25 | position spos. The resulting len characters are 26 | stored in string dst starting at position dpos.
27 |
28 |
method wipe : unit
29 | Erase the internal state of the stream cipher, such as 30 | all key-dependent material.
31 |
32 | -------------------------------------------------------------------------------- /lib/dhcp/dhcp.mpl: -------------------------------------------------------------------------------- 1 | packet dhcp { 2 | op: byte variant { |1 -> BootRequest |2-> BootReply }; 3 | htype: byte variant { |1 -> Ethernet }; 4 | hlen: byte value(sizeof(chaddr)); 5 | hops: byte; 6 | xid: uint32; 7 | secs: uint16; 8 | broadcast: bit[1]; 9 | reserved: bit[15] const(0); 10 | ciaddr: uint32; 11 | yiaddr: uint32; 12 | siaddr: uint32; 13 | giaddr: uint32; 14 | chaddr: byte[16]; 15 | sname: byte[64]; 16 | file: byte[128]; 17 | options: byte[remaining()]; 18 | } 19 | 20 | packet dhcp_option { 21 | code: byte; 22 | classify (code) { 23 | |0:"Pad" -> (); 24 | |1:"SubnetMask" -> 25 | olen: byte const(4); 26 | mask: uint32; 27 | |2:"TimeOffset" -> 28 | olen: byte const(4); 29 | offset: uint32; /* XXX two's complement, not uint32 */ 30 | |3:"Router" -> 31 | olen: byte value(sizeof(routers)); 32 | routers: byte[olen]; /* XXX list of 32-bit IP addresses */ 33 | |4:"TimeServer" -> 34 | olen: byte value(sizeof(timeserver)); 35 | timeserver: byte[olen]; /* XXX list of 32-bit IP addresses */ 36 | |5:"NameServer" -> 37 | olen: byte value(sizeof(nameserver)); 38 | nameserver: byte[olen]; /* XXX list of 32-bit IP addresses */ 39 | |6:"DNSServer" -> 40 | olen: byte value(sizeof(nameserver)); 41 | nameserver: byte[olen]; /* XXX list of 32-bit IP addresses */ 42 | |12:"HostName" -> 43 | olen: byte value(sizeof(hostname)); 44 | hostname: byte[olen]; 45 | |15:"DomainName" -> 46 | olen: byte value(sizeof(name)) min(1); 47 | name: byte[olen]; 48 | |50:"RequestedIP" -> 49 | olen: byte const(4); 50 | ip: uint32; 51 | |51:"LeaseTime" -> 52 | olen: byte const(4); 53 | time: uint32; 54 | |53:"MessageType" -> 55 | olen: byte const(1); 56 | mtype: byte variant { 57 | |1 -> Discover |2 -> Offer |3 -> Request |4 -> Decline 58 | |5 -> Ack |6 -> Nak |7 -> Release |8 -> Inform }; 59 | |54:"ServerIdentifier" -> 60 | olen: byte const(4); 61 | id: uint32; 62 | |55:"ParameterRequest" -> 63 | olen: byte value(sizeof(params)); 64 | params: byte[olen]; 65 | |61:"ClientID" -> 66 | olen: byte value(sizeof(id)+1); 67 | htype: byte; 68 | id: byte[olen-1]; 69 | |57:"MaxSize" -> 70 | olen: byte const(2); 71 | size: uint16 min(576); 72 | |255:"End" -> (); 73 | }; 74 | } 75 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/style.css: -------------------------------------------------------------------------------- 1 | a:visited {color : #416DFF; text-decoration : none; } 2 | a:link {color : #416DFF; text-decoration : none;} 3 | a:hover {color : Red; text-decoration : none; background-color: #5FFF88} 4 | a:active {color : Red; text-decoration : underline; } 5 | .keyword { font-weight : bold ; color : Red } 6 | .keywordsign { color : #C04600 } 7 | .superscript { font-size : 4 } 8 | .subscript { font-size : 4 } 9 | .comment { color : Green } 10 | .constructor { color : Blue } 11 | .type { color : #5C6585 } 12 | .string { color : Maroon } 13 | .warning { color : Red ; font-weight : bold } 14 | .info { margin-left : 3em; margin-right : 3em } 15 | .code { color : #465F91 ; } 16 | h1 { font-size : 20pt ; text-align: center; } 17 | h2 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90BDFF ;padding: 2px; } 18 | h3 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90DDFF ;padding: 2px; } 19 | h4 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90EDFF ;padding: 2px; } 20 | h5 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90FDFF ;padding: 2px; } 21 | h6 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #C0FFFF ; padding: 2px; } 22 | div.h7 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #E0FFFF ; padding: 2px; } 23 | div.h8 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #F0FFFF ; padding: 2px; } 24 | div.h9 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #FFFFFF ; padding: 2px; } 25 | .typetable { border-style : hidden } 26 | .indextable { border-style : hidden } 27 | .paramstable { border-style : hidden ; padding: 5pt 5pt} 28 | body { background-color : White } 29 | tr { background-color : White } 30 | td.typefieldcomment { background-color : #FFFFFF } 31 | pre { margin-bottom: 4px } 32 | div.sig_block {margin-left: 2em} -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Block.mac.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Cryptokit.Block.mac 16 | 17 | 18 | 22 |

Class Cryptokit.Block.mac

23 |
24 |
class mac : ?iv:string -> ?pad:Cryptokit.Padding.scheme -> block_cipher -> Cryptokit.hash
Build a MAC (keyed hash function) from the given block cipher. 25 | The block cipher is run in CBC mode, and the MAC value is 26 | the final value of the initialization vector. 27 | Thus, the hash size of the resulting 28 | hash is the block size of the block cipher. 29 | The optional argument iv specifies the first initialization 30 | vector, with a default of all zeroes. The optional argument 31 | pad specifies a padding scheme to be applied to the input 32 | data; if not provided, no padding is performed.
33 |
34 | -------------------------------------------------------------------------------- /lib/dns/dns.mpl: -------------------------------------------------------------------------------- 1 | packet dns { 2 | id: uint16; 3 | qr: bit[1] variant { |0 -> Query |1 -> Answer }; 4 | opcode: bit[4] variant { |0 -> Query |1 -> IQuery |2 -> Status 5 | |3 -> Reserved |4 -> Notify |5 -> Update }; 6 | authoritative: bit[1]; 7 | truncation: bit[1]; 8 | rd: bit[1]; 9 | ra: bit[1]; 10 | zv: bit[3] const(0); 11 | rcode: bit[4] variant {|0 => NoError |1 -> FormErr 12 | |2 -> ServFail |3 -> NXDomain |4 -> NotImp |5 -> Refused 13 | |6 -> YXDomain |7 -> YXRRSet |8 -> NXRRSet |9 -> NotAuth 14 | |10 -> NotZone |16 -> BadVers |17 -> BadKey |18 -> BadTime 15 | |19 -> BadMode |20 -> BadName |21 -> BadAlg}; 16 | qdcount: uint16 value(array_length(questions)); 17 | ancount: uint16 value(array_length(answers)); 18 | nscount: uint16 value(array_length(authority)); 19 | arcount: uint16 value(array_length(additional)); 20 | questions: array (qdcount) { 21 | qname: dns_label; 22 | qtype: uint16 variant {|1 -> A |2 -> NS |3 -> MD |4 -> MF 23 | |5-> CNAME |6-> SOA |7 -> MB |8 -> MG |9 -> MR 24 | |10 -> NULL |11 -> WKS |12 -> PTR |13 -> HINFO 25 | |14 -> MINFO |15 -> MX |16 -> TXT |17 -> RP 26 | |18 -> AFSDB |19 -> X25 |20 -> ISDN |21 -> RT 27 | |22 -> NSAP |23 -> NSAP_PTR |24 -> SIG |25 -> KEY 28 | |26 -> PX |27 -> GPOS |28 -> AAAA |29 -> LOC 29 | |30 -> NXT |31 -> EID |32 -> NIMLOC |33 -> SRV 30 | |34 -> ATMA |35 -> NAPTR |36 -> KM |37 -> CERT 31 | |38 -> A6 |39 -> DNAME |40 -> SINK |41 -> OPT 32 | |42 -> APL |43 -> DS |44 -> SSHFP |45 -> IPSECKEY 33 | |46 -> RRSIG |47 -> NSEC |48 -> DNSKEY 34 | |99 -> SPF |100 -> UINFO |101 -> UID |102 -> GID 35 | |103 -> UNSPEC 36 | |252 -> AXFR |253 -> MAILB |254 -> MAILA |255 -> ANY 37 | |32768 -> TA |32769 -> DLV}; 38 | qclass: uint16 variant {|1 => IN |2 -> CSNET 39 | |3 -> CHAOS |4 -> HS |254 -> NONE |255 -> ANY}; 40 | }; 41 | answers: array (ancount) { 42 | rr: packet dns_rr(); 43 | }; 44 | authority: array (nscount) { 45 | rr: packet dns_rr(); 46 | }; 47 | additional: array (arcount) { 48 | rr: packet dns_rr(); 49 | }; 50 | } 51 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Block.block_cipher.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Cryptokit.Block.block_cipher 14 | 15 | 16 | 18 |

Class type Cryptokit.Block.block_cipher

19 |
20 |
class type block_cipher = object .. end
Abstract interface for a block cipher.
21 |
22 |
method blocksize : int
23 | The size in bytes of the blocks manipulated by the cipher.
24 |
25 |
method transform : string -> int -> string -> int -> unit
26 | transform src spos dst dpos encrypts or decrypts one block 27 | of data. The input data is read from string src at 28 | positions spos, ..., spos + blocksize - 1, and the output 29 | data is stored in string dst at positions 30 | dpos, ..., dpos + blocksize - 1.
31 |
32 |
method wipe : unit
33 | Erase the internal state of the block cipher, such as 34 | all key-dependent material.
35 |
36 | -------------------------------------------------------------------------------- /tools/spl/spl_cfg.mli: -------------------------------------------------------------------------------- 1 | (* 2 | * Copyright (c) 2005 Anil Madhavapeddy 3 | * 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | * 16 | * $Id: spl_cfg.mli,v 1.6 2006/02/09 17:44:52 avsm Exp $ 17 | *) 18 | 19 | type transition_method = 20 | | Condition of Spl_syntaxtree.expr 21 | | Message of Spl_syntaxtree.id 22 | | Assignment of (Spl_syntaxtree.id * Spl_syntaxtree.expr) 23 | | Terminate 24 | 25 | type transition_class = 26 | | T_handle 27 | | T_normal 28 | 29 | type state = { 30 | label : string; 31 | mutable edges : transition list; 32 | } 33 | and transition = { 34 | t : transition_method; 35 | target : state ref; 36 | cl : transition_class; 37 | loc : Spl_location.t option; 38 | } 39 | 40 | type env = { 41 | func_name : string; 42 | initial_state : state option ref; 43 | final_state : state option ref; 44 | blocks : (string, state) Hashtbl.t; 45 | registers : (Spl_syntaxtree.var_type, unit) Hashtbl.t; 46 | functions_called : (string, unit) Hashtbl.t; 47 | } 48 | 49 | type compiled_functions = (string, env * Spl_syntaxtree.func) Hashtbl.t 50 | 51 | type global_env = { 52 | filename : string; 53 | functions : compiled_functions; 54 | counter : int ref; 55 | mutable webpage: string; 56 | } 57 | 58 | exception Block_not_unique of string 59 | exception Unknown_variable of string 60 | exception Unknown_function of string 61 | exception Type_checking_invariant_failure 62 | val string_of_transition_class : transition_class -> string 63 | val initial_state_of_env : env -> state 64 | val final_state_of_env : env -> state 65 | val list_of_registers : env -> Spl_syntaxtree.var_type list 66 | val blocks_of_function : env -> compiled_functions -> state list 67 | val generate_states : string -> Spl_syntaxtree.func list -> global_env 68 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/type_Cryptokit.transform.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Cryptokit.transform 12 | 13 | 14 | object
15 |   method available_output : int
16 |   method finish : unit
17 |   method flush : unit
18 |   method get_byte : int
19 |   method get_char : char
20 |   method get_string : string
21 |   method get_substring : string * int * int
22 |   method input_block_size : int
23 |   method output_block_size : int
24 |   method put_byte : int -> unit
25 |   method put_char : char -> unit
26 |   method put_string : string -> unit
27 |   method put_substring : string -> int -> int -> unit
28 |   method wipe : unit
29 | end
-------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Hexa.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Cryptokit.Hexa 16 | 17 | 18 | 22 |

Module Cryptokit.Hexa

23 |
24 |
module Hexa: sig .. end
The Hexa module supports the encoding and decoding of 25 | binary data as hexadecimal strings. This is a popular format 26 | for transmitting keys in textual form.
27 |
28 |
val encode : unit -> Cryptokit.transform
29 | Return a transform that encodes its input in hexadecimal. 30 | The output is twice as long as the input, and contains 31 | no spaces or newlines.
32 |
33 |
val decode : unit -> Cryptokit.transform
34 | Return a transform that decodes its input from hexadecimal. 35 | The output is twice as short as the input. Blanks 36 | (spaces, tabs, newlines) in the input are ignored. 37 | Raise Error Bad_encoding if the input contains characters 38 | other than hexadecimal digits and blanks.
39 |
40 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/index_class_types.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Index of class types 13 | 14 | 15 |

Index of class types

16 | 17 | 18 | 19 | 23 | 24 | 25 | 30 | 31 | 32 | 36 | 37 | 38 | 42 | 43 | 47 | 48 | 49 | 54 |

B
block_cipher [Cryptokit.Block]
20 | Abstract interface for a block cipher. 21 |
22 |

H
hash [Cryptokit]
26 | A hash is a function that maps arbitrarily-long character 27 | sequences to small, fixed-size strings. 28 |
29 |

R
rng [Cryptokit.Random]
33 | Generic interface for a random number generator. 34 |
35 |

S
scheme [Cryptokit.Padding]
39 | Generic interface of a padding scheme. 40 |
41 |
stream_cipher [Cryptokit.Stream]
44 | Abstract interface for a stream cipher. 45 |
46 |

T
transform [Cryptokit]
50 | A transform is an arbitrary mapping from sequences of characters 51 | to sequences of characters. 52 |
53 |

55 | 56 | -------------------------------------------------------------------------------- /lib/config/config_lexer.mll: -------------------------------------------------------------------------------- 1 | (* 2 | * Copyright (c) 2006 Anil Madhavapeddy 3 | * 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | * 16 | *) 17 | 18 | { 19 | open Config_location 20 | open Config_parser 21 | exception Eof 22 | } 23 | 24 | let number = ['0'-'9']+ 25 | let ipv4 = ['0'-'9']+'.'['0'-'9']+'.'['0'-'9']+'.'['0'-'9']+ 26 | let variant = ['A'-'Z']['_''a'-'z''A'-'Z''0'-'9']* 27 | let identifier = ['a'-'z']['_''.''a'-'z''A'-'Z''0'-'9']* 28 | 29 | rule token = parse 30 | | [ ' ' '\t' ] { token lexbuf } 31 | | [ '\n' ] { new_line lexbuf; token lexbuf } 32 | | ';' { SEMICOLON(next_token lexbuf) } 33 | | ',' { COMMA(next_token lexbuf) } 34 | | '[' { LBRACKET(next_token lexbuf) } 35 | | ']' { RBRACKET(next_token lexbuf) } 36 | | '=' { EQUALS(next_token lexbuf) } 37 | | "true" { TRUE(next_token lexbuf) } 38 | | "false" { FALSE(next_token lexbuf) } 39 | | identifier { IDENTIFIER(Lexing.lexeme lexbuf, next_token lexbuf) } 40 | | variant { VARIANT(Lexing.lexeme lexbuf, next_token lexbuf) } 41 | | number { INT(int_of_string (Lexing.lexeme lexbuf), next_token lexbuf) } 42 | | ipv4 { STRING(Lexing.lexeme lexbuf, next_token lexbuf) } 43 | | "/*" { ignore(comment lexbuf); token lexbuf } 44 | | "//" { ignore(single_comment lexbuf); token lexbuf } 45 | | "#" { ignore(single_comment lexbuf); token lexbuf } 46 | | "\"" { string_e (Buffer.create 128) lexbuf } 47 | | eof { EOF(next_token lexbuf) } 48 | 49 | and comment = parse 50 | | "/*" { ignore(comment lexbuf); comment lexbuf } 51 | | "*/" { true } 52 | | '\n' { ignore(new_line lexbuf); comment lexbuf } 53 | | _ { comment lexbuf } 54 | 55 | and single_comment = parse 56 | | '\n' { new_line lexbuf; true } 57 | | _ { single_comment lexbuf } 58 | 59 | and string_e s = parse 60 | | '\"' { STRING(Buffer.contents s, next_token lexbuf) } 61 | | _ as x { Buffer.add_char s x; string_e s lexbuf } 62 | -------------------------------------------------------------------------------- /lib/ssh/ssh_version.ml: -------------------------------------------------------------------------------- 1 | (*pp cpp *) 2 | (* 3 | * Copyright (c) 2006 Anil Madhavapeddy 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 | open Printf 20 | open Ssh_utils 21 | 22 | type t = { raw: string option; (* needed for KEXDH_REPLY signature hash *) 23 | protoversion: string; 24 | softwareversion: string } 25 | 26 | let to_string p = 27 | match p.raw with 28 | |None -> sprintf "SSH-%s-%s" p.protoversion p.softwareversion 29 | |Some x -> x 30 | 31 | exception Parse_failure 32 | 33 | (* Read version character by character. Cant use channels due to buffering *) 34 | let read_version_line ofd = 35 | let buf = String.create 256 in 36 | let ver = ref "" in 37 | let off = ref 0 in 38 | let got_nl = ref false in 39 | while not (!got_nl) do 40 | ofd#read buf !off 1; 41 | match String.get buf !off with 42 | |'\n' -> 43 | (* newline is here, so stop reading *) 44 | got_nl := true; 45 | ver := String.sub buf 0 !off 46 | |'\r' -> 47 | (* just discard this, as it will be followed by a newline *) 48 | () 49 | |_ -> incr off 50 | done; 51 | !ver 52 | 53 | let unmarshal ofd = 54 | let str = read_version_line ofd in 55 | prerr_endline (sprintf "Remote version is: %s" str); 56 | (* It should be in form SSH-protoversion-softwareversioncomments *) 57 | if String.sub str 0 4 <> "SSH-" 58 | then raise Parse_failure; 59 | let str' = String.sub str 4 (String.length str - 4) in 60 | let other_dash = 61 | try String.index str' '-' 62 | with Not_found -> raise Parse_failure in 63 | let proto = String.sub str' 0 (other_dash - 1) in 64 | let software = String.sub str' (other_dash + 1) (String.length str' - other_dash - 1) in 65 | { raw = Some str; protoversion = proto; softwareversion = software } 66 | -------------------------------------------------------------------------------- /apps/deens/test.zone: -------------------------------------------------------------------------------- 1 | 2 | ; <<>> DiG 9.2.5 <<>> phlegethon.org axfr +vc @bright.asuk.net 3 | ; (1 server found) 4 | ;; global options: printcmd 5 | $ORIGIN example.com. 6 | $TTL 604800 7 | 8 | ;; SOA, including parentheses and comments and an embedded dot 9 | example.com. 604800 IN SOA ( 10 | ns0.example.com. john\.doe.example.com. 1136975101 ; hello! 11 | 3600 1800 3024000 1800 12 | ) 13 | 14 | ;; Various ways of expressing RRs 15 | example.com. 604800 IN MX 10 mail.example.com. 16 | @ 604800 IN MX 20 bright.isp.net. 17 | 604800 IN MX 30 newton.isp.net. 18 | example.com. IN 604800 NS ns0 19 | exam\112le.com. IN NS ns.isp.net. 20 | eXaMpLe.CoM. 604800 NS ns2.isp.net. 21 | example.com. NS ns3.isp.net. 22 | NS ns4.isp.net. 23 | mail 172800 IN A 127.0.0.94 24 | lists.example.com. 604800 IN MX 10 mail.example.com. 25 | lists.example.com. 172800 IN A 127.0.0.94 26 | ns0.example.com. 172800 IN A 127.0.0.94 27 | www.example.com. 172800 IN A 127.0.0.94 28 | uk. 1000 IN NS ns1.nic.uk. 29 | 30 | ;; Multi-label name: two.one and one will "exist" with no RRs 31 | three.two.one A 127.3.2.1 32 | 33 | ;; Delegation 34 | delegated IN NS ns1.elsewhere.com. 35 | delegated IN NS ns2.elsewhere.com. 36 | delegated IN NS ns3.elsewhere.com. 37 | 38 | ;; CNAMES, and a CNAME loop 39 | real IN TXT "Hello, world!" 40 | alias IN CNAME real 41 | one.loop IN CNAME two.loop 42 | two.loop IN CNAME three.loop 43 | three.loop IN CNAME four.loop 44 | four.loop IN CNAME one.loop 45 | 46 | ;; One of everything we support 47 | types IN A 127.0.0.1 48 | IN MD md-target 49 | IN MF mf-target 50 | IN NS ns-target 51 | ;; Not CNAME! 52 | IN SOA master owner 2006031301 3600 1800 302400 1800 53 | IN MB mb-target 54 | IN MG mg-target 55 | IN MR mr-target 56 | IN WKS 127.0.0.1 udp domain ntp 1600 57 | IN WKS 127.0.0.1 6 22 25 chargen 58 | IN PTR ptr-target 59 | IN HINFO "CPU" "Operating \"System\"" 60 | IN MINFO rmailbx emailbx 61 | IN MX 0 mx-target-0 62 | IN MX 10 mx-target-10 63 | IN MX 65535 mx-target-65535 64 | IN TXT "TXT RR 1" 65 | IN TXT "TXT RR 2" "(haha!)" 66 | IN RP rp-mbox rp-txt 67 | IN AFSDB 12 afsdb-target 68 | IN X25 12345678 69 | IN ISDN 150862028003217 70 | IN ISDN 150862028003217 004 71 | IN RT 1 rt-target-1 72 | IN SRV 1 0 9 srv-target 73 | IN AAAA 1080:0:0:0:8:800:200C:417A 74 | IN AAAA FF01::101 75 | IN AAAA 1:: 76 | IN AAAA ::1 77 | IN AAAA :: 78 | IN AAAA ::13.1.68.3 79 | IN AAAA 0:0:0:0:0:FFFF:129.144.52.38 80 | ;; Dig's UNSPEC output is a wierd checksummed thing :( 81 | IN UNSPEC \# 7 55 6E73 706563 21 82 | -------------------------------------------------------------------------------- /lib/ounix/olog.ml: -------------------------------------------------------------------------------- 1 | (*pp cpp *) 2 | (* 3 | * Copyright (c) 2005,2006 Anil Madhavapeddy 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 | open Printf 20 | 21 | type level = |Debug |Warning |Info |Critical 22 | 23 | class virtual base_log = object(self) 24 | method virtual debug : string -> unit 25 | method virtual warning : string -> unit 26 | method virtual info : string -> unit 27 | method virtual critical : string -> unit 28 | method virtual init : unit 29 | 30 | val mutable dl = Debug 31 | method private set_level x = dl <- x 32 | method set_debug = self#set_level Debug 33 | method set_warning = self#set_level Warning 34 | method set_info = self#set_level Info 35 | method set_critical = self#set_level Critical 36 | 37 | method debug_active = match dl with 38 | |Debug -> true |Warning|Info|Critical -> false 39 | method warning_active = match dl with 40 | |Debug|Warning -> true |Info|Critical -> false 41 | method info_active = match dl with 42 | |Debug|Warning|Info -> true |Critical -> false 43 | method critical_active = true 44 | end 45 | 46 | class stderr_log = 47 | let outputfn x = prerr_endline x in 48 | object(self) 49 | inherit base_log as base 50 | method init = self#info "started stderr_log" 51 | 52 | method debug x = 53 | outputfn (sprintf "{debug} %s" x) 54 | method warning x = 55 | outputfn (sprintf "{warning} %s" x) 56 | method info x = 57 | outputfn (sprintf "{info} %s" x) 58 | method critical x = 59 | outputfn (sprintf "{critical} %s" x) 60 | end 61 | 62 | class null_log = object(self) 63 | inherit base_log 64 | method init = () 65 | method debug x = () 66 | method warning x = () 67 | method info x = () 68 | method critical x = () 69 | end 70 | 71 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Zlib.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Cryptokit.Zlib 15 | 16 | 17 | 20 |

Module Cryptokit.Zlib

21 |
22 |
module Zlib: sig .. end
The Zlib module supports the compression and decompression 23 | of data, using the zlib library. The algorithm used is 24 | Lempel-Ziv compression as in the gzip and zip compressors. 25 | While compression itself is not encryption, it is often used prior 26 | to encryption to hide regularities in the plaintext, and reduce 27 | the size of the ciphertext.
28 |
29 |
val compress : ?level:int -> unit -> Cryptokit.transform
30 | Return a transform that compresses its input. 31 | The optional level argument is an integer between 1 and 9 32 | specifying how hard the transform should try to compress data: 33 | 1 is lowest but fastest compression, while 9 is highest but 34 | slowest compression. The default level is 6.
35 |
36 |
val uncompress : unit -> Cryptokit.transform
37 | Return a transform that decompresses its input.
38 |
39 | -------------------------------------------------------------------------------- /lib/config/config_parser.mly: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006 Anil Madhavapeddy 3 | * 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | * 16 | */ 17 | 18 | %{ 19 | open Config_location 20 | open Config_t 21 | open Printf 22 | 23 | let parse_error msg = 24 | raise (Syntax_error !Config_location.current_location) 25 | 26 | let id (x,_) = x 27 | let loc (_,x) = x 28 | 29 | %} 30 | 31 | %token EOL EOF TRUE FALSE 32 | %token SEMICOLON COMMA LBRACKET RBRACKET EQUALS 33 | %token IDENTIFIER STRING VARIANT 34 | %token INT 35 | 36 | %start main 37 | %type main 38 | %% 39 | main: 40 | | config_lines EOF { $1 } 41 | ; 42 | config_lines: 43 | | config_line config_lines { $1 :: $2 } 44 | | config_line { [$1] } 45 | ; 46 | config_line: 47 | | IDENTIFIER EQUALS config_value SEMICOLON { 48 | {Config_t.v_name=(id $1); v_ty=Config_t.null_var_type; v_val=$3; v_loc=(loc $1)} 49 | } 50 | | IDENTIFIER EQUALS LBRACKET config_list_values RBRACKET SEMICOLON { 51 | {Config_t.v_name=(id $1); v_ty=Config_t.null_var_type; v_val=$4; v_loc=(loc $1)} 52 | } 53 | ; 54 | config_value: 55 | | TRUE { Config_t.V_boolean true } 56 | | FALSE { Config_t.V_boolean false } 57 | | STRING { Config_t.V_string (id $1) } 58 | | INT { Config_t.V_int (id $1) } 59 | | VARIANT { Config_t.V_variant (id $1) } 60 | ; 61 | config_list_values: 62 | | { Config_t.V_empty_list } 63 | | config_variant_list { Config_t.V_variant_list $1 } 64 | | config_string_list { Config_t.V_string_list $1 } 65 | | config_int_list { Config_t.V_int_list $1 } 66 | ; 67 | config_variant_list: 68 | | VARIANT { [id $1] } 69 | | VARIANT COMMA config_variant_list { id $1 :: $3 } 70 | ; 71 | config_string_list: 72 | | STRING { [id $1] } 73 | | STRING COMMA config_string_list { id $1 :: $3 } 74 | ; 75 | config_int_list: 76 | | INT { [id $1] } 77 | | INT COMMA config_int_list { id $1 :: $3 } 78 | ; 79 | -------------------------------------------------------------------------------- /dist/cryptokit/doc/Cryptokit.Block.mac_final_triple.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Cryptokit.Block.mac_final_triple 16 | 17 | 18 | 22 |

Class Cryptokit.Block.mac_final_triple

23 |
24 |
class mac_final_triple : ?iv:string -> ?pad:Cryptokit.Padding.scheme -> block_cipher -> block_cipher -> block_cipher -> Cryptokit.hash
Build a MAC (keyed hash function) from the given block ciphers 25 | c1, c2 and c3. The input is run through c1 in CBC 26 | mode, as described for Cryptokit.Block.mac. The final 27 | initialization vector is then super-enciphered by c2, then 28 | by c3, to provide the final MAC. This construction results 29 | in a MAC that is as nearly as fast as Cryptokit.Block.mac 30 | c1, but more resistant against brute-force key search 31 | because of the additional final encryption through c2 and 32 | c3.
33 |
34 | --------------------------------------------------------------------------------