From 47160e1de8c2f638f0ef41cef42c976417b61778 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 22 Jan 2020 10:30:13 +1100 Subject: unbreak fuzzer support for recent ssh-sk.h changes --- regress/misc/fuzz-harness/Makefile | 27 ++++++++++++++------------- 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 FUZZ_FLAGS=-fsanitize=address,undefined -fsanitize-coverage=edge,trace-pc FUZZ_LIBS=-lFuzzer -CXXFLAGS=-O2 -g -Wall -Wextra -I ../../.. $(FUZZ_FLAGS) +CXXFLAGS=-O2 -g -Wall -Wextra -Wno-unused-parameter -I ../../.. $(FUZZ_FLAGS) LDFLAGS=-L ../../.. -L ../../../openbsd-compat -g $(FUZZ_FLAGS) LIBS=-lssh -lopenbsd-compat -lcrypto -lfido2 -lcbor $(FUZZ_LIBS) +COMMON_OBJS=ssh-sk-null.o TARGETS=pubkey_fuzz sig_fuzz authopt_fuzz sshsig_fuzz \ sshsigopt_fuzz privkey_fuzz @@ -15,23 +16,23 @@ all: $(TARGETS) .cc.o: $(CXX) $(CXXFLAGS) -c $< -o $@ -pubkey_fuzz: pubkey_fuzz.o - $(CXX) -o $@ pubkey_fuzz.o $(LDFLAGS) $(LIBS) +pubkey_fuzz: pubkey_fuzz.o $(COMMON_OBJS) + $(CXX) -o $@ pubkey_fuzz.o $(COMMON_OBJS) $(LDFLAGS) $(LIBS) -sig_fuzz: sig_fuzz.o - $(CXX) -o $@ sig_fuzz.o $(LDFLAGS) $(LIBS) +sig_fuzz: sig_fuzz.o $(COMMON_OBJS) + $(CXX) -o $@ sig_fuzz.o $(COMMON_OBJS) $(LDFLAGS) $(LIBS) -authopt_fuzz: authopt_fuzz.o - $(CXX) -o $@ authopt_fuzz.o ../../../auth-options.o $(LDFLAGS) $(LIBS) +authopt_fuzz: authopt_fuzz.o $(COMMON_OBJS) + $(CXX) -o $@ authopt_fuzz.o $(COMMON_OBJS) ../../../auth-options.o $(LDFLAGS) $(LIBS) -sshsig_fuzz: sshsig_fuzz.o - $(CXX) -o $@ sshsig_fuzz.o ../../../sshsig.o $(LDFLAGS) $(LIBS) +sshsig_fuzz: sshsig_fuzz.o $(COMMON_OBJS) + $(CXX) -o $@ sshsig_fuzz.o $(COMMON_OBJS) ../../../sshsig.o $(LDFLAGS) $(LIBS) -sshsigopt_fuzz: sshsigopt_fuzz.o - $(CXX) -o $@ sshsigopt_fuzz.o ../../../sshsig.o $(LDFLAGS) $(LIBS) +sshsigopt_fuzz: sshsigopt_fuzz.o $(COMMON_OBJS) + $(CXX) -o $@ sshsigopt_fuzz.o $(COMMON_OBJS) ../../../sshsig.o $(LDFLAGS) $(LIBS) -privkey_fuzz: privkey_fuzz.o - $(CXX) -o $@ privkey_fuzz.o $(LDFLAGS) $(LIBS) +privkey_fuzz: privkey_fuzz.o $(COMMON_OBJS) + $(CXX) -o $@ privkey_fuzz.o $(COMMON_OBJS) $(LDFLAGS) $(LIBS) clean: -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" { #include "ssh-sk.h" int -sshsk_sign(const char *provider, struct sshkey *key, - u_char **sigp, size_t *lenp, const u_char *data, size_t datalen, - u_int compat, const char *pin) +sshsk_enroll(int type, const char *provider_path, const char *device, + const char *application, const char *userid, uint8_t flags, + const char *pin, struct sshbuf *challenge_buf, + struct sshkey **keyp, struct sshbuf *attest) { return SSH_ERR_FEATURE_UNSUPPORTED; } int -sshsk_enroll(int type, const char *provider_path, const char *application, - uint8_t flags, const char *pin, struct sshbuf *challenge_buf, - struct sshkey **keyp, struct sshbuf *attest) +sshsk_sign(const char *provider_path, struct sshkey *key, + u_char **sigp, size_t *lenp, const u_char *data, size_t datalen, + u_int compat, const char *pin) { return SSH_ERR_FEATURE_UNSUPPORTED; } int -sshsk_load_resident(const char *provider_path, const char *pin, - struct sshkey ***keysp, size_t *nkeysp) +sshsk_load_resident(const char *provider_path, const char *device, + const char *pin, struct sshkey ***keysp, size_t *nkeysp) { return SSH_ERR_FEATURE_UNSUPPORTED; } -- cgit v1.2.3