unbreak fuzzer support for recent ssh-sk.h changes

This commit is contained in:
Damien Miller 2020-01-22 10:30:13 +11:00
parent 70d38c3cfd
commit 47160e1de8
2 changed files with 26 additions and 24 deletions

View File

@ -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)

View File

@ -25,7 +25,16 @@ extern "C" {
#include "ssh-sk.h"
int
sshsk_sign(const char *provider, struct sshkey *key,
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_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)
{
@ -33,16 +42,8 @@ sshsk_sign(const char *provider, struct sshkey *key,
}
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)
{
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;
}