summaryrefslogtreecommitdiff
path: root/regress/misc/fuzz-harness
diff options
context:
space:
mode:
Diffstat (limited to 'regress/misc/fuzz-harness')
-rw-r--r--regress/misc/fuzz-harness/Makefile27
-rw-r--r--regress/misc/fuzz-harness/ssh-sk-null.cc17
2 files changed, 23 insertions, 21 deletions
diff --git a/regress/misc/fuzz-harness/Makefile b/regress/misc/fuzz-harness/Makefile
index f02d6858c..64fbdbab1 100644
--- a/regress/misc/fuzz-harness/Makefile
+++ b/regress/misc/fuzz-harness/Makefile
@@ -3,9 +3,10 @@ CXX=clang++-6.0
3FUZZ_FLAGS=-fsanitize=address,undefined -fsanitize-coverage=edge,trace-pc 3FUZZ_FLAGS=-fsanitize=address,undefined -fsanitize-coverage=edge,trace-pc
4FUZZ_LIBS=-lFuzzer 4FUZZ_LIBS=-lFuzzer
5 5
6CXXFLAGS=-O2 -g -Wall -Wextra -I ../../.. $(FUZZ_FLAGS) 6CXXFLAGS=-O2 -g -Wall -Wextra -Wno-unused-parameter -I ../../.. $(FUZZ_FLAGS)
7LDFLAGS=-L ../../.. -L ../../../openbsd-compat -g $(FUZZ_FLAGS) 7LDFLAGS=-L ../../.. -L ../../../openbsd-compat -g $(FUZZ_FLAGS)
8LIBS=-lssh -lopenbsd-compat -lcrypto -lfido2 -lcbor $(FUZZ_LIBS) 8LIBS=-lssh -lopenbsd-compat -lcrypto -lfido2 -lcbor $(FUZZ_LIBS)
9COMMON_OBJS=ssh-sk-null.o
9 10
10TARGETS=pubkey_fuzz sig_fuzz authopt_fuzz sshsig_fuzz \ 11TARGETS=pubkey_fuzz sig_fuzz authopt_fuzz sshsig_fuzz \
11 sshsigopt_fuzz privkey_fuzz 12 sshsigopt_fuzz privkey_fuzz
@@ -15,23 +16,23 @@ all: $(TARGETS)
15.cc.o: 16.cc.o:
16 $(CXX) $(CXXFLAGS) -c $< -o $@ 17 $(CXX) $(CXXFLAGS) -c $< -o $@
17 18
18pubkey_fuzz: pubkey_fuzz.o 19pubkey_fuzz: pubkey_fuzz.o $(COMMON_OBJS)
19 $(CXX) -o $@ pubkey_fuzz.o $(LDFLAGS) $(LIBS) 20 $(CXX) -o $@ pubkey_fuzz.o $(COMMON_OBJS) $(LDFLAGS) $(LIBS)
20 21
21sig_fuzz: sig_fuzz.o 22sig_fuzz: sig_fuzz.o $(COMMON_OBJS)
22 $(CXX) -o $@ sig_fuzz.o $(LDFLAGS) $(LIBS) 23 $(CXX) -o $@ sig_fuzz.o $(COMMON_OBJS) $(LDFLAGS) $(LIBS)
23 24
24authopt_fuzz: authopt_fuzz.o 25authopt_fuzz: authopt_fuzz.o $(COMMON_OBJS)
25 $(CXX) -o $@ authopt_fuzz.o ../../../auth-options.o $(LDFLAGS) $(LIBS) 26 $(CXX) -o $@ authopt_fuzz.o $(COMMON_OBJS) ../../../auth-options.o $(LDFLAGS) $(LIBS)
26 27
27sshsig_fuzz: sshsig_fuzz.o 28sshsig_fuzz: sshsig_fuzz.o $(COMMON_OBJS)
28 $(CXX) -o $@ sshsig_fuzz.o ../../../sshsig.o $(LDFLAGS) $(LIBS) 29 $(CXX) -o $@ sshsig_fuzz.o $(COMMON_OBJS) ../../../sshsig.o $(LDFLAGS) $(LIBS)
29 30
30sshsigopt_fuzz: sshsigopt_fuzz.o 31sshsigopt_fuzz: sshsigopt_fuzz.o $(COMMON_OBJS)
31 $(CXX) -o $@ sshsigopt_fuzz.o ../../../sshsig.o $(LDFLAGS) $(LIBS) 32 $(CXX) -o $@ sshsigopt_fuzz.o $(COMMON_OBJS) ../../../sshsig.o $(LDFLAGS) $(LIBS)
32 33
33privkey_fuzz: privkey_fuzz.o 34privkey_fuzz: privkey_fuzz.o $(COMMON_OBJS)
34 $(CXX) -o $@ privkey_fuzz.o $(LDFLAGS) $(LIBS) 35 $(CXX) -o $@ privkey_fuzz.o $(COMMON_OBJS) $(LDFLAGS) $(LIBS)
35 36
36clean: 37clean:
37 -rm -f *.o $(TARGETS) 38 -rm -f *.o $(TARGETS)
diff --git a/regress/misc/fuzz-harness/ssh-sk-null.cc b/regress/misc/fuzz-harness/ssh-sk-null.cc
index de9a889f9..199af1121 100644
--- a/regress/misc/fuzz-harness/ssh-sk-null.cc
+++ b/regress/misc/fuzz-harness/ssh-sk-null.cc
@@ -25,24 +25,25 @@ extern "C" {
25#include "ssh-sk.h" 25#include "ssh-sk.h"
26 26
27int 27int
28sshsk_sign(const char *provider, struct sshkey *key, 28sshsk_enroll(int type, const char *provider_path, const char *device,
29 u_char **sigp, size_t *lenp, const u_char *data, size_t datalen, 29 const char *application, const char *userid, uint8_t flags,
30 u_int compat, const char *pin) 30 const char *pin, struct sshbuf *challenge_buf,
31 struct sshkey **keyp, struct sshbuf *attest)
31{ 32{
32 return SSH_ERR_FEATURE_UNSUPPORTED; 33 return SSH_ERR_FEATURE_UNSUPPORTED;
33} 34}
34 35
35int 36int
36sshsk_enroll(int type, const char *provider_path, const char *application, 37sshsk_sign(const char *provider_path, struct sshkey *key,
37 uint8_t flags, const char *pin, struct sshbuf *challenge_buf, 38 u_char **sigp, size_t *lenp, const u_char *data, size_t datalen,
38 struct sshkey **keyp, struct sshbuf *attest) 39 u_int compat, const char *pin)
39{ 40{
40 return SSH_ERR_FEATURE_UNSUPPORTED; 41 return SSH_ERR_FEATURE_UNSUPPORTED;
41} 42}
42 43
43int 44int
44sshsk_load_resident(const char *provider_path, const char *pin, 45sshsk_load_resident(const char *provider_path, const char *device,
45 struct sshkey ***keysp, size_t *nkeysp) 46 const char *pin, struct sshkey ***keysp, size_t *nkeysp)
46{ 47{
47 return SSH_ERR_FEATURE_UNSUPPORTED; 48 return SSH_ERR_FEATURE_UNSUPPORTED;
48} 49}