diff options
Diffstat (limited to 'regress')
-rw-r--r-- | regress/misc/fuzz-harness/Makefile | 27 | ||||
-rw-r--r-- | regress/misc/fuzz-harness/ssh-sk-null.cc | 17 |
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 | |||
3 | FUZZ_FLAGS=-fsanitize=address,undefined -fsanitize-coverage=edge,trace-pc | 3 | FUZZ_FLAGS=-fsanitize=address,undefined -fsanitize-coverage=edge,trace-pc |
4 | FUZZ_LIBS=-lFuzzer | 4 | FUZZ_LIBS=-lFuzzer |
5 | 5 | ||
6 | CXXFLAGS=-O2 -g -Wall -Wextra -I ../../.. $(FUZZ_FLAGS) | 6 | CXXFLAGS=-O2 -g -Wall -Wextra -Wno-unused-parameter -I ../../.. $(FUZZ_FLAGS) |
7 | LDFLAGS=-L ../../.. -L ../../../openbsd-compat -g $(FUZZ_FLAGS) | 7 | LDFLAGS=-L ../../.. -L ../../../openbsd-compat -g $(FUZZ_FLAGS) |
8 | LIBS=-lssh -lopenbsd-compat -lcrypto -lfido2 -lcbor $(FUZZ_LIBS) | 8 | LIBS=-lssh -lopenbsd-compat -lcrypto -lfido2 -lcbor $(FUZZ_LIBS) |
9 | COMMON_OBJS=ssh-sk-null.o | ||
9 | 10 | ||
10 | TARGETS=pubkey_fuzz sig_fuzz authopt_fuzz sshsig_fuzz \ | 11 | TARGETS=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 | ||
18 | pubkey_fuzz: pubkey_fuzz.o | 19 | pubkey_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 | ||
21 | sig_fuzz: sig_fuzz.o | 22 | sig_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 | ||
24 | authopt_fuzz: authopt_fuzz.o | 25 | authopt_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 | ||
27 | sshsig_fuzz: sshsig_fuzz.o | 28 | sshsig_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 | ||
30 | sshsigopt_fuzz: sshsigopt_fuzz.o | 31 | sshsigopt_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 | ||
33 | privkey_fuzz: privkey_fuzz.o | 34 | privkey_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 | ||
36 | clean: | 37 | clean: |
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 | ||
27 | int | 27 | int |
28 | sshsk_sign(const char *provider, struct sshkey *key, | 28 | sshsk_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 | ||
35 | int | 36 | int |
36 | sshsk_enroll(int type, const char *provider_path, const char *application, | 37 | sshsk_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 | ||
43 | int | 44 | int |
44 | sshsk_load_resident(const char *provider_path, const char *pin, | 45 | sshsk_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 | } |