ZPKGBIN=zpm-addfile zpm-extract zpm-init zpm-vercmp zpm-stat zpm-hash \
zpm-findpkg zpm-shell zpm-soneed zpm-foreach-path zpm-parse \
zpm-script zpm-soname zpm-syncfs zpm-packagehash zpm-verify \
- zpm-elftype zpm-quote zpm-note zpm-search zpm-add
+ zpm-elftype zpm-quote zpm-note zpm-search zpm-add zpm-fetchurl
SCRIPTS=zpm zpm-install zpm-merge zpm-list zpm-preserve zpm-test zpm-log \
zpm-contents zpm-uninstall zpm-pathmod zpm-rmpackage zpm-newpackage \
TLSOBJ= tlse.o x25519.o chacha.o base64.o pem.o forward.o handshake.o \
buffer.o parse_client_hello.o parse_message.o cipher_supported.o \
- packet_update.o hmac_message.o hkdf.o hash.o
+ packet_update.o hmac_message.o hkdf.o hash.o cipher_name.o
crypto/x25519.o: $(addprefix crypto/ref10/, $(X255OBJ))
ld -o $@ -r $+
ltc.o: $(addprefix libtomcrypt/src/, $(LTCOBJ))
ld -o $@ -r $+
-zpm-fetchurl.o: CFLAGS+=-DTFM_DESC -Isrc/headers -Itomsfastmath/src/headers -DARGTYPE=4 -DLTC_NO_ASM -DTFM_NO_ASM -Ilibtomcrypt/src/headers -DLTC_SOURCE -Icrypto
+crypto/rfc3986.c: crypto/rfc3986.re
+ re2c --input custom --tags -o $@ $<
-zpm-fetchurl: ltc.o tls.o tfm.o zpm-fetchurl.o crypto/https.o
+rfc3986: rfc3986.c
+ $(CC) -Wall -W -Wextra -Werror -o $@ $+
+
+zpm-fetchurl.o: CFLAGS+=-DTFM_DESC -Isrc/headers -Itomsfastmath/src/headers -DARGTYPE=4 -DLTC_NO_ASM -DTFM_NO_ASM -Ilibtomcrypt/src/headers -DLTC_SOURCE -Icrypto -Wno-pointer-sign -DDEBUG
+
+zpm-fetchurl: ltc.o tls.o tfm.o zpm-fetchurl.o crypto/https.o crypto/rfc3986.o
testddg: zpm-fetchurl
./zpm-fetchurl duckduckgo.com 443 /
testgra: zpm-fetchurl
./zpm-fetchurl granicus.if.org 443 /
+SIGNSRC= \
+crypto/libeddsa/lib/burn.c \
+crypto/libeddsa/lib/burnstack.c \
+crypto/libeddsa/lib/ed.c \
+crypto/libeddsa/lib/ed25519-sha512.c \
+crypto/libeddsa/lib/fld.c \
+crypto/libeddsa/lib/sc.c \
+crypto/libeddsa/lib/sha512.c \
+crypto/libeddsa/lib/x25519.c \
+crypto/libeddsa/sign.c
+
+SIGNOBJ=$(SIGNSRC:.c=.o)
+
+$(SIGNOBJ): CFLAGS+=-Icrypto/libeddsa/lib
+
+zpm-sign: $(SIGNOBJ)
+ $(CC) $(CFLAGS) -o $@ $+
+
clean:
rm -f *.o sqlite/*.o lib/*.o $(LZMAOBJ) liblzma.a \
libelf.a libzpm.a zpm-addfile soname \