diff options
Diffstat (limited to 'crypto/krb5/src/tests/fuzzing')
166 files changed, 0 insertions, 2409 deletions
diff --git a/crypto/krb5/src/tests/fuzzing/Makefile.in b/crypto/krb5/src/tests/fuzzing/Makefile.in deleted file mode 100644 index 15bbbbf1a853..000000000000 --- a/crypto/krb5/src/tests/fuzzing/Makefile.in +++ /dev/null @@ -1,138 +0,0 @@ -mydir=tests$(S)fuzzing -BUILDTOP=$(REL)..$(S).. - -LOCALINCLUDES= \ - -I$(srcdir)/../../lib/crypto/krb -I$(srcdir)/../../lib/krad \ - -I$(srcdir)/../../lib/crypto/builtin/des -I$(srcdir)/../../kdc \ - -I$(srcdir)/../../lib/krb5/ccache -I$(srcdir)/../../util/profile \ - -I$(srcdir)/../../util/support - -OBJS= \ - fuzz_aes.o \ - fuzz_asn.o \ - fuzz_attrset.o \ - fuzz_chpw.o \ - fuzz_crypto.o \ - fuzz_des.o \ - fuzz_gss.o \ - fuzz_json.o \ - fuzz_kdc.o \ - fuzz_krad.o \ - fuzz_krb.o \ - fuzz_krb5_ticket.o \ - fuzz_marshal_cred.o \ - fuzz_marshal_princ.o \ - fuzz_ndr.o \ - fuzz_oid.o \ - fuzz_pac.o \ - fuzz_profile.o \ - fuzz_util.o - -SRCS= \ - $(srcdir)/fuzz_aes.c \ - $(srcdir)/fuzz_asn.c \ - $(srcdir)/fuzz_attrset.c \ - $(srcdir)/fuzz_chpw.c \ - $(srcdir)/fuzz_crypto.c \ - $(srcdir)/fuzz_des.c \ - $(srcdir)/fuzz_gss.c \ - $(srcdir)/fuzz_json.c \ - $(srcdir)/fuzz_kdc.c \ - $(srcdir)/fuzz_krad.c \ - $(srcdir)/fuzz_krb.c \ - $(srcdir)/fuzz_krb5_ticket.c \ - $(srcdir)/fuzz_marshal_cred.c \ - $(srcdir)/fuzz_marshal_princ.c \ - $(srcdir)/fuzz_ndr.c \ - $(srcdir)/fuzz_oid.c \ - $(srcdir)/fuzz_pac.c \ - $(srcdir)/fuzz_profile.c \ - $(srcdir)/fuzz_util.c - -FUZZ_TARGETS= \ - fuzz_aes \ - fuzz_asn \ - fuzz_attrset \ - fuzz_chpw \ - fuzz_crypto \ - fuzz_des \ - fuzz_gss \ - fuzz_json \ - fuzz_kdc \ - fuzz_krad \ - fuzz_krb \ - fuzz_krb5_ticket \ - fuzz_marshal_cred \ - fuzz_marshal_princ \ - fuzz_ndr \ - fuzz_oid \ - fuzz_pac \ - fuzz_profile \ - fuzz_util - -all: $(FUZZ_TARGETS) - -# OSS-Fuzz requires fuzz targets to be linked with the C++ linker, -# even if they are written in C. - -fuzz_aes: fuzz_aes.o $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_aes.o $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_asn: fuzz_asn.o $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_asn.o $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_attrset: fuzz_attrset.o $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_attrset.o -lkrad $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_chpw: fuzz_chpw.o $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_chpw.o $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_crypto: fuzz_crypto.o $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_crypto.o $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_des: fuzz_des.o $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_des.o $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_gss: fuzz_gss.o $(GSS_DEPLIBS) $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_gss.o $(GSS_LIBS) $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_json: fuzz_json.o $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_json.o $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_kdc: fuzz_kdc.o $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_kdc.o $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_krad: fuzz_krad.o $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_krad.o -lkrad $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_krb: fuzz_krb.o $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_krb.o $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_krb5_ticket: fuzz_krb5_ticket.o $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_krb5_ticket.o $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_marshal_cred: fuzz_marshal_cred.o $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_marshal_cred.o $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_marshal_princ: fuzz_marshal_princ.o $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_marshal_princ.o $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_ndr: fuzz_ndr.o $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_ndr.o $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_oid: fuzz_oid.o $(GSS_DEPLIBS) $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_oid.o $(GSS_LIBS) $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_pac: fuzz_pac.o $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_pac.o $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_profile: fuzz_profile.o $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_profile.o $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -fuzz_util: fuzz_util.o $(KRB5_BASE_DEPLIBS) - $(CXX_LINK) -o $@ fuzz_util.o $(KRB5_BASE_LIBS) $(FUZZ_LDFLAGS) - -install: - -clean: - $(RM) $(FUZZ_TARGETS) diff --git a/crypto/krb5/src/tests/fuzzing/README b/crypto/krb5/src/tests/fuzzing/README deleted file mode 100644 index d1338249cdd6..000000000000 --- a/crypto/krb5/src/tests/fuzzing/README +++ /dev/null @@ -1,26 +0,0 @@ -This directory builds fuzzing targets for oss-fuzz compatibility. - If you wish to build it locally, you can do so by using the given - guide below. Note that it only works on GNU/Linux. - -Export flags required for building fuzzing targets. -```bash -export CC=clang -export CXX=clang++ -export CFLAGS="-g -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize=fuzzer-no-link" -export CXXFLAGS="-g -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize=fuzzer-no-link" -export LIB_FUZZING_ENGINE="-fsanitize=fuzzer" -``` - -Compilation of the fuzzing targets. -```bash -autoreconf -./configure CFLAGS="-fcommon $CFLAGS" CXXFLAGS="-fcommon $CXXFLAGS" \ - --enable-static --disable-shared --enable-ossfuzz -make -``` - -Running fuzzing targets. -```bash -mkdir fuzz_${TARGET}_corpus -./fuzz_${TARGET} fuzz_${TARGET}_corpus/ fuzz_${TARGET}_seed_corpus -``` diff --git a/crypto/krb5/src/tests/fuzzing/deps b/crypto/krb5/src/tests/fuzzing/deps deleted file mode 100644 index fbd77e8ea9b5..000000000000 --- a/crypto/krb5/src/tests/fuzzing/deps +++ /dev/null @@ -1,222 +0,0 @@ -# -# Generated makefile dependencies follow. -# -$(OUTPRE)fuzz_aes.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(srcdir)/../../lib/crypto/krb/crypto_int.h \ - $(top_srcdir)/include/k5-buf.h $(top_srcdir)/include/k5-err.h \ - $(top_srcdir)/include/k5-gmt_mktime.h $(top_srcdir)/include/k5-int-pkinit.h \ - $(top_srcdir)/include/k5-int.h $(top_srcdir)/include/k5-platform.h \ - $(top_srcdir)/include/k5-plugin.h $(top_srcdir)/include/k5-thread.h \ - $(top_srcdir)/include/k5-trace.h $(top_srcdir)/include/krb5.h \ - $(top_srcdir)/include/krb5/authdata_plugin.h $(top_srcdir)/include/krb5/plugin.h \ - $(top_srcdir)/include/port-sockets.h $(top_srcdir)/include/socket-utils.h \ - fuzz_aes.c -$(OUTPRE)fuzz_asn.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(top_srcdir)/include/k5-buf.h \ - $(top_srcdir)/include/k5-err.h $(top_srcdir)/include/k5-gmt_mktime.h \ - $(top_srcdir)/include/k5-int-pkinit.h $(top_srcdir)/include/k5-int.h \ - $(top_srcdir)/include/k5-platform.h $(top_srcdir)/include/k5-plugin.h \ - $(top_srcdir)/include/k5-spake.h $(top_srcdir)/include/k5-thread.h \ - $(top_srcdir)/include/k5-trace.h $(top_srcdir)/include/krb5.h \ - $(top_srcdir)/include/krb5/authdata_plugin.h $(top_srcdir)/include/krb5/plugin.h \ - $(top_srcdir)/include/port-sockets.h $(top_srcdir)/include/socket-utils.h \ - fuzz_asn.c -$(OUTPRE)fuzz_attrset.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(VERTO_DEPS) \ - $(srcdir)/../../lib/krad/internal.h $(top_srcdir)/include/k5-buf.h \ - $(top_srcdir)/include/k5-err.h $(top_srcdir)/include/k5-gmt_mktime.h \ - $(top_srcdir)/include/k5-int-pkinit.h $(top_srcdir)/include/k5-int.h \ - $(top_srcdir)/include/k5-platform.h $(top_srcdir)/include/k5-plugin.h \ - $(top_srcdir)/include/k5-thread.h $(top_srcdir)/include/k5-trace.h \ - $(top_srcdir)/include/krad.h $(top_srcdir)/include/krb5.h \ - $(top_srcdir)/include/krb5/authdata_plugin.h $(top_srcdir)/include/krb5/plugin.h \ - $(top_srcdir)/include/port-sockets.h $(top_srcdir)/include/socket-utils.h \ - fuzz_attrset.c -$(OUTPRE)fuzz_chpw.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(top_srcdir)/include/k5-buf.h \ - $(top_srcdir)/include/k5-err.h $(top_srcdir)/include/k5-gmt_mktime.h \ - $(top_srcdir)/include/k5-int-pkinit.h $(top_srcdir)/include/k5-int.h \ - $(top_srcdir)/include/k5-platform.h $(top_srcdir)/include/k5-plugin.h \ - $(top_srcdir)/include/k5-thread.h $(top_srcdir)/include/k5-trace.h \ - $(top_srcdir)/include/krb5.h $(top_srcdir)/include/krb5/authdata_plugin.h \ - $(top_srcdir)/include/krb5/plugin.h $(top_srcdir)/include/port-sockets.h \ - $(top_srcdir)/include/socket-utils.h fuzz_chpw.c -$(OUTPRE)fuzz_crypto.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(srcdir)/../../lib/crypto/krb/crypto_int.h \ - $(top_srcdir)/include/k5-buf.h $(top_srcdir)/include/k5-err.h \ - $(top_srcdir)/include/k5-gmt_mktime.h $(top_srcdir)/include/k5-int-pkinit.h \ - $(top_srcdir)/include/k5-int.h $(top_srcdir)/include/k5-platform.h \ - $(top_srcdir)/include/k5-plugin.h $(top_srcdir)/include/k5-thread.h \ - $(top_srcdir)/include/k5-trace.h $(top_srcdir)/include/krb5.h \ - $(top_srcdir)/include/krb5/authdata_plugin.h $(top_srcdir)/include/krb5/plugin.h \ - $(top_srcdir)/include/port-sockets.h $(top_srcdir)/include/socket-utils.h \ - fuzz_crypto.c -$(OUTPRE)fuzz_des.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(srcdir)/../../lib/crypto/builtin/des/des_int.h \ - $(srcdir)/../../lib/crypto/builtin/des/f_cbc.c $(srcdir)/../../lib/crypto/builtin/des/f_tables.h \ - $(top_srcdir)/include/k5-buf.h $(top_srcdir)/include/k5-err.h \ - $(top_srcdir)/include/k5-gmt_mktime.h $(top_srcdir)/include/k5-int-pkinit.h \ - $(top_srcdir)/include/k5-int.h $(top_srcdir)/include/k5-platform.h \ - $(top_srcdir)/include/k5-plugin.h $(top_srcdir)/include/k5-thread.h \ - $(top_srcdir)/include/k5-trace.h $(top_srcdir)/include/krb5.h \ - $(top_srcdir)/include/krb5/authdata_plugin.h $(top_srcdir)/include/krb5/plugin.h \ - $(top_srcdir)/include/port-sockets.h $(top_srcdir)/include/socket-utils.h \ - fuzz_des.c -$(OUTPRE)fuzz_gss.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/krb5/krb5.h \ - $(COM_ERR_DEPS) $(top_srcdir)/include/gssapi.h $(top_srcdir)/include/krb5.h \ - fuzz_gss.c -$(OUTPRE)fuzz_json.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(top_srcdir)/include/k5-buf.h \ - $(top_srcdir)/include/k5-err.h $(top_srcdir)/include/k5-gmt_mktime.h \ - $(top_srcdir)/include/k5-int-pkinit.h $(top_srcdir)/include/k5-int.h \ - $(top_srcdir)/include/k5-json.h $(top_srcdir)/include/k5-platform.h \ - $(top_srcdir)/include/k5-plugin.h $(top_srcdir)/include/k5-thread.h \ - $(top_srcdir)/include/k5-trace.h $(top_srcdir)/include/krb5.h \ - $(top_srcdir)/include/krb5/authdata_plugin.h $(top_srcdir)/include/krb5/plugin.h \ - $(top_srcdir)/include/port-sockets.h $(top_srcdir)/include/socket-utils.h \ - fuzz_json.c -$(OUTPRE)fuzz_kdc.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssrpc/types.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(VERTO_DEPS) \ - $(srcdir)/../../kdc/extern.h $(srcdir)/../../kdc/kdc_util.h \ - $(srcdir)/../../kdc/realm_data.h $(srcdir)/../../kdc/replay.c \ - $(srcdir)/../../kdc/reqstate.h $(top_srcdir)/include/gssrpc/auth.h \ - $(top_srcdir)/include/gssrpc/auth_gss.h $(top_srcdir)/include/gssrpc/auth_unix.h \ - $(top_srcdir)/include/gssrpc/clnt.h $(top_srcdir)/include/gssrpc/rename.h \ - $(top_srcdir)/include/gssrpc/rpc.h $(top_srcdir)/include/gssrpc/rpc_msg.h \ - $(top_srcdir)/include/gssrpc/svc.h $(top_srcdir)/include/gssrpc/svc_auth.h \ - $(top_srcdir)/include/gssrpc/xdr.h $(top_srcdir)/include/k5-buf.h \ - $(top_srcdir)/include/k5-err.h $(top_srcdir)/include/k5-gmt_mktime.h \ - $(top_srcdir)/include/k5-hashtab.h $(top_srcdir)/include/k5-int-pkinit.h \ - $(top_srcdir)/include/k5-int.h $(top_srcdir)/include/k5-platform.h \ - $(top_srcdir)/include/k5-plugin.h $(top_srcdir)/include/k5-queue.h \ - $(top_srcdir)/include/k5-thread.h $(top_srcdir)/include/k5-trace.h \ - $(top_srcdir)/include/kdb.h $(top_srcdir)/include/krb5.h \ - $(top_srcdir)/include/krb5/authdata_plugin.h $(top_srcdir)/include/krb5/kdcpreauth_plugin.h \ - $(top_srcdir)/include/krb5/plugin.h $(top_srcdir)/include/net-server.h \ - $(top_srcdir)/include/port-sockets.h $(top_srcdir)/include/socket-utils.h \ - fuzz_kdc.c -$(OUTPRE)fuzz_krad.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(VERTO_DEPS) \ - $(top_srcdir)/include/k5-buf.h $(top_srcdir)/include/k5-err.h \ - $(top_srcdir)/include/k5-gmt_mktime.h $(top_srcdir)/include/k5-int-pkinit.h \ - $(top_srcdir)/include/k5-int.h $(top_srcdir)/include/k5-platform.h \ - $(top_srcdir)/include/k5-plugin.h $(top_srcdir)/include/k5-thread.h \ - $(top_srcdir)/include/k5-trace.h $(top_srcdir)/include/krad.h \ - $(top_srcdir)/include/krb5.h $(top_srcdir)/include/krb5/authdata_plugin.h \ - $(top_srcdir)/include/krb5/plugin.h $(top_srcdir)/include/port-sockets.h \ - $(top_srcdir)/include/socket-utils.h fuzz_krad.c -$(OUTPRE)fuzz_krb.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(top_srcdir)/include/k5-base64.h \ - $(top_srcdir)/include/k5-buf.h $(top_srcdir)/include/k5-err.h \ - $(top_srcdir)/include/k5-gmt_mktime.h $(top_srcdir)/include/k5-hex.h \ - $(top_srcdir)/include/k5-int-pkinit.h $(top_srcdir)/include/k5-int.h \ - $(top_srcdir)/include/k5-platform.h $(top_srcdir)/include/k5-plugin.h \ - $(top_srcdir)/include/k5-thread.h $(top_srcdir)/include/k5-trace.h \ - $(top_srcdir)/include/krb5.h $(top_srcdir)/include/krb5/authdata_plugin.h \ - $(top_srcdir)/include/krb5/plugin.h $(top_srcdir)/include/port-sockets.h \ - $(top_srcdir)/include/socket-utils.h fuzz_krb.c -$(OUTPRE)fuzz_krb5_ticket.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(top_srcdir)/include/k5-buf.h \ - $(top_srcdir)/include/k5-err.h $(top_srcdir)/include/k5-gmt_mktime.h \ - $(top_srcdir)/include/k5-int-pkinit.h $(top_srcdir)/include/k5-int.h \ - $(top_srcdir)/include/k5-platform.h $(top_srcdir)/include/k5-plugin.h \ - $(top_srcdir)/include/k5-thread.h $(top_srcdir)/include/k5-trace.h \ - $(top_srcdir)/include/krb5.h $(top_srcdir)/include/krb5/authdata_plugin.h \ - $(top_srcdir)/include/krb5/plugin.h $(top_srcdir)/include/port-sockets.h \ - $(top_srcdir)/include/socket-utils.h fuzz_krb5_ticket.c -$(OUTPRE)fuzz_marshal_cred.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(srcdir)/../../lib/krb5/ccache/cc-int.h \ - $(top_srcdir)/include/k5-buf.h $(top_srcdir)/include/k5-err.h \ - $(top_srcdir)/include/k5-gmt_mktime.h $(top_srcdir)/include/k5-int-pkinit.h \ - $(top_srcdir)/include/k5-int.h $(top_srcdir)/include/k5-platform.h \ - $(top_srcdir)/include/k5-plugin.h $(top_srcdir)/include/k5-thread.h \ - $(top_srcdir)/include/k5-trace.h $(top_srcdir)/include/krb5.h \ - $(top_srcdir)/include/krb5/authdata_plugin.h $(top_srcdir)/include/krb5/plugin.h \ - $(top_srcdir)/include/port-sockets.h $(top_srcdir)/include/socket-utils.h \ - fuzz_marshal_cred.c -$(OUTPRE)fuzz_marshal_princ.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(srcdir)/../../lib/krb5/ccache/cc-int.h \ - $(top_srcdir)/include/k5-buf.h $(top_srcdir)/include/k5-err.h \ - $(top_srcdir)/include/k5-gmt_mktime.h $(top_srcdir)/include/k5-int-pkinit.h \ - $(top_srcdir)/include/k5-int.h $(top_srcdir)/include/k5-platform.h \ - $(top_srcdir)/include/k5-plugin.h $(top_srcdir)/include/k5-thread.h \ - $(top_srcdir)/include/k5-trace.h $(top_srcdir)/include/krb5.h \ - $(top_srcdir)/include/krb5/authdata_plugin.h $(top_srcdir)/include/krb5/plugin.h \ - $(top_srcdir)/include/port-sockets.h $(top_srcdir)/include/socket-utils.h \ - fuzz_marshal_princ.c -$(OUTPRE)fuzz_ndr.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssrpc/types.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(VERTO_DEPS) \ - $(srcdir)/../../kdc/kdc_util.h $(srcdir)/../../kdc/ndr.c \ - $(srcdir)/../../kdc/realm_data.h $(srcdir)/../../kdc/reqstate.h \ - $(top_srcdir)/include/gssrpc/auth.h $(top_srcdir)/include/gssrpc/auth_gss.h \ - $(top_srcdir)/include/gssrpc/auth_unix.h $(top_srcdir)/include/gssrpc/clnt.h \ - $(top_srcdir)/include/gssrpc/rename.h $(top_srcdir)/include/gssrpc/rpc.h \ - $(top_srcdir)/include/gssrpc/rpc_msg.h $(top_srcdir)/include/gssrpc/svc.h \ - $(top_srcdir)/include/gssrpc/svc_auth.h $(top_srcdir)/include/gssrpc/xdr.h \ - $(top_srcdir)/include/k5-buf.h $(top_srcdir)/include/k5-err.h \ - $(top_srcdir)/include/k5-gmt_mktime.h $(top_srcdir)/include/k5-input.h \ - $(top_srcdir)/include/k5-int-pkinit.h $(top_srcdir)/include/k5-int.h \ - $(top_srcdir)/include/k5-platform.h $(top_srcdir)/include/k5-plugin.h \ - $(top_srcdir)/include/k5-thread.h $(top_srcdir)/include/k5-trace.h \ - $(top_srcdir)/include/k5-utf8.h $(top_srcdir)/include/kdb.h \ - $(top_srcdir)/include/krb5.h $(top_srcdir)/include/krb5/authdata_plugin.h \ - $(top_srcdir)/include/krb5/kdcpreauth_plugin.h $(top_srcdir)/include/krb5/plugin.h \ - $(top_srcdir)/include/net-server.h $(top_srcdir)/include/port-sockets.h \ - $(top_srcdir)/include/socket-utils.h fuzz_ndr.c -$(OUTPRE)fuzz_oid.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssapi/gssapi_ext.h \ - $(BUILDTOP)/include/gssapi/gssapi_krb5.h $(BUILDTOP)/include/krb5/krb5.h \ - $(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \ - $(COM_ERR_DEPS) $(top_srcdir)/include/k5-buf.h $(top_srcdir)/include/k5-err.h \ - $(top_srcdir)/include/k5-gmt_mktime.h $(top_srcdir)/include/k5-int-pkinit.h \ - $(top_srcdir)/include/k5-int.h $(top_srcdir)/include/k5-platform.h \ - $(top_srcdir)/include/k5-plugin.h $(top_srcdir)/include/k5-thread.h \ - $(top_srcdir)/include/k5-trace.h $(top_srcdir)/include/krb5.h \ - $(top_srcdir)/include/krb5/authdata_plugin.h $(top_srcdir)/include/krb5/plugin.h \ - $(top_srcdir)/include/port-sockets.h $(top_srcdir)/include/socket-utils.h \ - fuzz_oid.c -$(OUTPRE)fuzz_pac.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(top_srcdir)/include/k5-buf.h \ - $(top_srcdir)/include/k5-err.h $(top_srcdir)/include/k5-gmt_mktime.h \ - $(top_srcdir)/include/k5-int-pkinit.h $(top_srcdir)/include/k5-int.h \ - $(top_srcdir)/include/k5-platform.h $(top_srcdir)/include/k5-plugin.h \ - $(top_srcdir)/include/k5-thread.h $(top_srcdir)/include/k5-trace.h \ - $(top_srcdir)/include/krb5.h $(top_srcdir)/include/krb5/authdata_plugin.h \ - $(top_srcdir)/include/krb5/plugin.h $(top_srcdir)/include/port-sockets.h \ - $(top_srcdir)/include/socket-utils.h fuzz_pac.c -$(OUTPRE)fuzz_profile.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(srcdir)/../../util/profile/prof_int.h \ - $(top_srcdir)/include/k5-err.h $(top_srcdir)/include/k5-platform.h \ - $(top_srcdir)/include/k5-plugin.h $(top_srcdir)/include/k5-thread.h \ - fuzz_profile.c -$(OUTPRE)fuzz_util.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(srcdir)/../../util/support/hashtab.c \ - $(top_srcdir)/include/k5-base64.h $(top_srcdir)/include/k5-buf.h \ - $(top_srcdir)/include/k5-err.h $(top_srcdir)/include/k5-gmt_mktime.h \ - $(top_srcdir)/include/k5-hashtab.h $(top_srcdir)/include/k5-hex.h \ - $(top_srcdir)/include/k5-int-pkinit.h $(top_srcdir)/include/k5-int.h \ - $(top_srcdir)/include/k5-platform.h $(top_srcdir)/include/k5-plugin.h \ - $(top_srcdir)/include/k5-queue.h $(top_srcdir)/include/k5-thread.h \ - $(top_srcdir)/include/k5-trace.h $(top_srcdir)/include/k5-utf8.h \ - $(top_srcdir)/include/krb5.h $(top_srcdir)/include/krb5/authdata_plugin.h \ - $(top_srcdir)/include/krb5/plugin.h $(top_srcdir)/include/port-sockets.h \ - $(top_srcdir)/include/socket-utils.h fuzz_util.c diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_aes.c b/crypto/krb5/src/tests/fuzzing/fuzz_aes.c deleted file mode 100644 index ea4d8492ba19..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_aes.c +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_aes.c - fuzzing harness for AES encryption/decryption */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "autoconf.h" -#include <k5-int.h> -#include <crypto_int.h> - -#define kMinInputLength 48 -#define kMaxInputLength 512 - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -static void -fuzz_aes(const uint8_t *data, size_t size, size_t key_size, krb5_enctype etype) -{ - krb5_error_code ret; - krb5_keyblock keyblock; - krb5_crypto_iov iov; - krb5_key key = NULL; - char *aeskey = NULL, *data_in = NULL; - char encivbuf[16] = { 0 }, decivbuf[16] = { 0 }; - krb5_data enciv = make_data(encivbuf, 16), deciv = make_data(decivbuf, 16); - - aeskey = k5memdup(data, key_size, &ret); - if (ret) - return; - - data_in = k5memdup(data + key_size, size - key_size, &ret); - if (ret) - goto cleanup; - - keyblock.contents = (krb5_octet *)aeskey; - keyblock.length = key_size; - keyblock.enctype = etype; - - ret = krb5_k_create_key(NULL, &keyblock, &key); - if (ret) - goto cleanup; - - iov.flags = KRB5_CRYPTO_TYPE_DATA; - iov.data = make_data(data_in, size - key_size); - - /* iov.data.data is input and output buffer */ - ret = krb5int_aes_encrypt(key, &enciv, &iov, 1); - if (ret) - goto cleanup; - - ret = krb5int_aes_decrypt(key, &deciv, &iov, 1); - if (ret) - goto cleanup; - - /* Check that decryption result matches original plaintext. */ - ret = memcmp(data_in, data + key_size, size - key_size); - if (ret) - abort(); - - (void)krb5int_aes_decrypt(key, &deciv, &iov, 1); - -cleanup: - free(aeskey); - free(data_in); - krb5_k_free_key(NULL, key); -} - -int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - fuzz_aes(data, size, 16, ENCTYPE_AES128_CTS_HMAC_SHA1_96); - fuzz_aes(data, size, 16, ENCTYPE_AES256_CTS_HMAC_SHA1_96); - fuzz_aes(data, size, 32, ENCTYPE_AES128_CTS_HMAC_SHA1_96); - fuzz_aes(data, size, 32, ENCTYPE_AES256_CTS_HMAC_SHA1_96); - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_aes_seed_corpus/input.bin b/crypto/krb5/src/tests/fuzzing/fuzz_aes_seed_corpus/input.bin deleted file mode 100644 index 5e4c069476b7..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_aes_seed_corpus/input.bin +++ /dev/null @@ -1 +0,0 @@ -I would like the General Gau's Chicken, please, and wonton soup.
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn.c b/crypto/krb5/src/tests/fuzzing/fuzz_asn.c deleted file mode 100644 index be3fdb71ded9..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn.c +++ /dev/null @@ -1,188 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_asn.c - fuzzing harness for ASN.1 encoding/decoding */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "autoconf.h" -#include <k5-spake.h> - -#define kMinInputLength 2 -#define kMaxInputLength 2048 - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -static void -free_cred_enc_part_whole(krb5_context ctx, krb5_cred_enc_part *val) -{ - krb5_free_cred_enc_part(ctx, val); - free(val); -} - -static void -free_kkdcp_message(krb5_context context, krb5_kkdcp_message *val) -{ - if (val == NULL) - return; - free(val->kerb_message.data); - free(val->target_domain.data); - free(val); -} - -#define FUZZ_ASAN(type, encoder, decoder, freefn) do { \ - type *v; \ - krb5_data *data_out = NULL; \ - \ - if ((*decoder)(&data_in, &v) != 0) \ - break; \ - \ - (*encoder)(v, &data_out); \ - krb5_free_data(context, data_out); \ - (*freefn)(context, v); \ - } while (0) - -int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - krb5_context context; - krb5_data data_in; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - if (krb5_init_context(&context)) - return 0; - - data_in = make_data((void *)data, size); - - /* Adapted from krb5_decode_leak.c */ - FUZZ_ASAN(krb5_authenticator, encode_krb5_authenticator, - decode_krb5_authenticator, krb5_free_authenticator); - FUZZ_ASAN(krb5_ticket, encode_krb5_ticket, decode_krb5_ticket, - krb5_free_ticket); - FUZZ_ASAN(krb5_keyblock, encode_krb5_encryption_key, - decode_krb5_encryption_key, krb5_free_keyblock); - FUZZ_ASAN(krb5_enc_tkt_part, encode_krb5_enc_tkt_part, - decode_krb5_enc_tkt_part, krb5_free_enc_tkt_part); - FUZZ_ASAN(krb5_enc_kdc_rep_part, encode_krb5_enc_kdc_rep_part, - decode_krb5_enc_kdc_rep_part, krb5_free_enc_kdc_rep_part); - FUZZ_ASAN(krb5_kdc_rep, encode_krb5_as_rep, decode_krb5_as_rep, - krb5_free_kdc_rep); - FUZZ_ASAN(krb5_kdc_rep, encode_krb5_tgs_rep, decode_krb5_tgs_rep, - krb5_free_kdc_rep); - FUZZ_ASAN(krb5_ap_req, encode_krb5_ap_req, decode_krb5_ap_req, - krb5_free_ap_req); - FUZZ_ASAN(krb5_ap_rep, encode_krb5_ap_rep, decode_krb5_ap_rep, - krb5_free_ap_rep); - FUZZ_ASAN(krb5_ap_rep_enc_part, encode_krb5_ap_rep_enc_part, - decode_krb5_ap_rep_enc_part, krb5_free_ap_rep_enc_part); - FUZZ_ASAN(krb5_kdc_req, encode_krb5_as_req, decode_krb5_as_req, - krb5_free_kdc_req); - FUZZ_ASAN(krb5_kdc_req, encode_krb5_tgs_req, decode_krb5_tgs_req, - krb5_free_kdc_req); - FUZZ_ASAN(krb5_kdc_req, encode_krb5_kdc_req_body, decode_krb5_kdc_req_body, - krb5_free_kdc_req); - FUZZ_ASAN(krb5_safe, encode_krb5_safe, decode_krb5_safe, krb5_free_safe); - FUZZ_ASAN(krb5_priv, encode_krb5_priv, decode_krb5_priv, krb5_free_priv); - FUZZ_ASAN(krb5_priv_enc_part, encode_krb5_enc_priv_part, - decode_krb5_enc_priv_part, krb5_free_priv_enc_part); - FUZZ_ASAN(krb5_cred, encode_krb5_cred, decode_krb5_cred, krb5_free_cred); - FUZZ_ASAN(krb5_cred_enc_part, encode_krb5_enc_cred_part, - decode_krb5_enc_cred_part, free_cred_enc_part_whole); - FUZZ_ASAN(krb5_error, encode_krb5_error, decode_krb5_error, - krb5_free_error); - FUZZ_ASAN(krb5_authdata *, encode_krb5_authdata, decode_krb5_authdata, - krb5_free_authdata); - FUZZ_ASAN(krb5_pa_data *, encode_krb5_padata_sequence, - decode_krb5_padata_sequence, krb5_free_pa_data); - FUZZ_ASAN(krb5_pa_data *, encode_krb5_typed_data, - decode_krb5_typed_data, krb5_free_pa_data); - FUZZ_ASAN(krb5_etype_info_entry *, encode_krb5_etype_info, - decode_krb5_etype_info, krb5_free_etype_info); - FUZZ_ASAN(krb5_etype_info_entry *, encode_krb5_etype_info2, - decode_krb5_etype_info2, krb5_free_etype_info); - FUZZ_ASAN(krb5_pa_enc_ts, encode_krb5_pa_enc_ts, decode_krb5_pa_enc_ts, - krb5_free_pa_enc_ts); - FUZZ_ASAN(krb5_enc_data, encode_krb5_enc_data, decode_krb5_enc_data, - krb5_free_enc_data); - FUZZ_ASAN(krb5_sam_challenge_2, encode_krb5_sam_challenge_2, - decode_krb5_sam_challenge_2, krb5_free_sam_challenge_2); - FUZZ_ASAN(krb5_sam_challenge_2_body, encode_krb5_sam_challenge_2_body, - decode_krb5_sam_challenge_2_body, - krb5_free_sam_challenge_2_body); - FUZZ_ASAN(krb5_sam_response_2, encode_krb5_sam_response_2, - decode_krb5_sam_response_2, krb5_free_sam_response_2); - FUZZ_ASAN(krb5_enc_sam_response_enc_2, encode_krb5_enc_sam_response_enc_2, - decode_krb5_enc_sam_response_enc_2, - krb5_free_enc_sam_response_enc_2); - FUZZ_ASAN(krb5_pa_for_user, encode_krb5_pa_for_user, - decode_krb5_pa_for_user, krb5_free_pa_for_user); - FUZZ_ASAN(krb5_pa_s4u_x509_user, encode_krb5_pa_s4u_x509_user, - decode_krb5_pa_s4u_x509_user, krb5_free_pa_s4u_x509_user); - FUZZ_ASAN(krb5_ad_kdcissued, encode_krb5_ad_kdcissued, - decode_krb5_ad_kdcissued, krb5_free_ad_kdcissued); - FUZZ_ASAN(krb5_iakerb_header, encode_krb5_iakerb_header, - decode_krb5_iakerb_header, krb5_free_iakerb_header); - FUZZ_ASAN(krb5_iakerb_finished, encode_krb5_iakerb_finished, - decode_krb5_iakerb_finished, krb5_free_iakerb_finished); - FUZZ_ASAN(krb5_fast_response, encode_krb5_fast_response, - decode_krb5_fast_response, krb5_free_fast_response); - FUZZ_ASAN(krb5_enc_data, encode_krb5_pa_fx_fast_reply, - decode_krb5_pa_fx_fast_reply, krb5_free_enc_data); - - /* Adapted from krb5_encode_test.c */ - FUZZ_ASAN(krb5_otp_tokeninfo, encode_krb5_otp_tokeninfo, - decode_krb5_otp_tokeninfo, k5_free_otp_tokeninfo); - FUZZ_ASAN(krb5_pa_otp_challenge, encode_krb5_pa_otp_challenge, - decode_krb5_pa_otp_challenge, k5_free_pa_otp_challenge); - FUZZ_ASAN(krb5_pa_otp_req, encode_krb5_pa_otp_req, decode_krb5_pa_otp_req, - k5_free_pa_otp_req); - FUZZ_ASAN(krb5_data, encode_krb5_pa_otp_enc_req, - decode_krb5_pa_otp_enc_req, krb5_free_data); - FUZZ_ASAN(krb5_kkdcp_message, encode_krb5_kkdcp_message, - decode_krb5_kkdcp_message, free_kkdcp_message); - FUZZ_ASAN(krb5_cammac, encode_krb5_cammac, decode_krb5_cammac, - k5_free_cammac); - FUZZ_ASAN(krb5_secure_cookie, encode_krb5_secure_cookie, - decode_krb5_secure_cookie, k5_free_secure_cookie); - FUZZ_ASAN(krb5_spake_factor, encode_krb5_spake_factor, - decode_krb5_spake_factor, k5_free_spake_factor); - FUZZ_ASAN(krb5_pa_spake, encode_krb5_pa_spake, decode_krb5_pa_spake, - k5_free_pa_spake); - - /* Adapted from krb5_decode_test.c */ - { - krb5_pa_pac_req *pa_pac_req = NULL; - - if (decode_krb5_pa_pac_req(&data_in, &pa_pac_req) == 0) - free(pa_pac_req); - } - - krb5_free_context(context); - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_authenticator_3.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_authenticator_3.bin Binary files differdeleted file mode 100644 index 26c78993edb1..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_authenticator_3.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_authenticator_4.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_authenticator_4.bin Binary files differdeleted file mode 100644 index 6add5a8412c3..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_authenticator_4.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_authenticator_6.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_authenticator_6.bin deleted file mode 100644 index dc2f08684e14..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_authenticator_6.bin +++ /dev/null @@ -1,2 +0,0 @@ -b¤0¡ ¡ATHENA.MIT.EDU¢0 ¡0hftsaiextra£0
¡1234¤â@¥19940610060317Z¦0 ¡ -12345678§ÿÿÿÿ¨$0"0 ¡foobar0 ¡foobar
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_enc_tkt_part_30.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_enc_tkt_part_30.bin Binary files differdeleted file mode 100644 index 727a70f7db1f..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_enc_tkt_part_30.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_encryption_key_15.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_encryption_key_15.bin deleted file mode 100644 index 842a99d1b790..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_encryption_key_15.bin +++ /dev/null @@ -1,2 +0,0 @@ -0 ¡ -12345678¢0
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_encryption_key_21.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_encryption_key_21.bin deleted file mode 100644 index ae4a8aa5d2e9..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_encryption_key_21.bin +++ /dev/null @@ -1,2 +0,0 @@ -0 ÿ¡ -12345678
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_encryption_key_22.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_encryption_key_22.bin Binary files differdeleted file mode 100644 index 4bbedc1a50e4..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_encryption_key_22.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_encryption_key_24.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_encryption_key_24.bin deleted file mode 100644 index c9ad2a5dc041..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_encryption_key_24.bin +++ /dev/null @@ -1,2 +0,0 @@ -0 ÿÿÿ¡ -12345678
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_fail_encryption_key_16.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_fail_encryption_key_16.bin Binary files differdeleted file mode 100644 index 2b8b75383855..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/decode_fail_encryption_key_16.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_auth_pack_80.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_auth_pack_80.bin deleted file mode 100644 index ff246345f64b..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_auth_pack_80.bin +++ /dev/null @@ -1,4 +0,0 @@ -0… 503 â@¡19940610060317Z¢*£1234¤ -krb5data¡pvalue¢$0"0 *†H†÷params0 *†H†÷£ -krb5data¤00 -krb5data
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_cammac_68.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_cammac_68.bin deleted file mode 100644 index cbd0fd3cb20c..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_cammac_68.bin +++ /dev/null @@ -1 +0,0 @@ -0 00 ¡ad1
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_cammac_69.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_cammac_69.bin deleted file mode 100644 index 522634af2864..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_cammac_69.bin +++ /dev/null @@ -1,3 +0,0 @@ -0ò 00 ¡ad10 ¡ad2¡=0; 0 ¡0hftsaiextra¡¢£0 ¡ -cksumkdc¢=0; 0 ¡0hftsaiextra¡¢£0 ¡ -cksumsvc£R0P0£0 ¡cksum109 0 ¡0hftsaiextra¡¢£0 ¡cksum2
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_enc_data_47.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_enc_data_47.bin Binary files differdeleted file mode 100644 index 2cec584d9f4d..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_enc_data_47.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_kdc_dh_key_info_81.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_kdc_dh_key_info_81.bin Binary files differdeleted file mode 100644 index a3427389f37e..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_kdc_dh_key_info_81.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_kkdcp_message_67.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_kkdcp_message_67.bin Binary files differdeleted file mode 100644 index 5c52c94176bb..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_kkdcp_message_67.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_ad_kdcissued_54.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_ad_kdcissued_54.bin deleted file mode 100644 index 973cd47bfd3d..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_ad_kdcissued_54.bin +++ /dev/null @@ -1 +0,0 @@ -0e 0
¡1234¡ATHENA.MIT.EDU¢0 ¡0hftsaiextra£$0"0 ¡foobar0 ¡foobar
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_ap_rep_enc_part_16.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_ap_rep_enc_part_16.bin deleted file mode 100644 index 3a7dcd135f86..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_ap_rep_enc_part_16.bin +++ /dev/null @@ -1 +0,0 @@ -{0 19940610060317Z¡â@
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_ap_req_14.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_ap_req_14.bin Binary files differdeleted file mode 100644 index 1e1861dd72a5..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_ap_req_14.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_as_rep_10.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_as_rep_10.bin Binary files differdeleted file mode 100644 index 6cb6811438de..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_as_rep_10.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_as_req_19.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_as_req_19.bin Binary files differdeleted file mode 100644 index 63f41f884c1a..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_as_req_19.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_authdata_36.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_authdata_36.bin deleted file mode 100644 index ff84a122e0cb..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_authdata_36.bin +++ /dev/null @@ -1 +0,0 @@ -0"0 ¡foobar0 ¡foobar
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_authenticator_2.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_authenticator_2.bin deleted file mode 100644 index 7eb31e6e2333..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_authenticator_2.bin +++ /dev/null @@ -1 +0,0 @@ -bO0M ¡ATHENA.MIT.EDU¢0 ¡0hftsaiextra¤â@¥19940610060317Z
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_cred_31.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_cred_31.bin Binary files differdeleted file mode 100644 index 33f21c8627c1..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_cred_31.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_cred_part_32.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_cred_part_32.bin Binary files differdeleted file mode 100644 index 968faa53ee2e..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_cred_part_32.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_cred_part_33.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_cred_part_33.bin Binary files differdeleted file mode 100644 index e7d4d821db34..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_cred_part_33.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_kdc_rep_part_8.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_kdc_rep_part_8.bin Binary files differdeleted file mode 100644 index 318415638640..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_kdc_rep_part_8.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_priv_part_29.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_priv_part_29.bin Binary files differdeleted file mode 100644 index 9e2574c1c932..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_priv_part_29.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_priv_part_30.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_priv_part_30.bin Binary files differdeleted file mode 100644 index 3c6f5d549c60..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_priv_part_30.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_tkt_part_5.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_tkt_part_5.bin Binary files differdeleted file mode 100644 index 5f74aeb23dbf..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_tkt_part_5.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_tkt_part_7.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_tkt_part_7.bin Binary files differdeleted file mode 100644 index a674aadb77ac..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_enc_tkt_part_7.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_error_34.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_error_34.bin deleted file mode 100644 index 439eb171ceee..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_error_34.bin +++ /dev/null @@ -1,3 +0,0 @@ -~º0· ¡¢19940610060317Z£â@¤19940610060317Z¥â@¦<§ATHENA.MIT.EDU¨0 ¡0hftsaiextra©ATHENA.MIT.EDUª0 ¡0hftsaiextra« -krb5data¬ -krb5data
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_error_35.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_error_35.bin deleted file mode 100644 index 588e77546add..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_error_35.bin +++ /dev/null @@ -1 +0,0 @@ -~`0^ ¡£â@¤19940610060317Z¥â@¦<©ATHENA.MIT.EDUª0 ¡0hftsaiextra
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_etype_info2_43.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_etype_info2_43.bin Binary files differdeleted file mode 100644 index c1bacbb8596a..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_etype_info2_43.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_etype_info2_44.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_etype_info2_44.bin Binary files differdeleted file mode 100644 index 14f1ad05f376..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_etype_info2_44.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_etype_info_40.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_etype_info_40.bin Binary files differdeleted file mode 100644 index c34f5bc03b23..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_etype_info_40.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_etype_info_41.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_etype_info_41.bin Binary files differdeleted file mode 100644 index 5672958b5ca6..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_etype_info_41.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_fast_response_57.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_fast_response_57.bin deleted file mode 100644 index e4ff58a7f5b9..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_fast_response_57.bin +++ /dev/null @@ -1,2 +0,0 @@ -0Ÿ &0$0¡
¢ pa-data0¡
¢ pa-data¡0 ¡ -12345678¢[0Y 19940610060317Z¡â@¢ATHENA.MIT.EDU£0 ¡0hftsaiextra¤0
¡1234£*
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_iakerb_finished_56.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_iakerb_finished_56.bin deleted file mode 100644 index 1ef561f50189..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_iakerb_finished_56.bin +++ /dev/null @@ -1 +0,0 @@ -0¡0
¡1234
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_iakerb_header_55.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_iakerb_header_55.bin deleted file mode 100644 index 9d7097829438..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_iakerb_header_55.bin +++ /dev/null @@ -1,3 +0,0 @@ -0¡ -krb5data¢ -krb5data
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_kdc_req_body_24.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_kdc_req_body_24.bin Binary files differdeleted file mode 100644 index 1f274fa96923..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_kdc_req_body_24.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_tgs_rep_13.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_tgs_rep_13.bin Binary files differdeleted file mode 100644 index b46dd44b0666..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_tgs_rep_13.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_tgs_req_23.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_tgs_req_23.bin Binary files differdeleted file mode 100644 index e925ec4d7035..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_krb5_tgs_req_23.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_otp_tokeninfo_61.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_otp_tokeninfo_61.bin Binary files differdeleted file mode 100644 index 61a1d1dfb0cf..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_otp_tokeninfo_61.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_enc_ts (no usec)_45.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_enc_ts (no usec)_45.bin deleted file mode 100644 index 127099627f6f..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_enc_ts (no usec)_45.bin +++ /dev/null @@ -1 +0,0 @@ -0 19940610060317Z
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_for_user_53.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_for_user_53.bin deleted file mode 100644 index c1249ff70092..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_for_user_53.bin +++ /dev/null @@ -1,2 +0,0 @@ -0K 0 ¡0hftsaiextra¡ATHENA.MIT.EDU¢0
¡1234£ -krb5data
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_fx_fast_reply_59.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_fx_fast_reply_59.bin Binary files differdeleted file mode 100644 index 2218e2bbe1fb..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_fx_fast_reply_59.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_otp_challenge_63.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_otp_challenge_63.bin Binary files differdeleted file mode 100644 index 119997b0088d..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_otp_challenge_63.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_otp_req_64.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_otp_req_64.bin Binary files differdeleted file mode 100644 index b5b27f372cbc..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_otp_req_64.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_otp_req_65.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_otp_req_65.bin Binary files differdeleted file mode 100644 index 3490a8d66d31..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_otp_req_65.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_pk_as_rep_78.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_pk_as_rep_78.bin deleted file mode 100644 index 52bff24122c6..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_pk_as_rep_78.bin +++ /dev/null @@ -1,3 +0,0 @@ - (0&€krb5data¡ -krb5data¢0 -krb5data
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_pk_as_rep_79.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_pk_as_rep_79.bin deleted file mode 100644 index 35d75453dfb4..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_pk_as_rep_79.bin +++ /dev/null @@ -1 +0,0 @@ -krb5data
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_s4u_x509_user_54.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_s4u_x509_user_54.bin Binary files differdeleted file mode 100644 index 595a37cde091..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_s4u_x509_user_54.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_spake_73.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_spake_73.bin deleted file mode 100644 index d394484aad4d..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_spake_73.bin +++ /dev/null @@ -1,2 +0,0 @@ - 0 - 0
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_spake_74.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_spake_74.bin deleted file mode 100644 index d2e4cb2a41a7..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_spake_74.bin +++ /dev/null @@ -1 +0,0 @@ -¡-0+ ¡ T value¢00 0 ¡fdata
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_spake_75.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_spake_75.bin Binary files differdeleted file mode 100644 index 51dcdc0ad82d..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_spake_75.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_spake_76.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_spake_76.bin Binary files differdeleted file mode 100644 index 1b9a8f86155e..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_pa_spake_76.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_padata_sequence_38.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_padata_sequence_38.bin Binary files differdeleted file mode 100644 index def7fcb589b9..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_padata_sequence_38.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_priv_28.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_priv_28.bin Binary files differdeleted file mode 100644 index 178ba448812b..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_priv_28.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_reply_key_pack_82.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_reply_key_pack_82.bin deleted file mode 100644 index 8657c7c56c90..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_reply_key_pack_82.bin +++ /dev/null @@ -1,2 +0,0 @@ -0& 0 ¡ -12345678¡0
¡1234
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_safe_26.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_safe_26.bin Binary files differdeleted file mode 100644 index 71f6ab3cba88..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_safe_26.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_safe_27.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_safe_27.bin Binary files differdeleted file mode 100644 index 736c6f0b3826..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_safe_27.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_sam_challenge_2_49.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_sam_challenge_2_49.bin deleted file mode 100644 index 62942bd8aca6..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_sam_challenge_2_49.bin +++ /dev/null @@ -1 +0,0 @@ -0"
0 challenge¡00
¡1234
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_sam_challenge_2_body_50.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_sam_challenge_2_body_50.bin Binary files differdeleted file mode 100644 index dd624bb4a99a..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_sam_challenge_2_body_50.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_sam_response_2_51.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_sam_response_2_51.bin Binary files differdeleted file mode 100644 index 430f6f0e2d70..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_sam_response_2_51.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_secure_cookie_70.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_secure_cookie_70.bin deleted file mode 100644 index 00a4f477bbad..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_secure_cookie_70.bin +++ /dev/null @@ -1 +0,0 @@ -0,-ø%0$0¡
¢ pa-data0¡
¢ pa-data
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_sp80056a_other_info_83.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_sp80056a_other_info_83.bin deleted file mode 100644 index 3639de9e6360..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_sp80056a_other_info_83.bin +++ /dev/null @@ -1,2 +0,0 @@ -00 *†H†÷ 200. ATHENA.MIT.EDU¡0 ¡0hftsaiextra¡200. ATHENA.MIT.EDU¡0 ¡0hftsaiextra¢ -krb5data
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_spake_factor_71.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_spake_factor_71.bin deleted file mode 100644 index 6dfd6ad0b017..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_spake_factor_71.bin +++ /dev/null @@ -1 +0,0 @@ -0
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_tgs_rep_11.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_tgs_rep_11.bin Binary files differdeleted file mode 100644 index 0ca8532f6364..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_tgs_rep_11.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_tgs_rep_12.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_tgs_rep_12.bin Binary files differdeleted file mode 100644 index cd2ac5415520..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_tgs_rep_12.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_tgs_req_20.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_tgs_req_20.bin Binary files differdeleted file mode 100644 index b56f57d514ae..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_tgs_req_20.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_tgs_req_21.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_tgs_req_21.bin Binary files differdeleted file mode 100644 index eb8a40ff78a1..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_tgs_req_21.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_ticket_3.bin b/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_ticket_3.bin Binary files differdeleted file mode 100644 index 68efbe14af4a..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_asn_seed_corpus/encode_ticket_3.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_attrset.c b/crypto/krb5/src/tests/fuzzing/fuzz_attrset.c deleted file mode 100644 index 5c1a8d604138..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_attrset.c +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_attrset.c - fuzzing harness for kr_attrset functions */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "autoconf.h" -#include <k5-int.h> -#include <internal.h> - -#define kMinInputLength 2 -#define kMaxInputLength 1024 - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - krb5_error_code ret; - krb5_context context; - krad_attrset *set; - krb5_data data_in; - uint8_t buffer[KRAD_PACKET_SIZE_MAX], auth[MD5_DIGEST_SIZE] = { 0 }; - size_t encode_len; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - data_in = make_data((void *)data, size); - - ret = krb5_init_context(&context); - if (ret) - return 0; - - ret = kr_attrset_decode(context, &data_in, "f", auth, &set); - if (!ret) - kr_attrset_encode(set, "f", auth, FALSE, buffer, &encode_len); - - krad_attrset_free(set); - krb5_free_context(context); - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_attrset_seed_corpus/t_attrset.bin b/crypto/krb5/src/tests/fuzzing/fuzz_attrset_seed_corpus/t_attrset.bin deleted file mode 100644 index aceceefa7a38..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_attrset_seed_corpus/t_attrset.bin +++ /dev/null @@ -1,2 +0,0 @@ - -testUserXÿÚ7ùäÊ®I·mX'
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_chpw.c b/crypto/krb5/src/tests/fuzzing/fuzz_chpw.c deleted file mode 100644 index dfa6dfda60b8..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_chpw.c +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_chpw.c */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Fuzzing harness implementation for krb5_chpw_message. - */ - -#include "autoconf.h" -#include <k5-int.h> - -#define kMinInputLength 2 -#define kMaxInputLength 512 - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - char *msg; - krb5_data data_in; - krb5_context context; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - data_in = make_data((void *)data, size); - - if (krb5_init_context(&context) != 0) - return 0; - - if (krb5_chpw_message(context, &data_in, &msg) == 0) - free(msg); - - krb5_free_context(context); - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_ad_age.bin b/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_ad_age.bin Binary files differdeleted file mode 100644 index cf3ccef4213b..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_ad_age.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_ad_all.bin b/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_ad_all.bin Binary files differdeleted file mode 100644 index 77f9336fd553..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_ad_all.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_ad_complex.bin b/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_ad_complex.bin Binary files differdeleted file mode 100644 index 7e9a56f99a28..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_ad_complex.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_ad_history.bin b/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_ad_history.bin Binary files differdeleted file mode 100644 index 5682bd708a99..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_ad_history.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_ad_length.bin b/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_ad_length.bin Binary files differdeleted file mode 100644 index dda723cc1d6c..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_ad_length.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_invalid_utf8.bin b/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_invalid_utf8.bin Binary files differdeleted file mode 100644 index f1f4ef55fdb4..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_invalid_utf8.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_utf8.bin b/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_utf8.bin deleted file mode 100644 index 3a20212ae9cb..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_chpw_seed_corpus/result_utf8.bin +++ /dev/null @@ -1 +0,0 @@ -This is a valid string.
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_crypto.c b/crypto/krb5/src/tests/fuzzing/fuzz_crypto.c deleted file mode 100644 index 2bd52e62979c..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_crypto.c +++ /dev/null @@ -1,171 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_crypto.c - fuzzing harness for general crypto */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "autoconf.h" -#include <k5-int.h> -#include <crypto_int.h> - -#define kMinInputLength 2 -#define kMaxInputLength 512 - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -static void -fuzz_checksum(krb5_cksumtype sumtype, krb5_keyblock keyblock, - krb5_keyusage usage, krb5_data data) -{ - krb5_error_code ret; - krb5_checksum cksum; - krb5_boolean valid; - - ret = krb5_c_make_checksum(NULL, sumtype, &keyblock, usage, &data, &cksum); - if (ret) - return; - - ret = krb5_c_verify_checksum(NULL, &keyblock, usage, &data, &cksum, - &valid); - if (ret || !valid) - abort(); - - krb5_free_checksum_contents(NULL, &cksum); -} - -static void -fuzz_crypt(krb5_keyblock keyblock, krb5_enctype enctype, - krb5_keyusage usage, krb5_data data) -{ - krb5_error_code ret; - krb5_enc_data encoded = { 0 }; - krb5_data decoded = empty_data(); - size_t enclen; - - ret = krb5_c_encrypt_length(NULL, enctype, data.length, &enclen); - if (ret) - return; - - encoded.magic = KV5M_ENC_DATA; - encoded.enctype = enctype; - - ret = alloc_data(&encoded.ciphertext, enclen); - if (ret) - return; - - ret = alloc_data(&decoded, data.length); - if (ret) { - krb5_free_data_contents(NULL, &encoded.ciphertext); - return; - } - - ret = krb5_c_encrypt(NULL, &keyblock, usage, NULL, &data, &encoded); - if (ret) - goto cleanup; - - ret = krb5_c_decrypt(NULL, &keyblock, usage, NULL, &encoded, &decoded); - if (ret) - goto cleanup; - - if (memcmp(data.data, decoded.data, data.length) != 0) - abort(); - -cleanup: - krb5_free_data_contents(NULL, &encoded.ciphertext); - krb5_free_data_contents(NULL, &decoded); -} - -static void -fuzz_prf(krb5_keyblock keyblock, krb5_enctype enctype, krb5_data data) -{ - krb5_error_code ret; - krb5_data output; - size_t prfsz; - - ret = krb5_c_prf_length(NULL, enctype, &prfsz); - if (ret) - return; - - ret = alloc_data(&output, prfsz); - if (ret) - return; - - krb5_c_prf(NULL, &keyblock, &data, &output); - - krb5_free_data_contents(NULL, &output); -} - -static void -fuzz_setup(krb5_enctype enctype, krb5_cksumtype sumtype, - krb5_keyusage usage, krb5_data data) -{ - krb5_error_code ret; - krb5_keyblock keyblock; - - ret = krb5_c_make_random_key(NULL, enctype, &keyblock); - if (ret) - return; - - fuzz_checksum(sumtype, keyblock, usage, data); - fuzz_crypt(keyblock, enctype, usage, data); - fuzz_prf(keyblock, enctype, data); - - krb5_free_keyblock_contents(NULL, &keyblock); -} - -int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - krb5_data data_in; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - data_in = make_data((void *)data, size); - - fuzz_setup(ENCTYPE_DES3_CBC_SHA1, CKSUMTYPE_HMAC_SHA1_DES3, 0, data_in); - fuzz_setup(ENCTYPE_ARCFOUR_HMAC, CKSUMTYPE_MD5_HMAC_ARCFOUR, 1, data_in); - fuzz_setup(ENCTYPE_ARCFOUR_HMAC, CKSUMTYPE_HMAC_MD5_ARCFOUR, 2, data_in); - fuzz_setup(ENCTYPE_ARCFOUR_HMAC_EXP, CKSUMTYPE_RSA_MD4, 3, data_in); - fuzz_setup(ENCTYPE_ARCFOUR_HMAC_EXP, CKSUMTYPE_RSA_MD5, 4, data_in); - fuzz_setup(ENCTYPE_ARCFOUR_HMAC_EXP, CKSUMTYPE_SHA1, 5, data_in); - fuzz_setup(ENCTYPE_AES128_CTS_HMAC_SHA1_96, CKSUMTYPE_HMAC_SHA1_96_AES128, - 6, data_in); - fuzz_setup(ENCTYPE_AES256_CTS_HMAC_SHA1_96, CKSUMTYPE_HMAC_SHA1_96_AES256, - 7, data_in); - fuzz_setup(ENCTYPE_CAMELLIA128_CTS_CMAC, CKSUMTYPE_CMAC_CAMELLIA128, - 8, data_in); - fuzz_setup(ENCTYPE_CAMELLIA256_CTS_CMAC, CKSUMTYPE_CMAC_CAMELLIA256, - 9, data_in); - fuzz_setup(ENCTYPE_AES128_CTS_HMAC_SHA256_128, - CKSUMTYPE_HMAC_SHA256_128_AES128, 10, data_in); - fuzz_setup(ENCTYPE_AES256_CTS_HMAC_SHA384_192, - CKSUMTYPE_HMAC_SHA384_192_AES256, 11, data_in); - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_crypto_seed_corpus/input.bin b/crypto/krb5/src/tests/fuzzing/fuzz_crypto_seed_corpus/input.bin deleted file mode 100644 index 13f3fcbe0588..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_crypto_seed_corpus/input.bin +++ /dev/null @@ -1 +0,0 @@ -brrr
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_des.c b/crypto/krb5/src/tests/fuzzing/fuzz_des.c deleted file mode 100644 index 08efb38b2979..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_des.c +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_des.c - fuzzing harness for DES functions */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "autoconf.h" -#include <k5-int.h> -#include <des_int.h> - -#include <f_cbc.c> - -#define kMinInputLength 32 -#define kMaxInputLength 128 - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -uint8_t default_ivec[8] = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF }; - -static void -fuzz_des(uint8_t *input, mit_des_key_schedule sched) -{ - uint8_t encrypt[8], decrypt[8]; - - mit_des_cbc_encrypt((const mit_des_cblock *)input, - (mit_des_cblock *)encrypt, 8, - sched, default_ivec, MIT_DES_ENCRYPT); - - mit_des_cbc_encrypt((const mit_des_cblock *)encrypt, - (mit_des_cblock *)decrypt, 8, - sched, default_ivec, MIT_DES_DECRYPT); - - if (memcmp(input, decrypt, 8) != 0) - abort(); -} - -static void -fuzz_decrypt(uint8_t *input, mit_des_key_schedule sched) -{ - uint8_t output[8]; - - mit_des_cbc_encrypt((const mit_des_cblock *)input, - (mit_des_cblock *)output, 8, - sched, default_ivec, MIT_DES_DECRYPT); -} - -static void -fuzz_cksum(uint8_t *input, mit_des_key_schedule sched) -{ - uint8_t output[8]; - - mit_des_cbc_cksum(input, output, 8, sched, default_ivec); -} - -int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - krb5_error_code ret; - mit_des_key_schedule sched; - uint8_t *data_in, input[8]; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - memcpy(input, data, 8); - ret = mit_des_key_sched(input, sched); - if (ret) - return 0; - - memcpy(input, data + 8, 8); - fuzz_des(input, sched); - - memcpy(input, data + 16, 8); - fuzz_decrypt(input, sched); - - data_in = k5memdup(data + 24, size - 24, &ret); - if (ret) - return 0; - - fuzz_cksum(data_in, sched); - free(data_in); - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_des_seed_corpus/input.bin b/crypto/krb5/src/tests/fuzzing/fuzz_des_seed_corpus/input.bin deleted file mode 100644 index 6607c59ab3b3..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_des_seed_corpus/input.bin +++ /dev/null @@ -1 +0,0 @@ -brrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_gss.c b/crypto/krb5/src/tests/fuzzing/fuzz_gss.c deleted file mode 100644 index 3c65f34fd01f..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_gss.c +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_gss.c */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Fuzzing harness implementation for gss_accept_sec_context. - */ - -#include "autoconf.h" -#include <krb5.h> -#include <gssapi.h> -#include <string.h> - -#define kMinInputLength 2 -#define kMaxInputLength 1024 - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - gss_OID doid; - OM_uint32 minor, ret_flags, time_rec; - gss_name_t client = GSS_C_NO_NAME; - gss_ctx_id_t context = GSS_C_NO_CONTEXT; - gss_cred_id_t deleg_cred = GSS_C_NO_CREDENTIAL; - gss_buffer_desc data_in, data_out = GSS_C_EMPTY_BUFFER; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - data_in.length = size; - data_in.value = (void *)data; - - gss_accept_sec_context(&minor, &context, GSS_C_NO_CREDENTIAL, - &data_in, GSS_C_NO_CHANNEL_BINDINGS, &client, - &doid, &data_out, &ret_flags, &time_rec, - &deleg_cred); - - gss_release_buffer(&minor, &data_out); - - if (context != GSS_C_NO_CONTEXT) - gss_delete_sec_context(&minor, &context, GSS_C_NO_BUFFER); - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_gss_seed_corpus/establish_contexts_ex.bin b/crypto/krb5/src/tests/fuzzing/fuzz_gss_seed_corpus/establish_contexts_ex.bin Binary files differdeleted file mode 100644 index 9e2a8d765a81..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_gss_seed_corpus/establish_contexts_ex.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_gss_seed_corpus/gss_accept_sec_context_kerberos.bin b/crypto/krb5/src/tests/fuzzing/fuzz_gss_seed_corpus/gss_accept_sec_context_kerberos.bin Binary files differdeleted file mode 100644 index 9bc9afdd7849..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_gss_seed_corpus/gss_accept_sec_context_kerberos.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_gss_seed_corpus/gss_accept_sec_context_spnego.bin b/crypto/krb5/src/tests/fuzzing/fuzz_gss_seed_corpus/gss_accept_sec_context_spnego.bin Binary files differdeleted file mode 100644 index a191e0a59f0f..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_gss_seed_corpus/gss_accept_sec_context_spnego.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_gss_seed_corpus/realm_query.bin b/crypto/krb5/src/tests/fuzzing/fuzz_gss_seed_corpus/realm_query.bin Binary files differdeleted file mode 100644 index 2178d65a04b6..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_gss_seed_corpus/realm_query.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_gss_seed_corpus/start_accept_context.bin b/crypto/krb5/src/tests/fuzzing/fuzz_gss_seed_corpus/start_accept_context.bin Binary files differdeleted file mode 100644 index 980b6484d3dc..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_gss_seed_corpus/start_accept_context.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_json.c b/crypto/krb5/src/tests/fuzzing/fuzz_json.c deleted file mode 100644 index a3440eaef1ca..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_json.c +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_json.c */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Fuzzing harness implementation for k5_json_decode. - */ - -#include "autoconf.h" -#include <k5-int.h> -#include <krb5.h> -#include <k5-json.h> -#include <string.h> - -#define kMinInputLength 2 -#define kMaxInputLength 1024 - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - krb5_error_code ret; - k5_json_value decoded = NULL; - char *data_in = NULL, *data_out; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - data_in = k5memdup0(data, size, &ret); - if (data_in == NULL) - return 0; - - ret = k5_json_decode(data_in, &decoded); - if (ret) - goto cleanup; - - ret = k5_json_encode(decoded, &data_out); - if (!ret) - free(data_out); - -cleanup: - free(data_in); - k5_json_release(decoded); - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_json_seed_corpus/seed_1.json b/crypto/krb5/src/tests/fuzzing/fuzz_json_seed_corpus/seed_1.json deleted file mode 100644 index ece1b849b581..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_json_seed_corpus/seed_1.json +++ /dev/null @@ -1 +0,0 @@ - "foo\"bar"
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_json_seed_corpus/seed_2.json b/crypto/krb5/src/tests/fuzzing/fuzz_json_seed_corpus/seed_2.json deleted file mode 100644 index f0bd59cb5491..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_json_seed_corpus/seed_2.json +++ /dev/null @@ -1 +0,0 @@ -{ "k1" : { "k2" : "s2", "k3" : "s3" }, "k4" : "s4" }
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_json_seed_corpus/seed_3.json b/crypto/krb5/src/tests/fuzzing/fuzz_json_seed_corpus/seed_3.json deleted file mode 100644 index 9c4eec71eb1e..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_json_seed_corpus/seed_3.json +++ /dev/null @@ -1 +0,0 @@ - [ -1 ]
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_kdc.c b/crypto/krb5/src/tests/fuzzing/fuzz_kdc.c deleted file mode 100644 index 59457e282c96..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_kdc.c +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_kdc.c - fuzzing harness for KDC replay cache */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "autoconf.h" - -#include <replay.c> - -#define kMinInputLength 2 -#define kMaxInputLength 256 - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - krb5_error_code ret; - krb5_context context = NULL; - krb5_data req, rep; - struct entry *e; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - ret = krb5_init_context(&context); - if (ret) - return 0; - - ret = kdc_init_lookaside(context); - if (ret) - goto cleanup; - - req = make_data((void *)data, size); - rep = make_data((void *)data, size - 1); - - e = insert_entry(context, &req, &rep, 0); - discard_entry(context, e); - - kdc_free_lookaside(context); - -cleanup: - krb5_free_context(context); - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_kdc_seed_corpus/input.bin b/crypto/krb5/src/tests/fuzzing/fuzz_kdc_seed_corpus/input.bin deleted file mode 100644 index 6605099dcbba..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_kdc_seed_corpus/input.bin +++ /dev/null @@ -1 +0,0 @@ -I Had Strings, But now i'm free.
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krad.c b/crypto/krb5/src/tests/fuzzing/fuzz_krad.c deleted file mode 100644 index dbafbf164fb9..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krad.c +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_krad.c */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Fuzzing harness implementation for krad_packet_decode_response, - * krad_packet_decode_request. - */ - -#include "autoconf.h" -#include <k5-int.h> -#include <krad.h> - -#define kMinInputLength 2 -#define kMaxInputLength 1024 - -static krad_packet *packets[3]; - -static const krad_packet * -iterator(void *data, krb5_boolean cancel) -{ - krad_packet *tmp; - int *i = data; - - if (cancel || packets[*i] == NULL) - return NULL; - - tmp = packets[*i]; - *i += 1; - return tmp; -} - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - int i; - krb5_context ctx; - krb5_data data_in; - const char *secret = "f"; - const krad_packet *req_1 = NULL, *req_2 = NULL; - krad_packet *rsp_1 = NULL, *rsp_2 = NULL; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - if (krb5_init_context(&ctx) != 0) - return 0; - - data_in = make_data((void *)data, size); - - i = 0; - krad_packet_decode_response(ctx, secret, &data_in, iterator, &i, - &req_1, &rsp_1); - - i = 0; - krad_packet_decode_request(ctx, secret, &data_in, iterator, &i, - &req_2, &rsp_2); - - krad_packet_free(rsp_1); - krad_packet_free(rsp_2); - krb5_free_context(ctx); - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krad_seed_corpus/do_auth_1.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krad_seed_corpus/do_auth_1.bin Binary files differdeleted file mode 100644 index 02eb9a1cb5e6..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krad_seed_corpus/do_auth_1.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb.c b/crypto/krb5/src/tests/fuzzing/fuzz_krb.c deleted file mode 100644 index 61f16765db58..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb.c +++ /dev/null @@ -1,170 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/krb.c - fuzzing harness for miscellaneous libkrb5 functions */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "autoconf.h" -#include <k5-int.h> - -#define kMinInputLength 2 -#define kMaxInputLength 512 - -#define ANAME_SZ 40 -#define INST_SZ 40 -#define REALM_SZ 40 - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -static void -fuzz_deltat(char *data_in) -{ - krb5_deltat result; - krb5_string_to_deltat(data_in, &result); -} - -static void -fuzz_host_string(char *data_in) -{ - krb5_error_code ret; - char *host; - int port = -1; - - ret = k5_parse_host_string(data_in, 0, &host, &port); - if (!ret) - free(host); -} - -static void -fuzz_princ(krb5_context context, char *data_in) -{ - krb5_error_code ret; - krb5_principal p; - char *princ; - - ret = krb5_parse_name(context, data_in, &p); - if (ret) - return; - - ret = krb5_unparse_name(context, p, &princ); - if (!ret) - free(princ); - - krb5_free_principal(context, p); -} - -static void -fuzz_principal_425(krb5_context context, char *data_in) -{ - krb5_principal princ; - krb5_425_conv_principal(context, data_in, data_in, data_in, &princ); - krb5_free_principal(context, princ); -} - -static void -fuzz_principal_524(krb5_context context, char *data_in) -{ - krb5_error_code ret; - krb5_principal princ = 0; - char aname[ANAME_SZ + 1], inst[INST_SZ + 1], realm[REALM_SZ + 1]; - - aname[ANAME_SZ] = inst[INST_SZ] = realm[REALM_SZ] = 0; - - ret = krb5_parse_name(context, data_in, &princ); - if (ret) - return; - - krb5_524_conv_principal(context, princ, aname, inst, realm); - krb5_free_principal(context, princ); -} - -static void -fuzz_timestamp(char *data_in) -{ - krb5_error_code ret; - krb5_timestamp timestamp; - - ret = krb5_string_to_timestamp(data_in, ×tamp); - if (!ret) - ts2tt(timestamp); -} - -/* - * data_in is going to be modified during parsing. - */ -static void -fuzz_enctype_list(char *data_in) -{ - krb5_error_code ret; - krb5_context context; - krb5_enctype *ienc, zero = 0; - - ret = krb5_init_context(&context); - if (ret) - return; - - ret = krb5int_parse_enctype_list(context, "", data_in, &zero, &ienc); - if (!ret) - free(ienc); - - krb5_free_context(context); -} - -extern int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - krb5_error_code ret; - krb5_context context = NULL; - char *data_in; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - ret = krb5_init_context(&context); - if (ret) - return 0; - - data_in = k5memdup0(data, size, &ret); - if (ret) - goto cleanup; - - fuzz_deltat(data_in); - fuzz_host_string(data_in); - fuzz_princ(context, data_in); - fuzz_principal_425(context, data_in); - fuzz_principal_524(context, data_in); - fuzz_timestamp(data_in); - fuzz_enctype_list(data_in); - - free(data_in); - -cleanup: - krb5_free_context(context); - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb5_ticket.c b/crypto/krb5/src/tests/fuzzing/fuzz_krb5_ticket.c deleted file mode 100644 index 0b541f444c61..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb5_ticket.c +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_krb5_ticket.c */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Fuzzing harness implementation for krb5_decode_ticket. - */ - -#include "autoconf.h" -#include <k5-int.h> -#include <krb5.h> -#include <string.h> - -#define kMinInputLength 2 -#define kMaxInputLength 2048 - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - krb5_error_code ret; - krb5_context context = NULL; - krb5_keytab defkt = NULL; - krb5_data data_in, *data_out; - krb5_ticket *ticket = NULL; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - data_in = make_data((void *)data, size); - - ret = krb5_init_context(&context); - if (ret) - return 0; - - ret = krb5_kt_default(context, &defkt); - if (ret) - goto cleanup; - - ret = krb5_decode_ticket(&data_in, &ticket); - if (ret) - goto cleanup; - - ret = encode_krb5_ticket(ticket, &data_out); - if (!ret) - krb5_free_data(context, data_out); - - krb5_server_decrypt_ticket_keytab(context, defkt, ticket); - -cleanup: - krb5_free_ticket(context, ticket); - if (defkt != NULL) - krb5_kt_close(context, defkt); - krb5_free_context(context); - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb5_ticket_seed_corpus/gcred.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb5_ticket_seed_corpus/gcred.bin Binary files differdeleted file mode 100644 index 645576f0014b..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb5_ticket_seed_corpus/gcred.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb5_ticket_seed_corpus/s4u2proxy.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb5_ticket_seed_corpus/s4u2proxy.bin Binary files differdeleted file mode 100644 index 19877645ffa7..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb5_ticket_seed_corpus/s4u2proxy.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/deltat.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/deltat.bin deleted file mode 100644 index eaca6be22cc5..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/deltat.bin +++ /dev/null @@ -1 +0,0 @@ --35791394m-9s
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_1.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_1.bin deleted file mode 100644 index 47fb41b9bfe5..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_1.bin +++ /dev/null @@ -1 +0,0 @@ -default -aes128-cts -des-hmac-sha1
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_2.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_2.bin deleted file mode 100644 index 8c5071abdf53..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_2.bin +++ /dev/null @@ -1 +0,0 @@ -aes des3-cbc-sha1-kd
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_3.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_3.bin deleted file mode 100644 index ac635ee6a3b3..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_3.bin +++ /dev/null @@ -1 +0,0 @@ -camellia -camellia256-cts-cmac
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_4.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_4.bin deleted file mode 100644 index 4ddee4c5304a..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_4.bin +++ /dev/null @@ -1 +0,0 @@ -DEFAULT +aes -arcfour-hmac-md5
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_5.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_5.bin deleted file mode 100644 index 5892bca7f482..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_5.bin +++ /dev/null @@ -1 +0,0 @@ -DEFAULT -des3 rc4-hmac rc4-hmac-exp
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_6.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_6.bin deleted file mode 100644 index 6501ba6fef23..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_6.bin +++ /dev/null @@ -1 +0,0 @@ -des3 +DEFAULT
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_7.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_7.bin deleted file mode 100644 index 09d89bf33e3c..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/enctype_7.bin +++ /dev/null @@ -1 +0,0 @@ -aes +rc4 -DEFaulT des3-hmac-sha1
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_11.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_11.bin deleted file mode 100644 index 6a1a02e57042..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_11.bin +++ /dev/null @@ -1 +0,0 @@ -70000
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_12.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_12.bin deleted file mode 100644 index fe9049d24605..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_12.bin +++ /dev/null @@ -1 +0,0 @@ -test.example:F101
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_2.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_2.bin deleted file mode 100644 index 3fc5c1775c10..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_2.bin +++ /dev/null @@ -1 +0,0 @@ -192.168.1.1
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_4.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_4.bin deleted file mode 100644 index 9ca257a84aae..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_4.bin +++ /dev/null @@ -1 +0,0 @@ -[BEEF:CAFE:FEED:FACE:DEAD:BEEF:DEAF:BABE]
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_5.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_5.bin deleted file mode 100644 index 3081d9b01a61..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_5.bin +++ /dev/null @@ -1 +0,0 @@ -[BEEF:CAFE:FEED:FACE:DEAD:BEEF:DEAF:BABE]:250
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_8.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_8.bin deleted file mode 100644 index 4fef47ce34b1..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_8.bin +++ /dev/null @@ -1 +0,0 @@ -:300
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_9.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_9.bin deleted file mode 100644 index 0dbf139f8d1a..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/host_string_9.bin +++ /dev/null @@ -1 +0,0 @@ -350
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/parse_name.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/parse_name.bin deleted file mode 100644 index 2cfb7c29b5dc..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/parse_name.bin +++ /dev/null @@ -1 +0,0 @@ -lha@SU.SE
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/principal_425_name.bin b/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/principal_425_name.bin deleted file mode 100644 index 1f0e72453f70..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_krb_seed_corpus/principal_425_name.bin +++ /dev/null @@ -1 +0,0 @@ -kadmin
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred.c b/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred.c deleted file mode 100644 index 07b130a839bb..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred.c +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_marshal_cred.c */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Fuzzing harness implementation for k5_unmarshal_cred. - */ - -#include "autoconf.h" -#include <cc-int.h> - -#define FIRST_VERSION 1 - -#define kMinInputLength 2 -#define kMaxInputLength 1024 - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - krb5_error_code ret; - krb5_creds cred; - int version; - struct k5buf buf; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - for (version = FIRST_VERSION; version <= 4; version++) { - ret = k5_unmarshal_cred(data, size, version, &cred); - if (!ret) { - k5_buf_init_dynamic(&buf); - k5_marshal_cred(&buf, version, &cred); - k5_buf_free(&buf); - } - - krb5_free_cred_contents(NULL, &cred); - } - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_1_input_1.bin b/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_1_input_1.bin Binary files differdeleted file mode 100644 index 829e71fdc28c..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_1_input_1.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_1_input_2.bin b/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_1_input_2.bin Binary files differdeleted file mode 100644 index 194215ee37a2..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_1_input_2.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_1_input_4.bin b/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_1_input_4.bin Binary files differdeleted file mode 100644 index 2c9a95cfdb8f..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_1_input_4.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_2_input_1.bin b/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_2_input_1.bin Binary files differdeleted file mode 100644 index f2c350d7b68d..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_2_input_1.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_2_input_2.bin b/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_2_input_2.bin Binary files differdeleted file mode 100644 index 7e4a9da1531c..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_2_input_2.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_2_input_4.bin b/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_2_input_4.bin Binary files differdeleted file mode 100644 index e1fc4dfbbcd2..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_cred_seed_corpus/cred_2_input_4.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_princ.c b/crypto/krb5/src/tests/fuzzing/fuzz_marshal_princ.c deleted file mode 100644 index b41fd626944d..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_princ.c +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_marshal_princ.c */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Fuzzing harness implementation for k5_unmarshal_princ. - */ - -#include "autoconf.h" -#include <cc-int.h> - -#define FIRST_VERSION 1 - -#define kMinInputLength 2 -#define kMaxInputLength 1024 - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - krb5_error_code ret; - krb5_principal princ; - int version; - struct k5buf buf; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - for (version = FIRST_VERSION; version <= 4; version++) { - ret = k5_unmarshal_princ(data, size, version, &princ); - if (!ret) { - k5_buf_init_dynamic(&buf); - k5_marshal_princ(&buf, version, princ); - k5_buf_free(&buf); - } - - krb5_free_principal(NULL, princ); - } - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_princ_seed_corpus/princ_input_1.bin b/crypto/krb5/src/tests/fuzzing/fuzz_marshal_princ_seed_corpus/princ_input_1.bin Binary files differdeleted file mode 100644 index f6f1af038e1d..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_princ_seed_corpus/princ_input_1.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_princ_seed_corpus/princ_input_2.bin b/crypto/krb5/src/tests/fuzzing/fuzz_marshal_princ_seed_corpus/princ_input_2.bin Binary files differdeleted file mode 100644 index fb55f77d05fe..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_princ_seed_corpus/princ_input_2.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_princ_seed_corpus/princ_input_4.bin b/crypto/krb5/src/tests/fuzzing/fuzz_marshal_princ_seed_corpus/princ_input_4.bin Binary files differdeleted file mode 100644 index 0259f34c7523..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_marshal_princ_seed_corpus/princ_input_4.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_ndr.c b/crypto/krb5/src/tests/fuzzing/fuzz_ndr.c deleted file mode 100644 index 7692bace72e2..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_ndr.c +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_ndr.c */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Fuzzing harness implementation for ndr_dec_delegation_info. - */ - -#include "autoconf.h" -#include <k5-int.h> -#include <kdc_util.h> - -#include <ndr.c> - -#define kMinInputLength 2 -#define kMaxInputLength 1024 - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - krb5_error_code ret; - krb5_data data_in, data_out = empty_data(); - struct pac_s4u_delegation_info *di; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - data_in = make_data((void *)data, size); - - ret = ndr_dec_delegation_info(&data_in, &di); - if (!ret) - (void)ndr_enc_delegation_info(di, &data_out); - - ndr_free_delegation_info(di); - krb5_free_data_contents(NULL, &data_out); - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_ndr_seed_corpus/s4u_di_double.bin b/crypto/krb5/src/tests/fuzzing/fuzz_ndr_seed_corpus/s4u_di_double.bin Binary files differdeleted file mode 100644 index 9c0e718f0d82..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_ndr_seed_corpus/s4u_di_double.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_ndr_seed_corpus/s4u_di_long.bin b/crypto/krb5/src/tests/fuzzing/fuzz_ndr_seed_corpus/s4u_di_long.bin Binary files differdeleted file mode 100644 index 444bc46ba6d6..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_ndr_seed_corpus/s4u_di_long.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_oid.c b/crypto/krb5/src/tests/fuzzing/fuzz_oid.c deleted file mode 100644 index d397d4861087..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_oid.c +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_oid.c - fuzzing harness for GSS OID conversions */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "autoconf.h" -#include <k5-int.h> -#include <gssapi/gssapi_krb5.h> - -#define kMinInputLength 2 -#define kMaxInputLength 1024 - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - OM_uint32 minor; - gss_buffer_desc buf; - gss_OID oid; - gss_OID_desc oid_desc; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - oid_desc.elements = (void *)data; - oid_desc.length = size; - - gss_oid_to_str(&minor, &oid_desc, &buf); - gss_release_buffer(&minor, &buf); - - buf.value = (void *)data; - buf.length = size; - - gss_str_to_oid(&minor, &buf, &oid); - gss_release_oid(&minor, &oid); - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_19.bin b/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_19.bin deleted file mode 100644 index 16e0e90df089..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_19.bin +++ /dev/null @@ -1 +0,0 @@ -
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_20.bin b/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_20.bin Binary files differdeleted file mode 100644 index 8b040ead36e9..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_20.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_21.bin b/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_21.bin Binary files differdeleted file mode 100644 index 6b58abecd6cd..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_21.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_22.bin b/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_22.bin Binary files differdeleted file mode 100644 index 09f370e38f49..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_22.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_24.bin b/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_24.bin Binary files differdeleted file mode 100644 index 8fdfd1779b7e..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_24.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_8.bin b/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_8.bin deleted file mode 100644 index 091299428a98..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_oid_seed_corpus/oid_8.bin +++ /dev/null @@ -1 +0,0 @@ -*†H†÷
\ No newline at end of file diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_pac.c b/crypto/krb5/src/tests/fuzzing/fuzz_pac.c deleted file mode 100644 index 38488420eb67..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_pac.c +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_pac.c */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Fuzzing harness implementation for krb5_pac_parse. - */ - -#include "autoconf.h" -#include <k5-int.h> - -#define U(x) (uint8_t *)x -#define kMinInputLength 2 -#define kMaxInputLength 1024 - -static const krb5_keyblock kdc_keyblock = { - 0, ENCTYPE_ARCFOUR_HMAC, - 16, U("\xB2\x86\x75\x71\x48\xAF\x7F\xD2\x52\xC5\x36\x03\xA1\x50\xB7\xE7") -}; - -static const krb5_keyblock member_keyblock = { - 0, ENCTYPE_ARCFOUR_HMAC, - 16, U("\xD2\x17\xFA\xEA\xE5\xE6\xB5\xF9\x5C\xCC\x94\x07\x7A\xB8\xA5\xFC") -}; - -static time_t authtime = 1120440609; -static const char *user = "w2003final$@WIN2K3.THINKER.LOCAL"; - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - krb5_error_code ret; - krb5_context context = NULL; - krb5_pac pac; - krb5_principal princ = NULL; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - ret = krb5_init_context(&context); - if (ret) - return 0; - - ret = krb5_parse_name(context, user, &princ); - if (ret) - goto cleanup; - - ret = krb5_pac_parse(context, data, size, &pac); - if (ret) - goto cleanup; - - krb5_pac_verify(context, pac, authtime, princ, NULL, NULL); - krb5_pac_verify_ext(context, pac, authtime, princ, NULL, NULL, TRUE); - krb5_pac_verify(context, pac, authtime, princ, &member_keyblock, - &kdc_keyblock); - - krb5_pac_free(context, pac); - -cleanup: - krb5_free_principal(context, princ); - krb5_free_context(context); - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_pac_seed_corpus/s4u_pac_regular.bin b/crypto/krb5/src/tests/fuzzing/fuzz_pac_seed_corpus/s4u_pac_regular.bin Binary files differdeleted file mode 100644 index c16319417396..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_pac_seed_corpus/s4u_pac_regular.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_pac_seed_corpus/saved_pac.bin b/crypto/krb5/src/tests/fuzzing/fuzz_pac_seed_corpus/saved_pac.bin Binary files differdeleted file mode 100644 index 6336bef5fb04..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_pac_seed_corpus/saved_pac.bin +++ /dev/null diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_profile.c b/crypto/krb5/src/tests/fuzzing/fuzz_profile.c deleted file mode 100644 index e62decf7b79d..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_profile.c +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_profile.c */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Fuzzing harness implementation for profile_parse_file. - */ - -#include "autoconf.h" -#include <prof_int.h> - -void dump_profile(struct profile_node *root, int level); - -#define kMinInputLength 2 -#define kMaxInputLength 1024 - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - errcode_t ret; - FILE *fp_w, *fp_r; - char file_name[256], *output; - struct profile_node *root; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - snprintf(file_name, sizeof(file_name), "/tmp/libfuzzer.%d", getpid()); - - /* Write data into the file. */ - fp_w = fopen(file_name, "w"); - if (!fp_w) - return 1; - fwrite(data, 1, size, fp_w); - fclose(fp_w); - - /* Provide the file pointer to the parser. */ - fp_r = fopen(file_name, "r"); - if (!fp_r) - return 1; - - initialize_prof_error_table(); - - ret = profile_parse_file(fp_r, &root, NULL); - if (!ret) { - ret = profile_write_tree_to_buffer(root, &output); - if (!ret) - free(output); - - profile_verify_node(root); - profile_free_node(root); - } - - fclose(fp_r); - unlink(file_name); - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/final2.ini b/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/final2.ini deleted file mode 100644 index 827ec25dcad6..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/final2.ini +++ /dev/null @@ -1,5 +0,0 @@ -# In this variant the relation is marked final. -[section] - subsection = { - key* = value2 - } diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/final3.ini b/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/final3.ini deleted file mode 100644 index dcf0ca96a82f..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/final3.ini +++ /dev/null @@ -1,6 +0,0 @@ -# In this variant the subsection is marked final via a '*' at the end -# of the tag name. -[section] - subsection* = { - key = value3 - } diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/final4.ini b/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/final4.ini deleted file mode 100644 index dcba07845994..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/final4.ini +++ /dev/null @@ -1,6 +0,0 @@ -# In this variant the subsection is marked final via a '*' after the -# closing brace. -[section] - subsection = { - key = value4 - }* diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/final5.ini b/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/final5.ini deleted file mode 100644 index 58cd57d3fc3e..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/final5.ini +++ /dev/null @@ -1,5 +0,0 @@ -# In this variant the top-level section is marked final. -[section]* - subsection = { - key = value5 - } diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/modtest.conf b/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/modtest.conf deleted file mode 100644 index 7ef0971d6d19..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/modtest.conf +++ /dev/null @@ -1 +0,0 @@ -module /home/dark/Desktop/krb5/src/util/profile/testmod/proftest.so-nobuild:teststring diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/test3.ini b/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/test3.ini deleted file mode 100644 index 97f524a95a8c..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/test3.ini +++ /dev/null @@ -1,3 +0,0 @@ -[section] - var = value - diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/testinc.ini b/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/testinc.ini deleted file mode 100644 index 31136f3692ac..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/testinc.ini +++ /dev/null @@ -1,6 +0,0 @@ -[sec1] -var = { -a = 1 -include testinc2.ini -c = 3 -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/testinc2.ini b/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/testinc2.ini deleted file mode 100644 index 35ea95fa5576..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_profile_seed_corpus/testinc2.ini +++ /dev/null @@ -1,2 +0,0 @@ -[sec2] -b = 2 diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_util.c b/crypto/krb5/src/tests/fuzzing/fuzz_util.c deleted file mode 100644 index 91641ad1cb53..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_util.c +++ /dev/null @@ -1,159 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* tests/fuzzing/fuzz_util.c */ -/* - * Copyright (C) 2024 by Arjun. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Fuzzing harness implementation for k5_base64_decode, k5_hex_decode - * krb5_parse_name and k5_parse_host_string. - */ - -#include "autoconf.h" -#include <k5-int.h> -#include <k5-base64.h> -#include <k5-hex.h> -#include <string.h> -#include <k5-utf8.h> - -#include <hashtab.c> - -#define kMinInputLength 2 -#define kMaxInputLength 256 - -extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -static void -fuzz_base64(const char *data_in, size_t size) -{ - size_t len; - - free(k5_base64_encode(data_in, size)); - free(k5_base64_decode(data_in, &len)); -} - -static void -fuzz_hashtab(const char *data_in, size_t size) -{ - int st; - struct k5_hashtab *ht; - - k5_hashtab_create(NULL, 4, &ht); - if (ht == NULL) - return; - - k5_hashtab_add(ht, data_in, size, &st); - - k5_hashtab_free(ht); -} - -static void -fuzz_hex(const char *data_in, size_t size) -{ - char *hex; - uint8_t *bytes; - size_t len; - - if (k5_hex_encode(data_in, size, 0, &hex) == 0) - free(hex); - - if (k5_hex_encode(data_in, size, 1, &hex) == 0) - free(hex); - - if (k5_hex_decode(data_in, &bytes, &len) == 0) - free(bytes); -} - -static void -fuzz_name(const char *data_in, size_t size) -{ - krb5_context context; - krb5_principal fuzzing; - - if (krb5_init_context(&context) != 0) - return; - - krb5_parse_name(context, data_in, &fuzzing); - - krb5_free_principal(context, fuzzing); - krb5_free_context(context); -} - -static void -fuzz_parse_host(const char *data_in, size_t size) -{ - char *host_out = NULL; - int port_out = -1; - - if (k5_parse_host_string(data_in, 1, &host_out, &port_out) == 0) - free(host_out); -} - -static void -fuzz_utf8(const char *data_in, size_t size) -{ - krb5_ucs4 u = 0; - char *utf8; - uint8_t *utf16; - size_t utf16len; - - krb5int_utf8_to_ucs4(data_in, &u); - - k5_utf8_to_utf16le(data_in, &utf16, &utf16len); - if (utf16 != NULL) - free(utf16); - - k5_utf16le_to_utf8((const uint8_t *)data_in, size, &utf8); - if (utf8 != NULL) - free(utf8); -} - -extern int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - krb5_error_code ret; - char *data_in; - - if (size < kMinInputLength || size > kMaxInputLength) - return 0; - - data_in = k5memdup0(data, size, &ret); - if (data_in == NULL) - return 0; - - fuzz_base64(data_in, size); - fuzz_hashtab(data_in, size); - fuzz_hex(data_in, size); - fuzz_name(data_in, size); - fuzz_parse_host(data_in, size); - fuzz_utf8(data_in, size); - - free(data_in); - - return 0; -} diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_util_seed_corpus/base64.txt b/crypto/krb5/src/tests/fuzzing/fuzz_util_seed_corpus/base64.txt deleted file mode 100644 index 68c422c56277..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_util_seed_corpus/base64.txt +++ /dev/null @@ -1 +0,0 @@ -YWJjOmRlZg== diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_util_seed_corpus/hax.txt b/crypto/krb5/src/tests/fuzzing/fuzz_util_seed_corpus/hax.txt deleted file mode 100644 index c747d34aa6d4..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_util_seed_corpus/hax.txt +++ /dev/null @@ -1 +0,0 @@ -3031323334353637 diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_util_seed_corpus/host.txt b/crypto/krb5/src/tests/fuzzing/fuzz_util_seed_corpus/host.txt deleted file mode 100644 index b3968327c673..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_util_seed_corpus/host.txt +++ /dev/null @@ -1 +0,0 @@ -test.example:75 diff --git a/crypto/krb5/src/tests/fuzzing/fuzz_util_seed_corpus/name.txt b/crypto/krb5/src/tests/fuzzing/fuzz_util_seed_corpus/name.txt deleted file mode 100644 index db95221bdc9f..000000000000 --- a/crypto/krb5/src/tests/fuzzing/fuzz_util_seed_corpus/name.txt +++ /dev/null @@ -1 +0,0 @@ -/b@R diff --git a/crypto/krb5/src/tests/fuzzing/oss-fuzz.sh b/crypto/krb5/src/tests/fuzzing/oss-fuzz.sh deleted file mode 100644 index b01d4bcbd22a..000000000000 --- a/crypto/krb5/src/tests/fuzzing/oss-fuzz.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -eu - -# This script plays the role of build.sh in OSS-Fuzz. If only minor -# changes are required such as changing the fuzzing targets, a PR in -# the OSS-Fuzz repository is not needed and they can be done here. - -# Compile krb5 for oss-fuzz. -pushd src/ -autoreconf -./configure CFLAGS="-fcommon $CFLAGS" CXXFLAGS="-fcommon $CXXFLAGS" \ - --enable-static --disable-shared --enable-ossfuzz -make -popd - -# Copy fuzz targets and seed corpus to $OUT. -pushd src/tests/fuzzing - -fuzzers=("fuzz_aes" "fuzz_asn" "fuzz_attrset" "fuzz_chpw" "fuzz_crypto" - "fuzz_des" "fuzz_gss" "fuzz_json" "fuzz_kdc" "fuzz_krad" "fuzz_krb" - "fuzz_krb5_ticket" "fuzz_marshal_cred" "fuzz_marshal_princ" - "fuzz_ndr" "fuzz_oid" "fuzz_pac" "fuzz_profile" "fuzz_util") - -for fuzzer in "${fuzzers[@]}"; do - cp "$fuzzer" "$OUT/$fuzzer" - zip -r "${OUT}/${fuzzer}_seed_corpus.zip" "${fuzzer}_seed_corpus" -done - -popd |
