From 8eab8d1da8c4a9ae2f63b1dae9b719f3070daf32 Mon Sep 17 00:00:00 2001 From: Soner Tari Date: Thu, 26 Mar 2020 21:38:38 +0300 Subject: [PATCH] Restructure source tree, create src and tests folders, move files accordingly Remove docker --- .gitignore | 10 ++-- GNUmakefile | 46 +++++++++--------- docker/sslproxy/Dockerfile | 17 ------- attrib.h => src/attrib.h | 0 base64.c => src/base64.c | 0 base64.h => src/base64.h | 0 build.c => src/build.c | 0 build.h => src/build.h | 0 cache.c => src/cache.c | 0 cache.h => src/cache.h | 0 cachedsess.c => src/cachedsess.c | 0 cachedsess.h => src/cachedsess.h | 0 cachefkcrt.c => src/cachefkcrt.c | 0 cachefkcrt.h => src/cachefkcrt.h | 0 cachemgr.c => src/cachemgr.c | 0 cachemgr.h => src/cachemgr.h | 0 cachessess.c => src/cachessess.c | 0 cachessess.h => src/cachessess.h | 0 cachetgcrt.c => src/cachetgcrt.c | 0 cachetgcrt.h => src/cachetgcrt.h | 0 cert.c => src/cert.c | 0 cert.h => src/cert.h | 0 defaults.h => src/defaults.h | 0 dynbuf.c => src/dynbuf.c | 0 dynbuf.h => src/dynbuf.h | 0 khash.h => src/khash.h | 0 log.c => src/log.c | 0 log.h => src/log.h | 0 logbuf.c => src/logbuf.c | 0 logbuf.h => src/logbuf.h | 0 logger.c => src/logger.c | 0 logger.h => src/logger.h | 0 logpkt.c => src/logpkt.c | 0 logpkt.h => src/logpkt.h | 0 main.c => src/main.c | 0 nat.c => src/nat.c | 0 nat.h => src/nat.h | 0 opts.c => src/opts.c | 0 opts.h => src/opts.h | 0 privsep.c => src/privsep.c | 0 privsep.h => src/privsep.h | 0 proc.c => src/proc.c | 0 proc.h => src/proc.h | 0 protoautossl.c => src/protoautossl.c | 0 protoautossl.h => src/protoautossl.h | 0 protohttp.c => src/protohttp.c | 0 protohttp.h => src/protohttp.h | 0 protopassthrough.c => src/protopassthrough.c | 0 protopassthrough.h => src/protopassthrough.h | 0 protopop3.c => src/protopop3.c | 0 protopop3.h => src/protopop3.h | 0 protosmtp.c => src/protosmtp.c | 0 protosmtp.h => src/protosmtp.h | 0 protossl.c => src/protossl.c | 0 protossl.h => src/protossl.h | 0 prototcp.c => src/prototcp.c | 0 prototcp.h => src/prototcp.h | 0 proxy.c => src/proxy.c | 0 proxy.h => src/proxy.h | 0 pxyconn.c => src/pxyconn.c | 0 pxyconn.h => src/pxyconn.h | 0 pxysslshut.c => src/pxysslshut.c | 0 pxysslshut.h => src/pxysslshut.h | 0 pxythrmgr.c => src/pxythrmgr.c | 0 pxythrmgr.h => src/pxythrmgr.h | 0 ssl.c => src/ssl.c | 0 ssl.h => src/ssl.h | 0 sslproxy.1 => src/sslproxy.1 | 0 sslproxy.conf => src/sslproxy.conf | 0 sslproxy.conf.5 => src/sslproxy.conf.5 | 0 sys.c => src/sys.c | 0 sys.h => src/sys.h | 0 thrqueue.c => src/thrqueue.c | 0 thrqueue.h => src/thrqueue.h | 0 url.c => src/url.c | 0 url.h => src/url.h | 0 util.c => src/util.c | 0 util.h => src/util.h | 0 base64.t.c => tests/check/base64.t.c | 0 cachedsess.t.c => tests/check/cachedsess.t.c | 0 cachefkcrt.t.c => tests/check/cachefkcrt.t.c | 0 cachemgr.t.c => tests/check/cachemgr.t.c | 0 cachessess.t.c => tests/check/cachessess.t.c | 0 cachetgcrt.t.c => tests/check/cachetgcrt.t.c | 0 cert.t.c => tests/check/cert.t.c | 0 defaults.t.c => tests/check/defaults.t.c | 0 dynbuf.t.c => tests/check/dynbuf.t.c | 0 logbuf.t.c => tests/check/logbuf.t.c | 0 main.t.c => tests/check/main.t.c | 0 opts.t.c => tests/check/opts.t.c | 0 pxythrmgr.t.c => tests/check/pxythrmgr.t.c | 0 ssl.t.c => tests/check/ssl.t.c | 0 sys.t.c => tests/check/sys.t.c | 0 url.t.c => tests/check/url.t.c | 0 util.t.c => tests/check/util.t.c | 0 {extra => tests}/testproxy/ca.crt | 0 {extra => tests}/testproxy/ca.key | 0 {extra => tests}/testproxy/ca2.crt | 0 {extra => tests}/testproxy/ca2.key | 0 {extra => tests}/testproxy/ca_testset_1.json | 0 {extra => tests}/testproxy/ca_testset_2.json | 0 .../testproxy/http_testset_1.json | 0 .../testproxy/http_testset_2.json | 0 .../testproxy/http_testset_3.json | 0 .../testproxy/passthrough_testset_1.json | 0 .../payload_ocsp_denied_response.bin | 0 .../testproxy/proto_validate_testset_1.json | 0 .../testproxy/proto_validate_testset_2.json | 0 {extra => tests}/testproxy/server.crt | 0 {extra => tests}/testproxy/server.key | 0 {extra => tests}/testproxy/server2.crt | 0 {extra => tests}/testproxy/server2.key | 0 .../testproxy/ssl_tcp_testends_testset_1.json | 0 {extra => tests}/testproxy/ssl_testset_1.json | 0 {extra => tests}/testproxy/ssl_testset_2.json | 0 {extra => tests}/testproxy/ssl_testset_3.json | 0 {extra => tests}/testproxy/ssl_testset_4.json | 0 {extra => tests}/testproxy/ssl_testset_5.json | 0 {extra => tests}/testproxy/sslproxy.conf | 0 .../testproxy/tcp_ssl_testends_testset_1.json | 0 {extra => tests}/testproxy/testharness.json | 0 .../testproxy/userauth_testset_1.json | 0 .../testproxy/userauth_testset_2.json | 0 {extra => tests}/testproxy/users.db | Bin .../testproxy/verifypeer_testset_1.json | 0 .../testproxy/verifypeer_testset_2.json | 0 126 files changed, 30 insertions(+), 43 deletions(-) delete mode 100644 docker/sslproxy/Dockerfile rename attrib.h => src/attrib.h (100%) rename base64.c => src/base64.c (100%) rename base64.h => src/base64.h (100%) rename build.c => src/build.c (100%) rename build.h => src/build.h (100%) rename cache.c => src/cache.c (100%) rename cache.h => src/cache.h (100%) rename cachedsess.c => src/cachedsess.c (100%) rename cachedsess.h => src/cachedsess.h (100%) rename cachefkcrt.c => src/cachefkcrt.c (100%) rename cachefkcrt.h => src/cachefkcrt.h (100%) rename cachemgr.c => src/cachemgr.c (100%) rename cachemgr.h => src/cachemgr.h (100%) rename cachessess.c => src/cachessess.c (100%) rename cachessess.h => src/cachessess.h (100%) rename cachetgcrt.c => src/cachetgcrt.c (100%) rename cachetgcrt.h => src/cachetgcrt.h (100%) rename cert.c => src/cert.c (100%) rename cert.h => src/cert.h (100%) rename defaults.h => src/defaults.h (100%) rename dynbuf.c => src/dynbuf.c (100%) rename dynbuf.h => src/dynbuf.h (100%) rename khash.h => src/khash.h (100%) rename log.c => src/log.c (100%) rename log.h => src/log.h (100%) rename logbuf.c => src/logbuf.c (100%) rename logbuf.h => src/logbuf.h (100%) rename logger.c => src/logger.c (100%) rename logger.h => src/logger.h (100%) rename logpkt.c => src/logpkt.c (100%) rename logpkt.h => src/logpkt.h (100%) rename main.c => src/main.c (100%) rename nat.c => src/nat.c (100%) rename nat.h => src/nat.h (100%) rename opts.c => src/opts.c (100%) rename opts.h => src/opts.h (100%) rename privsep.c => src/privsep.c (100%) rename privsep.h => src/privsep.h (100%) rename proc.c => src/proc.c (100%) rename proc.h => src/proc.h (100%) rename protoautossl.c => src/protoautossl.c (100%) rename protoautossl.h => src/protoautossl.h (100%) rename protohttp.c => src/protohttp.c (100%) rename protohttp.h => src/protohttp.h (100%) rename protopassthrough.c => src/protopassthrough.c (100%) rename protopassthrough.h => src/protopassthrough.h (100%) rename protopop3.c => src/protopop3.c (100%) rename protopop3.h => src/protopop3.h (100%) rename protosmtp.c => src/protosmtp.c (100%) rename protosmtp.h => src/protosmtp.h (100%) rename protossl.c => src/protossl.c (100%) rename protossl.h => src/protossl.h (100%) rename prototcp.c => src/prototcp.c (100%) rename prototcp.h => src/prototcp.h (100%) rename proxy.c => src/proxy.c (100%) rename proxy.h => src/proxy.h (100%) rename pxyconn.c => src/pxyconn.c (100%) rename pxyconn.h => src/pxyconn.h (100%) rename pxysslshut.c => src/pxysslshut.c (100%) rename pxysslshut.h => src/pxysslshut.h (100%) rename pxythrmgr.c => src/pxythrmgr.c (100%) rename pxythrmgr.h => src/pxythrmgr.h (100%) rename ssl.c => src/ssl.c (100%) rename ssl.h => src/ssl.h (100%) rename sslproxy.1 => src/sslproxy.1 (100%) rename sslproxy.conf => src/sslproxy.conf (100%) rename sslproxy.conf.5 => src/sslproxy.conf.5 (100%) rename sys.c => src/sys.c (100%) rename sys.h => src/sys.h (100%) rename thrqueue.c => src/thrqueue.c (100%) rename thrqueue.h => src/thrqueue.h (100%) rename url.c => src/url.c (100%) rename url.h => src/url.h (100%) rename util.c => src/util.c (100%) rename util.h => src/util.h (100%) rename base64.t.c => tests/check/base64.t.c (100%) rename cachedsess.t.c => tests/check/cachedsess.t.c (100%) rename cachefkcrt.t.c => tests/check/cachefkcrt.t.c (100%) rename cachemgr.t.c => tests/check/cachemgr.t.c (100%) rename cachessess.t.c => tests/check/cachessess.t.c (100%) rename cachetgcrt.t.c => tests/check/cachetgcrt.t.c (100%) rename cert.t.c => tests/check/cert.t.c (100%) rename defaults.t.c => tests/check/defaults.t.c (100%) rename dynbuf.t.c => tests/check/dynbuf.t.c (100%) rename logbuf.t.c => tests/check/logbuf.t.c (100%) rename main.t.c => tests/check/main.t.c (100%) rename opts.t.c => tests/check/opts.t.c (100%) rename pxythrmgr.t.c => tests/check/pxythrmgr.t.c (100%) rename ssl.t.c => tests/check/ssl.t.c (100%) rename sys.t.c => tests/check/sys.t.c (100%) rename url.t.c => tests/check/url.t.c (100%) rename util.t.c => tests/check/util.t.c (100%) rename {extra => tests}/testproxy/ca.crt (100%) rename {extra => tests}/testproxy/ca.key (100%) rename {extra => tests}/testproxy/ca2.crt (100%) rename {extra => tests}/testproxy/ca2.key (100%) rename {extra => tests}/testproxy/ca_testset_1.json (100%) rename {extra => tests}/testproxy/ca_testset_2.json (100%) rename {extra => tests}/testproxy/http_testset_1.json (100%) rename {extra => tests}/testproxy/http_testset_2.json (100%) rename {extra => tests}/testproxy/http_testset_3.json (100%) rename {extra => tests}/testproxy/passthrough_testset_1.json (100%) rename {extra => tests}/testproxy/payload_ocsp_denied_response.bin (100%) rename {extra => tests}/testproxy/proto_validate_testset_1.json (100%) rename {extra => tests}/testproxy/proto_validate_testset_2.json (100%) rename {extra => tests}/testproxy/server.crt (100%) rename {extra => tests}/testproxy/server.key (100%) rename {extra => tests}/testproxy/server2.crt (100%) rename {extra => tests}/testproxy/server2.key (100%) rename {extra => tests}/testproxy/ssl_tcp_testends_testset_1.json (100%) rename {extra => tests}/testproxy/ssl_testset_1.json (100%) rename {extra => tests}/testproxy/ssl_testset_2.json (100%) rename {extra => tests}/testproxy/ssl_testset_3.json (100%) rename {extra => tests}/testproxy/ssl_testset_4.json (100%) rename {extra => tests}/testproxy/ssl_testset_5.json (100%) rename {extra => tests}/testproxy/sslproxy.conf (100%) rename {extra => tests}/testproxy/tcp_ssl_testends_testset_1.json (100%) rename {extra => tests}/testproxy/testharness.json (100%) rename {extra => tests}/testproxy/userauth_testset_1.json (100%) rename {extra => tests}/testproxy/userauth_testset_2.json (100%) rename {extra => tests}/testproxy/users.db (100%) rename {extra => tests}/testproxy/verifypeer_testset_1.json (100%) rename {extra => tests}/testproxy/verifypeer_testset_2.json (100%) diff --git a/.gitignore b/.gitignore index 0adad29..e5d3904 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ -/*.o -/*.dSYM -/sslproxy -/sslproxy.test +/src/*.o +/tests/check/*.o +/src/*.dSYM +/tests/check/*.dSYM +/src/sslproxy +/tests/check/sslproxy.test /extra/*.pyc /extra/engine/*.dylib /extra/engine/*.so diff --git a/GNUmakefile b/GNUmakefile index 9911f4b..3c19f5f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -232,7 +232,6 @@ CPPCHECK?= cppcheck GPG?= gpg GIT?= git WGET?= wget -DOCKER?= docker BZIP2?= bzip2 COL?= col @@ -243,18 +242,21 @@ TAR?= tar ### You should not need to touch anything below this line +SRCDIR:= src +CHECKTESTSDIR:= tests/check + PKGLABEL:= SSLproxy PKGNAME:= sslproxy TARGET:= $(PKGNAME) -SRCS:= $(filter-out $(wildcard *.t.c),$(wildcard *.c)) +SRCS:= $(filter-out $(wildcard $(CHECKTESTSDIR)/*.t.c),$(wildcard $(SRCDIR)/*.c)) HDRS:= $(wildcard *.h) OBJS:= $(SRCS:.c=.o) MKFS= $(wildcard GNUmakefile Mk/*.mk) FEATURES:= $(sort $(FEATURES)) -TSRCS:= $(wildcard *.t.c) +TSRCS:= $(wildcard $(CHECKTESTSDIR)/*.t.c) TOBJS:= $(TSRCS:.t.c=.t.o) -TOBJS+= $(filter-out main.o,$(OBJS)) +TOBJS+= $(filter-out $(SRCDIR)/main.o,$(OBJS)) include Mk/buildinfo.mk VERSION:= $(BUILD_VERSION) @@ -484,18 +486,18 @@ $(info uname -a: $(shell uname -a)) $(info ------------------------------------------------------------------------------) endif -all: $(TARGET) +all: $(SRCDIR)/$(TARGET) -$(TARGET).test: $(TOBJS) +$(CHECKTESTSDIR)/$(TARGET).test: $(TOBJS) $(CC) $(LDFLAGS) $(TPKG_LDFLAGS) -o $@ $^ $(LIBS) $(TPKG_LIBS) -$(TARGET): $(OBJS) +$(SRCDIR)/$(TARGET): $(OBJS) $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) -build.o: CPPFLAGS+=$(BUILD_CPPFLAGS) -build.o: build.c FORCE +$(SRCDIR)/build.o: CPPFLAGS+=$(BUILD_CPPFLAGS) +$(SRCDIR)/build.o: $(SRCDIR)/build.c FORCE -%.t.o: %.t.c $(HDRS) $(MKFS) +$(CHECKTESTSDIR)/%.t.o: $(CHECKTESTSDIR)/%.t.c $(SRCDIR)/$(HDRS) $(MKFS) ifdef CHECK_MISSING $(error unit test dependency 'check' not found; \ install it or point CHECK_BASE to base path) @@ -503,28 +505,33 @@ endif $(CC) -c $(CPPFLAGS) $(TCPPFLAGS) $(CFLAGS) $(TPKG_CFLAGS) -o $@ \ -x c $< -%.o: %.c $(HDRS) $(MKFS) +$(SRCDIR)/%.o: $(SRCDIR)/%.c $(SRCDIR)/$(HDRS) $(MKFS) $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< buildtest: TCPPFLAGS+=-D"TEST_ZEROUSR=\"$(shell id -u -n root||echo 0)\"" buildtest: TCPPFLAGS+=-D"TEST_ZEROGRP=\"$(shell id -g -n root||echo 0)\"" -buildtest: $(TARGET).test +buildtest: TCPPFLAGS+=-I$(SRCDIR) +buildtest: $(CHECKTESTSDIR)/$(TARGET).test $(MAKE) -C extra/engine $(MAKE) -C extra/pki testreqs test: buildtest - ./$(TARGET).test + ./$(CHECKTESTSDIR)/$(TARGET).test sudotest: buildtest - sudo ./$(TARGET).test + sudo ./$(CHECKTESTSDIR)/$(TARGET).test travis: TCPPFLAGS+=-DTRAVIS travis: test clean: $(MAKE) -C extra/engine clean - $(RM) -f $(TARGET) $(TARGET).test *.o .*.o *.core *~ - $(RM) -rf *.dSYM + $(RM) -f $(SRCDIR)/$(TARGET) $(CHECKTESTSDIR)/$(TARGET).test \ + $(SRCDIR)/*.o $(CHECKTESTSDIR)/*.o \ + $(SRCDIR)/.*.o $(CHECKTESTSDIR)/.*.o \ + $(SRCDIR)/*.core $(CHECKTESTSDIR)/*.core \ + $(SRCDIR)/*~ $(CHECKTESTSDIR)/*~ + $(RM) -rf $(SRCDIR)/*.dSYM $(CHECKTESTSDIR)/*.dSYM install: $(TARGET) test -d $(DESTDIR)$(PREFIX)/bin || $(MKDIR) -p $(DESTDIR)$(PREFIX)/bin @@ -619,14 +626,9 @@ realclean: distclean manclean clean $(MAKE) -C extra/pki clean endif -docker: - $(DOCKER) build -f docker/sslproxy/Dockerfile --target builder -t sslproxy-builder:$(VERSION) . - $(DOCKER) build -f docker/sslproxy/Dockerfile --target production -t sslproxy:$(VERSION) . - $(DOCKER) run sslproxy:$(VERSION) - FORCE: .PHONY: all config clean buildtest test sudotest travis lint \ install deinstall copyright manlint mantest man manclean fetchdeps \ - dist disttest distclean realclean docker + dist disttest distclean realclean diff --git a/docker/sslproxy/Dockerfile b/docker/sslproxy/Dockerfile deleted file mode 100644 index df10eae..0000000 --- a/docker/sslproxy/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM alpine:3.8 as builder -RUN apk add --no-cache fts libressl libevent libpcap libnet -RUN apk add --no-cache libressl-dev libevent-dev libpcap-dev libnet-dev check-dev libc-dev fts-dev linux-headers gcc make git -COPY . /opt/sslproxy -WORKDIR /opt/sslproxy -ENV LIBS -lfts -ENV TCPPFLAGS -DDOCKER -RUN export SOURCE_DATE_EPOCH=$(stat -c '%Y' *.c *.h|sort -r|head -1); make clean && make all test - -FROM alpine:3.8 as production -RUN apk add --no-cache fts libressl libevent libpcap libnet -WORKDIR /root/ -COPY --from=builder /opt/sslproxy/sslproxy /usr/local/bin/sslproxy -#EXPOSE 80 443 -ENTRYPOINT [ "sslproxy" ] -CMD [ "-V" ] - diff --git a/attrib.h b/src/attrib.h similarity index 100% rename from attrib.h rename to src/attrib.h diff --git a/base64.c b/src/base64.c similarity index 100% rename from base64.c rename to src/base64.c diff --git a/base64.h b/src/base64.h similarity index 100% rename from base64.h rename to src/base64.h diff --git a/build.c b/src/build.c similarity index 100% rename from build.c rename to src/build.c diff --git a/build.h b/src/build.h similarity index 100% rename from build.h rename to src/build.h diff --git a/cache.c b/src/cache.c similarity index 100% rename from cache.c rename to src/cache.c diff --git a/cache.h b/src/cache.h similarity index 100% rename from cache.h rename to src/cache.h diff --git a/cachedsess.c b/src/cachedsess.c similarity index 100% rename from cachedsess.c rename to src/cachedsess.c diff --git a/cachedsess.h b/src/cachedsess.h similarity index 100% rename from cachedsess.h rename to src/cachedsess.h diff --git a/cachefkcrt.c b/src/cachefkcrt.c similarity index 100% rename from cachefkcrt.c rename to src/cachefkcrt.c diff --git a/cachefkcrt.h b/src/cachefkcrt.h similarity index 100% rename from cachefkcrt.h rename to src/cachefkcrt.h diff --git a/cachemgr.c b/src/cachemgr.c similarity index 100% rename from cachemgr.c rename to src/cachemgr.c diff --git a/cachemgr.h b/src/cachemgr.h similarity index 100% rename from cachemgr.h rename to src/cachemgr.h diff --git a/cachessess.c b/src/cachessess.c similarity index 100% rename from cachessess.c rename to src/cachessess.c diff --git a/cachessess.h b/src/cachessess.h similarity index 100% rename from cachessess.h rename to src/cachessess.h diff --git a/cachetgcrt.c b/src/cachetgcrt.c similarity index 100% rename from cachetgcrt.c rename to src/cachetgcrt.c diff --git a/cachetgcrt.h b/src/cachetgcrt.h similarity index 100% rename from cachetgcrt.h rename to src/cachetgcrt.h diff --git a/cert.c b/src/cert.c similarity index 100% rename from cert.c rename to src/cert.c diff --git a/cert.h b/src/cert.h similarity index 100% rename from cert.h rename to src/cert.h diff --git a/defaults.h b/src/defaults.h similarity index 100% rename from defaults.h rename to src/defaults.h diff --git a/dynbuf.c b/src/dynbuf.c similarity index 100% rename from dynbuf.c rename to src/dynbuf.c diff --git a/dynbuf.h b/src/dynbuf.h similarity index 100% rename from dynbuf.h rename to src/dynbuf.h diff --git a/khash.h b/src/khash.h similarity index 100% rename from khash.h rename to src/khash.h diff --git a/log.c b/src/log.c similarity index 100% rename from log.c rename to src/log.c diff --git a/log.h b/src/log.h similarity index 100% rename from log.h rename to src/log.h diff --git a/logbuf.c b/src/logbuf.c similarity index 100% rename from logbuf.c rename to src/logbuf.c diff --git a/logbuf.h b/src/logbuf.h similarity index 100% rename from logbuf.h rename to src/logbuf.h diff --git a/logger.c b/src/logger.c similarity index 100% rename from logger.c rename to src/logger.c diff --git a/logger.h b/src/logger.h similarity index 100% rename from logger.h rename to src/logger.h diff --git a/logpkt.c b/src/logpkt.c similarity index 100% rename from logpkt.c rename to src/logpkt.c diff --git a/logpkt.h b/src/logpkt.h similarity index 100% rename from logpkt.h rename to src/logpkt.h diff --git a/main.c b/src/main.c similarity index 100% rename from main.c rename to src/main.c diff --git a/nat.c b/src/nat.c similarity index 100% rename from nat.c rename to src/nat.c diff --git a/nat.h b/src/nat.h similarity index 100% rename from nat.h rename to src/nat.h diff --git a/opts.c b/src/opts.c similarity index 100% rename from opts.c rename to src/opts.c diff --git a/opts.h b/src/opts.h similarity index 100% rename from opts.h rename to src/opts.h diff --git a/privsep.c b/src/privsep.c similarity index 100% rename from privsep.c rename to src/privsep.c diff --git a/privsep.h b/src/privsep.h similarity index 100% rename from privsep.h rename to src/privsep.h diff --git a/proc.c b/src/proc.c similarity index 100% rename from proc.c rename to src/proc.c diff --git a/proc.h b/src/proc.h similarity index 100% rename from proc.h rename to src/proc.h diff --git a/protoautossl.c b/src/protoautossl.c similarity index 100% rename from protoautossl.c rename to src/protoautossl.c diff --git a/protoautossl.h b/src/protoautossl.h similarity index 100% rename from protoautossl.h rename to src/protoautossl.h diff --git a/protohttp.c b/src/protohttp.c similarity index 100% rename from protohttp.c rename to src/protohttp.c diff --git a/protohttp.h b/src/protohttp.h similarity index 100% rename from protohttp.h rename to src/protohttp.h diff --git a/protopassthrough.c b/src/protopassthrough.c similarity index 100% rename from protopassthrough.c rename to src/protopassthrough.c diff --git a/protopassthrough.h b/src/protopassthrough.h similarity index 100% rename from protopassthrough.h rename to src/protopassthrough.h diff --git a/protopop3.c b/src/protopop3.c similarity index 100% rename from protopop3.c rename to src/protopop3.c diff --git a/protopop3.h b/src/protopop3.h similarity index 100% rename from protopop3.h rename to src/protopop3.h diff --git a/protosmtp.c b/src/protosmtp.c similarity index 100% rename from protosmtp.c rename to src/protosmtp.c diff --git a/protosmtp.h b/src/protosmtp.h similarity index 100% rename from protosmtp.h rename to src/protosmtp.h diff --git a/protossl.c b/src/protossl.c similarity index 100% rename from protossl.c rename to src/protossl.c diff --git a/protossl.h b/src/protossl.h similarity index 100% rename from protossl.h rename to src/protossl.h diff --git a/prototcp.c b/src/prototcp.c similarity index 100% rename from prototcp.c rename to src/prototcp.c diff --git a/prototcp.h b/src/prototcp.h similarity index 100% rename from prototcp.h rename to src/prototcp.h diff --git a/proxy.c b/src/proxy.c similarity index 100% rename from proxy.c rename to src/proxy.c diff --git a/proxy.h b/src/proxy.h similarity index 100% rename from proxy.h rename to src/proxy.h diff --git a/pxyconn.c b/src/pxyconn.c similarity index 100% rename from pxyconn.c rename to src/pxyconn.c diff --git a/pxyconn.h b/src/pxyconn.h similarity index 100% rename from pxyconn.h rename to src/pxyconn.h diff --git a/pxysslshut.c b/src/pxysslshut.c similarity index 100% rename from pxysslshut.c rename to src/pxysslshut.c diff --git a/pxysslshut.h b/src/pxysslshut.h similarity index 100% rename from pxysslshut.h rename to src/pxysslshut.h diff --git a/pxythrmgr.c b/src/pxythrmgr.c similarity index 100% rename from pxythrmgr.c rename to src/pxythrmgr.c diff --git a/pxythrmgr.h b/src/pxythrmgr.h similarity index 100% rename from pxythrmgr.h rename to src/pxythrmgr.h diff --git a/ssl.c b/src/ssl.c similarity index 100% rename from ssl.c rename to src/ssl.c diff --git a/ssl.h b/src/ssl.h similarity index 100% rename from ssl.h rename to src/ssl.h diff --git a/sslproxy.1 b/src/sslproxy.1 similarity index 100% rename from sslproxy.1 rename to src/sslproxy.1 diff --git a/sslproxy.conf b/src/sslproxy.conf similarity index 100% rename from sslproxy.conf rename to src/sslproxy.conf diff --git a/sslproxy.conf.5 b/src/sslproxy.conf.5 similarity index 100% rename from sslproxy.conf.5 rename to src/sslproxy.conf.5 diff --git a/sys.c b/src/sys.c similarity index 100% rename from sys.c rename to src/sys.c diff --git a/sys.h b/src/sys.h similarity index 100% rename from sys.h rename to src/sys.h diff --git a/thrqueue.c b/src/thrqueue.c similarity index 100% rename from thrqueue.c rename to src/thrqueue.c diff --git a/thrqueue.h b/src/thrqueue.h similarity index 100% rename from thrqueue.h rename to src/thrqueue.h diff --git a/url.c b/src/url.c similarity index 100% rename from url.c rename to src/url.c diff --git a/url.h b/src/url.h similarity index 100% rename from url.h rename to src/url.h diff --git a/util.c b/src/util.c similarity index 100% rename from util.c rename to src/util.c diff --git a/util.h b/src/util.h similarity index 100% rename from util.h rename to src/util.h diff --git a/base64.t.c b/tests/check/base64.t.c similarity index 100% rename from base64.t.c rename to tests/check/base64.t.c diff --git a/cachedsess.t.c b/tests/check/cachedsess.t.c similarity index 100% rename from cachedsess.t.c rename to tests/check/cachedsess.t.c diff --git a/cachefkcrt.t.c b/tests/check/cachefkcrt.t.c similarity index 100% rename from cachefkcrt.t.c rename to tests/check/cachefkcrt.t.c diff --git a/cachemgr.t.c b/tests/check/cachemgr.t.c similarity index 100% rename from cachemgr.t.c rename to tests/check/cachemgr.t.c diff --git a/cachessess.t.c b/tests/check/cachessess.t.c similarity index 100% rename from cachessess.t.c rename to tests/check/cachessess.t.c diff --git a/cachetgcrt.t.c b/tests/check/cachetgcrt.t.c similarity index 100% rename from cachetgcrt.t.c rename to tests/check/cachetgcrt.t.c diff --git a/cert.t.c b/tests/check/cert.t.c similarity index 100% rename from cert.t.c rename to tests/check/cert.t.c diff --git a/defaults.t.c b/tests/check/defaults.t.c similarity index 100% rename from defaults.t.c rename to tests/check/defaults.t.c diff --git a/dynbuf.t.c b/tests/check/dynbuf.t.c similarity index 100% rename from dynbuf.t.c rename to tests/check/dynbuf.t.c diff --git a/logbuf.t.c b/tests/check/logbuf.t.c similarity index 100% rename from logbuf.t.c rename to tests/check/logbuf.t.c diff --git a/main.t.c b/tests/check/main.t.c similarity index 100% rename from main.t.c rename to tests/check/main.t.c diff --git a/opts.t.c b/tests/check/opts.t.c similarity index 100% rename from opts.t.c rename to tests/check/opts.t.c diff --git a/pxythrmgr.t.c b/tests/check/pxythrmgr.t.c similarity index 100% rename from pxythrmgr.t.c rename to tests/check/pxythrmgr.t.c diff --git a/ssl.t.c b/tests/check/ssl.t.c similarity index 100% rename from ssl.t.c rename to tests/check/ssl.t.c diff --git a/sys.t.c b/tests/check/sys.t.c similarity index 100% rename from sys.t.c rename to tests/check/sys.t.c diff --git a/url.t.c b/tests/check/url.t.c similarity index 100% rename from url.t.c rename to tests/check/url.t.c diff --git a/util.t.c b/tests/check/util.t.c similarity index 100% rename from util.t.c rename to tests/check/util.t.c diff --git a/extra/testproxy/ca.crt b/tests/testproxy/ca.crt similarity index 100% rename from extra/testproxy/ca.crt rename to tests/testproxy/ca.crt diff --git a/extra/testproxy/ca.key b/tests/testproxy/ca.key similarity index 100% rename from extra/testproxy/ca.key rename to tests/testproxy/ca.key diff --git a/extra/testproxy/ca2.crt b/tests/testproxy/ca2.crt similarity index 100% rename from extra/testproxy/ca2.crt rename to tests/testproxy/ca2.crt diff --git a/extra/testproxy/ca2.key b/tests/testproxy/ca2.key similarity index 100% rename from extra/testproxy/ca2.key rename to tests/testproxy/ca2.key diff --git a/extra/testproxy/ca_testset_1.json b/tests/testproxy/ca_testset_1.json similarity index 100% rename from extra/testproxy/ca_testset_1.json rename to tests/testproxy/ca_testset_1.json diff --git a/extra/testproxy/ca_testset_2.json b/tests/testproxy/ca_testset_2.json similarity index 100% rename from extra/testproxy/ca_testset_2.json rename to tests/testproxy/ca_testset_2.json diff --git a/extra/testproxy/http_testset_1.json b/tests/testproxy/http_testset_1.json similarity index 100% rename from extra/testproxy/http_testset_1.json rename to tests/testproxy/http_testset_1.json diff --git a/extra/testproxy/http_testset_2.json b/tests/testproxy/http_testset_2.json similarity index 100% rename from extra/testproxy/http_testset_2.json rename to tests/testproxy/http_testset_2.json diff --git a/extra/testproxy/http_testset_3.json b/tests/testproxy/http_testset_3.json similarity index 100% rename from extra/testproxy/http_testset_3.json rename to tests/testproxy/http_testset_3.json diff --git a/extra/testproxy/passthrough_testset_1.json b/tests/testproxy/passthrough_testset_1.json similarity index 100% rename from extra/testproxy/passthrough_testset_1.json rename to tests/testproxy/passthrough_testset_1.json diff --git a/extra/testproxy/payload_ocsp_denied_response.bin b/tests/testproxy/payload_ocsp_denied_response.bin similarity index 100% rename from extra/testproxy/payload_ocsp_denied_response.bin rename to tests/testproxy/payload_ocsp_denied_response.bin diff --git a/extra/testproxy/proto_validate_testset_1.json b/tests/testproxy/proto_validate_testset_1.json similarity index 100% rename from extra/testproxy/proto_validate_testset_1.json rename to tests/testproxy/proto_validate_testset_1.json diff --git a/extra/testproxy/proto_validate_testset_2.json b/tests/testproxy/proto_validate_testset_2.json similarity index 100% rename from extra/testproxy/proto_validate_testset_2.json rename to tests/testproxy/proto_validate_testset_2.json diff --git a/extra/testproxy/server.crt b/tests/testproxy/server.crt similarity index 100% rename from extra/testproxy/server.crt rename to tests/testproxy/server.crt diff --git a/extra/testproxy/server.key b/tests/testproxy/server.key similarity index 100% rename from extra/testproxy/server.key rename to tests/testproxy/server.key diff --git a/extra/testproxy/server2.crt b/tests/testproxy/server2.crt similarity index 100% rename from extra/testproxy/server2.crt rename to tests/testproxy/server2.crt diff --git a/extra/testproxy/server2.key b/tests/testproxy/server2.key similarity index 100% rename from extra/testproxy/server2.key rename to tests/testproxy/server2.key diff --git a/extra/testproxy/ssl_tcp_testends_testset_1.json b/tests/testproxy/ssl_tcp_testends_testset_1.json similarity index 100% rename from extra/testproxy/ssl_tcp_testends_testset_1.json rename to tests/testproxy/ssl_tcp_testends_testset_1.json diff --git a/extra/testproxy/ssl_testset_1.json b/tests/testproxy/ssl_testset_1.json similarity index 100% rename from extra/testproxy/ssl_testset_1.json rename to tests/testproxy/ssl_testset_1.json diff --git a/extra/testproxy/ssl_testset_2.json b/tests/testproxy/ssl_testset_2.json similarity index 100% rename from extra/testproxy/ssl_testset_2.json rename to tests/testproxy/ssl_testset_2.json diff --git a/extra/testproxy/ssl_testset_3.json b/tests/testproxy/ssl_testset_3.json similarity index 100% rename from extra/testproxy/ssl_testset_3.json rename to tests/testproxy/ssl_testset_3.json diff --git a/extra/testproxy/ssl_testset_4.json b/tests/testproxy/ssl_testset_4.json similarity index 100% rename from extra/testproxy/ssl_testset_4.json rename to tests/testproxy/ssl_testset_4.json diff --git a/extra/testproxy/ssl_testset_5.json b/tests/testproxy/ssl_testset_5.json similarity index 100% rename from extra/testproxy/ssl_testset_5.json rename to tests/testproxy/ssl_testset_5.json diff --git a/extra/testproxy/sslproxy.conf b/tests/testproxy/sslproxy.conf similarity index 100% rename from extra/testproxy/sslproxy.conf rename to tests/testproxy/sslproxy.conf diff --git a/extra/testproxy/tcp_ssl_testends_testset_1.json b/tests/testproxy/tcp_ssl_testends_testset_1.json similarity index 100% rename from extra/testproxy/tcp_ssl_testends_testset_1.json rename to tests/testproxy/tcp_ssl_testends_testset_1.json diff --git a/extra/testproxy/testharness.json b/tests/testproxy/testharness.json similarity index 100% rename from extra/testproxy/testharness.json rename to tests/testproxy/testharness.json diff --git a/extra/testproxy/userauth_testset_1.json b/tests/testproxy/userauth_testset_1.json similarity index 100% rename from extra/testproxy/userauth_testset_1.json rename to tests/testproxy/userauth_testset_1.json diff --git a/extra/testproxy/userauth_testset_2.json b/tests/testproxy/userauth_testset_2.json similarity index 100% rename from extra/testproxy/userauth_testset_2.json rename to tests/testproxy/userauth_testset_2.json diff --git a/extra/testproxy/users.db b/tests/testproxy/users.db similarity index 100% rename from extra/testproxy/users.db rename to tests/testproxy/users.db diff --git a/extra/testproxy/verifypeer_testset_1.json b/tests/testproxy/verifypeer_testset_1.json similarity index 100% rename from extra/testproxy/verifypeer_testset_1.json rename to tests/testproxy/verifypeer_testset_1.json diff --git a/extra/testproxy/verifypeer_testset_2.json b/tests/testproxy/verifypeer_testset_2.json similarity index 100% rename from extra/testproxy/verifypeer_testset_2.json rename to tests/testproxy/verifypeer_testset_2.json