Differences From
Artifact [6f86f7629d]:
32 32 libcackey_g.@SHOBJEXT@: cackey_g.o
33 33 $(CC) $(SHOBJFLAGS) $(DEBUGCPPFLAGS) $(DEBUGCFLAGS) $(SHOBJLDFLAGS) $(LDFLAGS) -o libcackey_g.@SHOBJEXT@ cackey_g.o $(LIBS)
34 34 -@WEAKENSYMS@ "libcackey_g.@SHOBJEXT@"
35 35
36 36 test: test.c libcackey_g.@SHOBJEXT@
37 37 $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o test test.c -Wl,-R,. libcackey_g.@SHOBJEXT@
38 38
39 +test-afl.data: test
40 + tmpLogFile='log.$(shell openssl rand -hex 16)'; \
41 + ./test 2> $${tmpLogFile}; \
42 + echo -ne "$$( \
43 + grep 'Returned Value:' $${tmpLogFile} | sed 's@^.*/@@;s@ = {@ @;s@})$$@@;s@,@@g;s@ @\\x@g;s@\\@ \\@' | while IFS=' ' read -r count string; do \
44 + printf '\\x%02x\\x%02x%s' $$[$${count} / 256] $$[$${count} % 256] "$${string}"; \
45 + done \
46 + )" > test-afl.data; rm -f $${tmpLogFile}
47 +
48 +test-afl: test-afl.data test.c cackey.c cackey_builtin_certs.h sha1.c sha1.h md5.c md5.h asn1-x509.c asn1-x509.h config.h
49 + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -DCACKEY_TEST_AFL -o test-afl test.c $(patsubst -lpcsclite,,$(LIBS))
50 +
39 51 splint-cackey.txt: cackey.c cackey_builtin_certs.h asn1-x509.c asn1-x509.h config.h
40 52 splint $(DEBUGCPPFLAGS) -DCACKEY_PARANOID=1 -weak +posixlib -I/usr/include/PCSC -Ipkcs11 cackey.c > splint-cackey.txt
41 53
42 54 install: libcackey.@SHOBJEXT@
43 55 -mkdir -p "$(DESTDIR)$(libdir)"
44 56 rm -f "$(DESTDIR)$(libdir)/libcackey.@SHOBJEXT@"
45 57 rm -f "$(DESTDIR)$(libdir)/libcackey_g.@SHOBJEXT@"