diff options
author | agc <agc> | 2013-02-23 21:11:56 +0000 |
---|---|---|
committer | agc <agc> | 2013-02-23 21:11:56 +0000 |
commit | 5460ad7e3af9f4fcd49033576bc7e27f5b79787a (patch) | |
tree | 9536ff5a383933475da83d9e0e93e78dde1d55ec /security | |
parent | 8f2b61513d9cd653afe760142d019d1fbe9bc26f (diff) | |
download | pkgsrc-5460ad7e3af9f4fcd49033576bc7e27f5b79787a.tar.gz |
Initial import of netpgpverify-20120928 into the Packages Collection
netpgpverify is a standalone program to verify a PGP signature
on a file or document. Both RSA and DSA signatures are supported,
as are binary and document signatures.
netpgpverify is compliant with RFC 4880.
netpgpverify is a small frontend for libnetpgpverify, to allow PGP digital
signatures to be verified from the command line.
Diffstat (limited to 'security')
-rw-r--r-- | security/netpgpverify/DESCR | 5 | ||||
-rw-r--r-- | security/netpgpverify/Makefile | 27 | ||||
-rw-r--r-- | security/netpgpverify/PLIST | 3 | ||||
-rw-r--r-- | security/netpgpverify/distinfo | 1 | ||||
-rw-r--r-- | security/netpgpverify/files/Makefile | 16 | ||||
-rw-r--r-- | security/netpgpverify/files/src/netpgpverify/Makefile | 538 | ||||
-rw-r--r-- | security/netpgpverify/files/src/netpgpverify/Makefile.am | 13 | ||||
-rw-r--r-- | security/netpgpverify/files/src/netpgpverify/Makefile.in | 538 | ||||
-rw-r--r-- | security/netpgpverify/files/src/netpgpverify/array.h | 82 | ||||
-rw-r--r-- | security/netpgpverify/files/src/netpgpverify/main.c | 165 | ||||
-rw-r--r-- | security/netpgpverify/files/src/netpgpverify/netpgpverify.1 | 178 | ||||
-rw-r--r-- | security/netpgpverify/files/src/netpgpverify/verify.c | 361 |
12 files changed, 1927 insertions, 0 deletions
diff --git a/security/netpgpverify/DESCR b/security/netpgpverify/DESCR new file mode 100644 index 00000000000..c260f9c0060 --- /dev/null +++ b/security/netpgpverify/DESCR @@ -0,0 +1,5 @@ +netpgpverify is a standalone program to verify a PGP signature +on a file or document. Both RSA and DSA signatures are supported, +as are binary and document signatures. + +netpgpverify is compliant with RFC 4880. diff --git a/security/netpgpverify/Makefile b/security/netpgpverify/Makefile new file mode 100644 index 00000000000..5525c9e44f1 --- /dev/null +++ b/security/netpgpverify/Makefile @@ -0,0 +1,27 @@ +# $NetBSD: Makefile,v 1.1.1.1 2013/02/23 21:11:56 agc Exp $ + +DISTNAME= netpgpverify-20120928 +CATEGORIES= security +MASTER_SITES= # empty +DISTFILES= # empty + +MAINTAINER= agc@NetBSD.org +HOMEPAGE= http://www.NetBSD.org/ +COMMENT= PGP signature verification library +LICENSE= modified-bsd + +USE_LIBTOOL= yes +AUTO_MKDIRS= yes + +do-extract: + @${CP} -R ${FILESDIR} ${WRKSRC} + +do-install: + libtool --mode=install ${INSTALL_PROGRAM} ${WRKSRC}/netpgpverify ${DESTDIR}${PREFIX}/bin + ${INSTALL_DATA} ${WRKSRC}/src/netpgpverify/netpgpverify.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1 + +.include "../../archivers/bzip2/buildlink3.mk" +.include "../../devel/zlib/buildlink3.mk" +.include "../../security/libnetpgpverify/buildlink3.mk" + +.include "../../mk/bsd.pkg.mk" diff --git a/security/netpgpverify/PLIST b/security/netpgpverify/PLIST new file mode 100644 index 00000000000..4c5913339f8 --- /dev/null +++ b/security/netpgpverify/PLIST @@ -0,0 +1,3 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2013/02/23 21:11:56 agc Exp $ +bin/netpgpverify +man/man1/netpgpverify.1 diff --git a/security/netpgpverify/distinfo b/security/netpgpverify/distinfo new file mode 100644 index 00000000000..7fdd3d29639 --- /dev/null +++ b/security/netpgpverify/distinfo @@ -0,0 +1 @@ +$NetBSD: distinfo,v 1.1.1.1 2013/02/23 21:11:56 agc Exp $ diff --git a/security/netpgpverify/files/Makefile b/security/netpgpverify/files/Makefile new file mode 100644 index 00000000000..72d611e5316 --- /dev/null +++ b/security/netpgpverify/files/Makefile @@ -0,0 +1,16 @@ +# $NetBSD: Makefile,v 1.1.1.1 2013/02/23 21:11:56 agc Exp $ + +SRCS=src/netpgpverify/main.c +OBJS=main.o +LIBS=${PREFIX}/lib/libnetpgpverify.la -lz -lbz2 + +CFLAGS+=-I${PREFIX}/include + +all: netpgpverify + +main.o: ${SRCS} + libtool --mode=compile ${CC} ${CFLAGS} -c ${SRCS} -o ${OBJS} + +netpgpverify: ${OBJS} + libtool --mode=link ${CC} ${LDFLAGS} ${OBJS} ${LIBS} -o netpgpverify + diff --git a/security/netpgpverify/files/src/netpgpverify/Makefile b/security/netpgpverify/files/src/netpgpverify/Makefile new file mode 100644 index 00000000000..8ee1ce82902 --- /dev/null +++ b/security/netpgpverify/files/src/netpgpverify/Makefile @@ -0,0 +1,538 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# src/netpgpverify/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + + +pkgdatadir = $(datadir)/netpgp +pkglibdir = $(libdir)/netpgp +pkgincludedir = $(includedir)/netpgp +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = i386-unknown-netbsdelf5.99.26 +host_triplet = i386-unknown-netbsdelf5.99.26 +bin_PROGRAMS = netpgpverify$(EXEEXT) +subdir = src/netpgpverify +DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/ax_check_openssl.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/lib/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_netpgpverify_OBJECTS = netpgpverify-verify.$(OBJEXT) +netpgpverify_OBJECTS = $(am_netpgpverify_OBJECTS) +netpgpverify_DEPENDENCIES = ../lib/libnetpgp.la ../libmj/libmj.la +DEFAULT_INCLUDES = -I. -I$(top_builddir)/src/lib +depcomp = $(SHELL) $(top_srcdir)/buildaux/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(netpgpverify_SOURCES) +DIST_SOURCES = $(netpgpverify_SOURCES) +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(dist_man_MANS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /usr/src/crypto/external/bsd/netpgp/dist/buildaux/missing --run aclocal-1.10 +AMTAR = ${SHELL} /usr/src/crypto/external/bsd/netpgp/dist/buildaux/missing --run tar +AR = ar +AUTOCONF = ${SHELL} /usr/src/crypto/external/bsd/netpgp/dist/buildaux/missing --run autoconf +AUTOHEADER = ${SHELL} /usr/src/crypto/external/bsd/netpgp/dist/buildaux/missing --run autoheader +AUTOM4TE = ${SHELL} /usr/src/crypto/external/bsd/netpgp/dist/buildaux/missing --run autom4te +AUTOMAKE = ${SHELL} /usr/src/crypto/external/bsd/netpgp/dist/buildaux/missing --run automake-1.10 +AWK = gawk +CANONICAL_HOST = i386-unknown-netbsdelf5.99.26 +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CYGPATH_W = echo +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /usr/bin/grep -E +EXEEXT = +FGREP = /usr/bin/grep -F +GREP = /usr/bin/grep +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = /usr/bin/ld +LDFLAGS = +LIBOBJS = +LIBS = -lcrypto -lbz2 -lz +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIPO = +LN_S = ln -s +LTLIBOBJS = +MAINT = # +MAKEINFO = ${SHELL} /usr/src/crypto/external/bsd/netpgp/dist/buildaux/missing --run makeinfo +MKDIR_P = ../../buildaux/install-sh -c -d +NM = /usr/bin/nm -B +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OPENSSL_INCLUDES = -I/usr/include +OPENSSL_LDFLAGS = -L/usr/lib +OPENSSL_LIBS = -lssl -lcrypto +OTOOL = +OTOOL64 = +PACKAGE = netpgp +PACKAGE_BUGREPORT = Alistair Crooks <agc@netbsd.org> c0596823 +PACKAGE_NAME = netpgp +PACKAGE_STRING = netpgp 20101107 +PACKAGE_TARNAME = netpgp +PACKAGE_VERSION = 20101107 +PATH_SEPARATOR = : +PKG_CONFIG = /usr/pkg/bin/pkg-config +RANLIB = ranlib +SED = /usr/bin/sed +SET_MAKE = +SHELL = /bin/ksh +STRIP = strip +VERSION = 20101107 +WARNCFLAGS = -Werror -Wall -Wpointer-arith +abs_builddir = /usr/src/crypto/external/bsd/netpgp/dist/src/netpgpverify +abs_srcdir = /usr/src/crypto/external/bsd/netpgp/dist/src/netpgpverify +abs_top_builddir = /usr/src/crypto/external/bsd/netpgp/dist +abs_top_srcdir = /usr/src/crypto/external/bsd/netpgp/dist +ac_ct_CC = gcc +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = i386-unknown-netbsdelf5.99.26 +build_alias = +build_cpu = i386 +build_os = netbsdelf5.99.26 +build_vendor = unknown +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = i386-unknown-netbsdelf5.99.26 +host_alias = +host_cpu = i386 +host_os = netbsdelf5.99.26 +host_vendor = unknown +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = $(SHELL) /usr/src/crypto/external/bsd/netpgp/dist/buildaux/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +lt_ECHO = /bin/echo +mandir = ${datarootdir}/man +mkdir_p = $(top_builddir)/buildaux/install-sh -c -d +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +top_build_prefix = ../../ +top_builddir = ../.. +top_srcdir = ../.. +AM_CFLAGS = $(WARNCFLAGS) +netpgpverify_SOURCES = verify.c +netpgpverify_CPPFLAGS = -I$(top_srcdir)/include +netpgpverify_LDADD = ../lib/libnetpgp.la ../libmj/libmj.la +dist_man_MANS = netpgpverify.1 +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/netpgpverify/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/netpgpverify/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: # $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): # $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +netpgpverify$(EXEEXT): $(netpgpverify_OBJECTS) $(netpgpverify_DEPENDENCIES) + @rm -f netpgpverify$(EXEEXT) + $(LINK) $(netpgpverify_OBJECTS) $(netpgpverify_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/netpgpverify-verify.Po + +.c.o: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +# source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LTCOMPILE) -c -o $@ $< + +netpgpverify-verify.o: verify.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(netpgpverify_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netpgpverify-verify.o -MD -MP -MF $(DEPDIR)/netpgpverify-verify.Tpo -c -o netpgpverify-verify.o `test -f 'verify.c' || echo '$(srcdir)/'`verify.c + mv -f $(DEPDIR)/netpgpverify-verify.Tpo $(DEPDIR)/netpgpverify-verify.Po +# source='verify.c' object='netpgpverify-verify.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(netpgpverify_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netpgpverify-verify.o `test -f 'verify.c' || echo '$(srcdir)/'`verify.c + +netpgpverify-verify.obj: verify.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(netpgpverify_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netpgpverify-verify.obj -MD -MP -MF $(DEPDIR)/netpgpverify-verify.Tpo -c -o netpgpverify-verify.obj `if test -f 'verify.c'; then $(CYGPATH_W) 'verify.c'; else $(CYGPATH_W) '$(srcdir)/verify.c'; fi` + mv -f $(DEPDIR)/netpgpverify-verify.Tpo $(DEPDIR)/netpgpverify-verify.Po +# source='verify.c' object='netpgpverify-verify.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(netpgpverify_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netpgpverify-verify.obj `if test -f 'verify.c'; then $(CYGPATH_W) 'verify.c'; else $(CYGPATH_W) '$(srcdir)/verify.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ + done +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(MANS) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-man + +install-dvi: install-dvi-am + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-info: install-info-am + +install-man: install-man1 + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-man + +uninstall-man: uninstall-man1 + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-man \ + uninstall-man1 + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/security/netpgpverify/files/src/netpgpverify/Makefile.am b/security/netpgpverify/files/src/netpgpverify/Makefile.am new file mode 100644 index 00000000000..78e274889ba --- /dev/null +++ b/security/netpgpverify/files/src/netpgpverify/Makefile.am @@ -0,0 +1,13 @@ +## $NetBSD: Makefile.am,v 1.1.1.1 2013/02/23 21:11:57 agc Exp $ + +AM_CFLAGS = $(WARNCFLAGS) + +bin_PROGRAMS = netpgpverify + +netpgpverify_SOURCES = verify.c + +netpgpverify_CPPFLAGS = -I$(top_srcdir)/include + +netpgpverify_LDADD = ../lib/libnetpgp.la ../libmj/libmj.la + +dist_man_MANS = netpgpverify.1 diff --git a/security/netpgpverify/files/src/netpgpverify/Makefile.in b/security/netpgpverify/files/src/netpgpverify/Makefile.in new file mode 100644 index 00000000000..c22ced6ec89 --- /dev/null +++ b/security/netpgpverify/files/src/netpgpverify/Makefile.in @@ -0,0 +1,538 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = netpgpverify$(EXEEXT) +subdir = src/netpgpverify +DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/ax_check_openssl.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/lib/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_netpgpverify_OBJECTS = netpgpverify-verify.$(OBJEXT) +netpgpverify_OBJECTS = $(am_netpgpverify_OBJECTS) +netpgpverify_DEPENDENCIES = ../lib/libnetpgp.la ../libmj/libmj.la +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/lib +depcomp = $(SHELL) $(top_srcdir)/buildaux/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(netpgpverify_SOURCES) +DIST_SOURCES = $(netpgpverify_SOURCES) +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(dist_man_MANS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOM4TE = @AUTOM4TE@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CANONICAL_HOST = @CANONICAL_HOST@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ +OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ +OPENSSL_LIBS = @OPENSSL_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WARNCFLAGS = @WARNCFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CFLAGS = $(WARNCFLAGS) +netpgpverify_SOURCES = verify.c +netpgpverify_CPPFLAGS = -I$(top_srcdir)/include +netpgpverify_LDADD = ../lib/libnetpgp.la ../libmj/libmj.la +dist_man_MANS = netpgpverify.1 +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/netpgpverify/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/netpgpverify/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +netpgpverify$(EXEEXT): $(netpgpverify_OBJECTS) $(netpgpverify_DEPENDENCIES) + @rm -f netpgpverify$(EXEEXT) + $(LINK) $(netpgpverify_OBJECTS) $(netpgpverify_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netpgpverify-verify.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +netpgpverify-verify.o: verify.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(netpgpverify_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netpgpverify-verify.o -MD -MP -MF $(DEPDIR)/netpgpverify-verify.Tpo -c -o netpgpverify-verify.o `test -f 'verify.c' || echo '$(srcdir)/'`verify.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/netpgpverify-verify.Tpo $(DEPDIR)/netpgpverify-verify.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='verify.c' object='netpgpverify-verify.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(netpgpverify_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netpgpverify-verify.o `test -f 'verify.c' || echo '$(srcdir)/'`verify.c + +netpgpverify-verify.obj: verify.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(netpgpverify_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netpgpverify-verify.obj -MD -MP -MF $(DEPDIR)/netpgpverify-verify.Tpo -c -o netpgpverify-verify.obj `if test -f 'verify.c'; then $(CYGPATH_W) 'verify.c'; else $(CYGPATH_W) '$(srcdir)/verify.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/netpgpverify-verify.Tpo $(DEPDIR)/netpgpverify-verify.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='verify.c' object='netpgpverify-verify.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(netpgpverify_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netpgpverify-verify.obj `if test -f 'verify.c'; then $(CYGPATH_W) 'verify.c'; else $(CYGPATH_W) '$(srcdir)/verify.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ + done +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(MANS) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-man + +install-dvi: install-dvi-am + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-info: install-info-am + +install-man: install-man1 + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-man + +uninstall-man: uninstall-man1 + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-man \ + uninstall-man1 + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/security/netpgpverify/files/src/netpgpverify/array.h b/security/netpgpverify/files/src/netpgpverify/array.h new file mode 100644 index 00000000000..d5c19a98d67 --- /dev/null +++ b/security/netpgpverify/files/src/netpgpverify/array.h @@ -0,0 +1,82 @@ +/*- + * Copyright (c) 2012 Alistair Crooks <agc@NetBSD.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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 AUTHOR ``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 AUTHOR 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. + */ +#ifndef ARRAY_H_ +#define ARRAY_H_ 20120921 + +#ifndef PGPV_ARRAY +/* creates 2 unsigned vars called "name"c and "name"size in current scope */ +/* also creates an array called "name"s in current scope */ +#define PGPV_ARRAY(type, name) \ + unsigned name##c; unsigned name##vsize; type *name##s +#endif + +/* if this isn't part of a struct, need to specifically initialise things */ +#define ARRAY_INIT(name) do { \ + name##c = name##vsize = 0; \ + name##s = NULL; \ +} while(/*CONSTCOND*/0) + +/* check the array is big enough - if not, expand it by explicit amount */ +/* this is clunky, but there are bugs a-lurking */ +#define ARRAY_EXPAND_SIZED(name, mult, add) do { \ + if (name##c == name##vsize) { \ + void *_v; \ + char *_cv = NULL; \ + unsigned _ents; \ + _ents = (name##vsize * (mult)) + (add); \ + _cv = _v = realloc(name##s, _ents * sizeof(*name##s)); \ + if (_v == NULL) { \ + fprintf(stderr, "ARRAY_EXPAND - bad realloc\n"); \ + } else { \ + memset(&_cv[name##vsize * sizeof(*name##s)], \ + 0x0, (_ents - name##vsize) * sizeof(*name##s)); \ + name##s = _v; \ + name##vsize = _ents; \ + } \ + } \ +} while(/*CONSTCOND*/0) + +/* check the array is big enough - if not, expand it (size * 2) + 10 */ +#define ARRAY_EXPAND(name) ARRAY_EXPAND_SIZED(name, 2, 10) + +#define ARRAY_ELEMENT(name, num) name##s[num] +#define ARRAY_LAST(name) name##s[name##c - 1] +#define ARRAY_COUNT(name) name##c +#define ARRAY_SIZE(name) name##vsize +#define ARRAY_ARRAY(name) name##s + +#define ARRAY_APPEND(name, newel) do { \ + ARRAY_EXPAND(name); \ + ARRAY_COUNT(name) += 1; \ + ARRAY_LAST(name) = newel; \ +} while(/*CONSTCOND*/0) + +#define ARRAY_DELETE(name, num) do { \ + ARRAY_COUNT(name) -= 1; \ + memmove(&ARRAY_ELEMENT(name, num), &ARRAY_ELEMENT(name, num + 1), \ + (ARRAY_COUNT(name) - (num)) * sizeof(ARRAY_ELEMENT(name, 0))); \ +} while(/*CONSTCOND*/0) + +#endif diff --git a/security/netpgpverify/files/src/netpgpverify/main.c b/security/netpgpverify/files/src/netpgpverify/main.c new file mode 100644 index 00000000000..8c85cbdcdfe --- /dev/null +++ b/security/netpgpverify/files/src/netpgpverify/main.c @@ -0,0 +1,165 @@ +/*- + * Copyright (c) 2012 Alistair Crooks <agc@NetBSD.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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 AUTHOR ``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 AUTHOR 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 <sys/types.h> + +#include <err.h> +#include <inttypes.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <unistd.h> + +#include "netpgp/verify.h" + +#include "array.h" + +/* print the time nicely */ +static void +ptime(int64_t secs) +{ + time_t t; + + t = (time_t)secs; + printf("%s", ctime(&t)); +} + +/* print entry n */ +static void +pentry(pgpv_t *pgp, int n) +{ + char *s; + + pgpv_get_entry(pgp, (unsigned)n, &s); + printf("%s", s); + free(s); +} + +#define MB(x) ((x) * 1024 * 1024) + +/* get stdin into memory so we can verify it */ +static char * +getstdin(ssize_t *cc, size_t *size) +{ + size_t newsize; + char *newin; + char *in; + int rc; + + *cc = 0; + *size = 0; + in = NULL; + do { + newsize = *size + MB(1); + if ((newin = realloc(in, newsize)) == NULL) { + break; + } + in = newin; + *size = newsize; + if ((rc = read(STDIN_FILENO, &in[*cc], newsize - *cc)) > 0) { + *cc += rc; + } + } while (rc > 0); + return in; +} + +/* verify memory or file */ +static int +verify_data(pgpv_t *pgp, const char *cmd, const char *inname, char *in, ssize_t cc) +{ + pgpv_cursor_t cursor; + size_t size; + size_t cookie; + char *data; + + memset(&cursor, 0x0, sizeof(cursor)); + if (strcasecmp(cmd, "cat") == 0) { + if ((cookie = pgpv_verify(&cursor, pgp, in, cc)) != 0) { + if ((size = pgpv_get_verified(&cursor, cookie, &data)) > 0) { + printf("%.*s", (int)size, data); + } + return 1; + } + } else if (strcasecmp(cmd, "verify") == 0) { + if (pgpv_verify(&cursor, pgp, in, cc)) { + printf("Good signature for %s made ", inname); + ptime(cursor.sigtime); + pentry(pgp, ARRAY_ELEMENT(cursor.found, 0)); + return 1; + } + warnx("Signature did not match contents -- %s", cursor.why); + } else { + warnx("unrecognised command \"%s\"", cmd); + } + return 0; +} + +int +main(int argc, char **argv) +{ + const char *keyring; + const char *cmd; + ssize_t cc; + size_t size; + pgpv_t pgp; + char *in; + int ok; + int i; + + memset(&pgp, 0x0, sizeof(pgp)); + cmd = NULL; + keyring = NULL; + ok = 1; + while ((i = getopt(argc, argv, "c:k:")) != -1) { + switch(i) { + case 'c': + cmd = optarg; + break; + case 'k': + keyring = optarg; + break; + default: + break; + } + } + if (cmd == NULL) { + cmd = "verify"; + } + if (!pgpv_read_pubring(&pgp, keyring, -1)) { + errx(EXIT_FAILURE, "can't read keyring"); + } + if (optind == argc) { + in = getstdin(&cc, &size); + ok = verify_data(&pgp, cmd, "[stdin]", in, cc); + } else { + for (ok = 1, i = optind ; i < argc ; i++) { + if (!verify_data(&pgp, cmd, argv[i], argv[i], -1)) { + ok = 0; + } + } + } + pgpv_close(&pgp); + exit((ok) ? EXIT_SUCCESS : EXIT_FAILURE); +} diff --git a/security/netpgpverify/files/src/netpgpverify/netpgpverify.1 b/security/netpgpverify/files/src/netpgpverify/netpgpverify.1 new file mode 100644 index 00000000000..faf7b860213 --- /dev/null +++ b/security/netpgpverify/files/src/netpgpverify/netpgpverify.1 @@ -0,0 +1,178 @@ +.\" $NetBSD: netpgpverify.1,v 1.1.1.1 2013/02/23 21:11:57 agc Exp $ +.\" +.\" Copyright (c) 2009 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This manual page is derived from software contributed to +.\" The NetBSD Foundation by Alistair Crooks (agc@NetBSD.org). +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. +.\" +.Dd November 10, 2010 +.Dt NETPGPVERIFY 1 +.Os +.Sh NAME +.Nm netpgpverify +.Nd standalone program for digital signature verification +.Sh SYNOPSIS +.Nm +.Fl Fl verify +.Op Fl Fl output Ns = Ns Ar filename +.Op options +.Ar file ... +.Pp +where the options for all commands are: +.Pp +.Op Fl Fl coredumps +.br +.Op Fl Fl homedir Ns = Ns Ar home-directory +.br +.Op Fl Fl keyring Ns = Ns Ar keyring +.br +.Op Fl Fl userid Ns = Ns Ar userid +.br +.Op Fl Fl verbose +.Sh DESCRIPTION +The +.Nm +complements the +.Xr netpgp 1 +program, and duplicates its verification functionality in +a single standalone program. +The reason for this duplication is simply because verification +of digital signatures +is such a common operation that a single, much smaller, +standalone program can be used. +.Pp +The following commands are used to verify signatures: +.Bl -tag -width Ar +.It Fl Fl coredumps +In normal processing, +if an error occurs, the contents of memory are saved to disk, and can +be read using tools to analyse behaviour. +Unfortunately this can disclose information to people viewing +the core dump, such as secret keys, and passphrases protecting +those keys. +In normal operation, +.Nm +will turn off the ability to save core dumps on persistent storage, +but selecting this option will allow core dumps to be written to disk. +This option should be used wisely, and any core dumps should +be deleted in a secure manner when no longer needed. +.It Fl Fl homedir Ar home-directory +Keyrings are normally located, for historical reasons, within +the user's home directory in a subdirectory called +.Dq Pa .gnupg +and this option specifies an alternative location in which to +find that sub-directory. +.It Fl Fl keyring Ar keyring +This option specifies an alternative keyring to be used. +All keyring operations will be relative to this alternative keyring. +.It Fl Fl output +specifies a filename to which verified output from a signed file +may be redirected. +The default is to send the verified output to stdout, +and this may also be specified using the +.Dq \- +value. +.It Fl Fl verbose +This option can be used to view information during +the process of the +.Nm +requests. +.El +.Sh SIGNING AND VERIFICATION +Verification of a file's signature is best viewed using the following example: +.Bd -literal +% netpgp --sign --userid=agc@netbsd.org a +signature 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12 +Key fingerprint: d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823 +uid Alistair Crooks \*[Lt]alistair@hockley-crooks.com\*[Gt] +uid Alistair Crooks \*[Lt]agc@pkgsrc.org\*[Gt] +uid Alistair Crooks \*[Lt]agc@netbsd.org\*[Gt] +uid Alistair Crooks \*[Lt]agc@alistaircrooks.com\*[Gt] +uid Alistair Crooks (Yahoo!) \*[Lt]agcrooks@yahoo-inc.com\*[Gt] +encryption 2048/RSA (Encrypt or Sign) 79deb61e488eee74 2004-01-12 +netpgp passphrase: +% netpgpverify a.gpg +Good signature for a.gpg made Thu Jan 29 03:06:00 2009 +using RSA (Encrypt or Sign) key 1B68DCFCC0596823 +signature 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12 +Key fingerprint: d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823 +uid Alistair Crooks \*[Lt]alistair@hockley-crooks.com\*[Gt] +uid Alistair Crooks \*[Lt]agc@pkgsrc.org\*[Gt] +uid Alistair Crooks \*[Lt]agc@netbsd.org\*[Gt] +uid Alistair Crooks \*[Lt]agc@alistaircrooks.com\*[Gt] +uid Alistair Crooks (Yahoo!) \*[Lt]agcrooks@yahoo-inc.com\*[Gt] +encryption 2048/RSA (Encrypt or Sign) 79deb61e488eee74 2004-01-12 +% +.Ed +.Pp +In the example above, a signature is made on a single file called +.Dq Pa a +using a user identity corresponding to +.Dq agc@netbsd.org +and using the +.Xr netpgp 1 +program. +The key located for the user identity is displayed, and +the user is prompted to type in their passphrase. +The resulting file, called +.Dq Pa a.gpg +is placed in the same directory. +The second part of the example shows a verification +using +.Nm +of the signed file +taking place. +The time and user identity of the signatory is displayed, followed +by a fuller description of the public key of the signatory. +In both cases, the exit value from the utility was a successful one. +.Sh EXIT STATUS +The +.Nm +utility will return 0 for success, +1 if the file's signature does not match what was expected, +or 2 if any other error occurs. +.Sh SEE ALSO +.Xr netpgp 1 , +.\" .Xr libbz2 3 , +.Xr libnetpgp 3 , +.Xr ssl 3 , +.Xr zlib 3 +.Sh STANDARDS +The +.Nm +utility is designed to conform to IETF RFC 4880. +.Sh HISTORY +The +.Nm +command first appeared in +.Nx 6.0 . +.Sh AUTHORS +.An -nosplit +.An Ben Laurie , +.An Rachel Willmer , +and was overhauled and rewritten by +.An Alistair Crooks Aq agc@NetBSD.org . +This manual page was written by +.An Alistair Crooks . diff --git a/security/netpgpverify/files/src/netpgpverify/verify.c b/security/netpgpverify/files/src/netpgpverify/verify.c new file mode 100644 index 00000000000..8a21f9ed86f --- /dev/null +++ b/security/netpgpverify/files/src/netpgpverify/verify.c @@ -0,0 +1,361 @@ +/* $NetBSD: verify.c,v 1.1.1.1 2013/02/23 21:11:57 agc Exp $ */ + +/*- + * Copyright (c) 2009,2010 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Alistair Crooks (agc@NetBSD.org) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + */ + +/* Command line program to perform netpgp operations */ +#include <sys/types.h> +#include <sys/param.h> +#include <sys/stat.h> + +#include <getopt.h> +#include <netpgp.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +/* + * SHA1 is now looking as though it should not be used. Let's + * pre-empt this by specifying SHA256 - gpg interoperates just fine + * with SHA256 - agc, 20090522 + */ +#define DEFAULT_HASH_ALG "SHA256" + +static const char *usage = + "\t--verify [options] files... OR\n" + "\t--cat [--output=file] [options] files...\n" + "where options are:\n" + "\t[--coredumps] AND/OR\n" + "\t[--homedir=<homedir>] AND/OR\n" + "\t[--keyring=<keyring>] AND/OR\n" + "\t[--userid=<userid>] AND/OR\n" + "\t[--maxmemalloc=<number of bytes>] AND/OR\n" + "\t[--verbose]\n"; + +enum optdefs { + /* commands */ + VERIFY, + VERIFY_CAT, + VERSION_CMD, + HELP_CMD, + + /* options */ + SSHKEYS, + KEYRING, + USERID, + ARMOUR, + HOMEDIR, + OUTPUT, + RESULTS, + VERBOSE, + COREDUMPS, + SSHKEYFILE, + MAX_MEM_ALLOC, + + /* debug */ + OPS_DEBUG +}; + +#define EXIT_ERROR 2 + +static struct option options[] = { + /* file manipulation commands */ + {"verify", no_argument, NULL, VERIFY}, + {"cat", no_argument, NULL, VERIFY_CAT}, + {"vericat", no_argument, NULL, VERIFY_CAT}, + {"verify-cat", no_argument, NULL, VERIFY_CAT}, + {"verify-show", no_argument, NULL, VERIFY_CAT}, + {"verifyshow", no_argument, NULL, VERIFY_CAT}, + {"help", no_argument, NULL, HELP_CMD}, + {"version", no_argument, NULL, VERSION_CMD}, + /* options */ + {"ssh", no_argument, NULL, SSHKEYS}, + {"ssh-keys", no_argument, NULL, SSHKEYS}, + {"sshkeyfile", required_argument, NULL, SSHKEYFILE}, + {"coredumps", no_argument, NULL, COREDUMPS}, + {"keyring", required_argument, NULL, KEYRING}, + {"userid", required_argument, NULL, USERID}, + {"home", required_argument, NULL, HOMEDIR}, + {"homedir", required_argument, NULL, HOMEDIR}, + {"armor", no_argument, NULL, ARMOUR}, + {"armour", no_argument, NULL, ARMOUR}, + {"verbose", no_argument, NULL, VERBOSE}, + {"output", required_argument, NULL, OUTPUT}, + {"results", required_argument, NULL, RESULTS}, + {"maxmemalloc", required_argument, NULL, MAX_MEM_ALLOC}, + {"max-mem", required_argument, NULL, MAX_MEM_ALLOC}, + {"max-alloc", required_argument, NULL, MAX_MEM_ALLOC}, + { NULL, 0, NULL, 0}, +}; + +/* gather up program variables into one struct */ +typedef struct prog_t { + char keyring[MAXPATHLEN + 1]; /* name of keyring */ + char *progname; /* program name */ + char *output; /* output file name */ + int overwrite; /* overwrite files? */ + int armour; /* ASCII armor */ + int detached; /* use separate file */ + int cmd; /* netpgp command */ +} prog_t; + + +/* print a usage message */ +static void +print_usage(const char *usagemsg, char *progname) +{ + (void) fprintf(stderr, + "%s\nAll bug reports, praise and chocolate, please, to:\n%s\n", + netpgp_get_info("version"), + netpgp_get_info("maintainer")); + (void) fprintf(stderr, "Usage: %s COMMAND OPTIONS:\n%s %s", + progname, progname, usagemsg); +} + +/* read all of stdin into memory */ +static int +stdin_to_mem(netpgp_t *netpgp, char **temp, char **out, unsigned *maxsize) +{ + unsigned newsize; + unsigned size; + char buf[BUFSIZ * 8]; + char *loc; + int n; + + *maxsize = (unsigned)atoi(netpgp_getvar(netpgp, "max mem alloc")); + size = 0; + *out = *temp = NULL; + while ((n = read(STDIN_FILENO, buf, sizeof(buf))) > 0) { + /* round up the allocation */ + newsize = size + ((n / BUFSIZ) + 1) * BUFSIZ; + if (newsize > *maxsize) { + (void) fprintf(stderr, "bounds check\n"); + return size; + } + loc = realloc(*temp, newsize); + if (loc == NULL) { + (void) fprintf(stderr, "short read\n"); + return size; + } + *temp = loc; + (void) memcpy(&(*temp)[size], buf, n); + size += n; + } + if ((*out = calloc(1, *maxsize)) == NULL) { + (void) fprintf(stderr, "Bad alloc\n"); + return 0; + } + return (int)size; +} + +/* output the text to stdout */ +static int +show_output(char *out, int size, const char *header) +{ + int cc; + int n; + + if (size <= 0) { + (void) fprintf(stderr, "%s\n", header); + return 0; + } + for (cc = 0 ; cc < size ; cc += n) { + if ((n = write(STDOUT_FILENO, &out[cc], size - cc)) <= 0) { + break; + } + } + if (cc < size) { + (void) fprintf(stderr, "Short write\n"); + return 0; + } + return cc == size; +} + +/* do a command once for a specified file 'f' */ +static int +netpgp_cmd(netpgp_t *netpgp, prog_t *p, char *f) +{ + unsigned maxsize; + char *out; + char *in; + int ret; + int cc; + + if (f == NULL) { + cc = stdin_to_mem(netpgp, &in, &out, &maxsize); + ret = netpgp_verify_memory(netpgp, in, cc, + (p->cmd == VERIFY_CAT) ? out : NULL, + (p->cmd == VERIFY_CAT) ? maxsize : 0, + p->armour); + ret = show_output(out, ret, "Bad memory verification"); + free(in); + free(out); + return ret; + } + return netpgp_verify_file(netpgp, f, + (p->cmd == VERIFY) ? NULL : + (p->output) ? p->output : "-", + p->armour); +} + + +int +main(int argc, char **argv) +{ + netpgp_t netpgp; + prog_t p; + int optindex; + int homeset; + int ret; + int ch; + int i; + + (void) memset(&p, 0x0, sizeof(p)); + (void) memset(&netpgp, 0x0, sizeof(netpgp)); + homeset = 0; + p.progname = argv[0]; + p.overwrite = 1; + p.output = NULL; + if (argc < 2) { + print_usage(usage, p.progname); + exit(EXIT_ERROR); + } + /* set some defaults */ + netpgp_setvar(&netpgp, "hash", DEFAULT_HASH_ALG); + /* 4 MiB for a memory file */ + netpgp_setvar(&netpgp, "max mem alloc", "4194304"); + optindex = 0; + while ((ch = getopt_long(argc, argv, "", options, &optindex)) != -1) { + switch (options[optindex].val) { + case COREDUMPS: + netpgp_setvar(&netpgp, "coredumps", "allowed"); + p.cmd = options[optindex].val; + break; + case VERIFY: + case VERIFY_CAT: + p.cmd = options[optindex].val; + break; + case VERSION_CMD: + printf( +"%s\nAll bug reports, praise and chocolate, please, to:\n%s\n", + netpgp_get_info("version"), + netpgp_get_info("maintainer")); + exit(EXIT_SUCCESS); + /* options */ + case SSHKEYS: + netpgp_setvar(&netpgp, "ssh keys", "1"); + break; + case KEYRING: + if (optarg == NULL) { + (void) fprintf(stderr, + "No keyring argument provided\n"); + exit(EXIT_ERROR); + } + snprintf(p.keyring, sizeof(p.keyring), "%s", optarg); + break; + case USERID: + if (optarg == NULL) { + (void) fprintf(stderr, + "No userid argument provided\n"); + exit(EXIT_ERROR); + } + netpgp_setvar(&netpgp, "userid", optarg); + break; + case ARMOUR: + p.armour = 1; + break; + case VERBOSE: + netpgp_incvar(&netpgp, "verbose", 1); + break; + case HOMEDIR: + if (optarg == NULL) { + (void) fprintf(stderr, + "No home directory argument provided\n"); + exit(EXIT_ERROR); + } + netpgp_set_homedir(&netpgp, optarg, NULL, 0); + homeset = 1; + break; + case OUTPUT: + if (optarg == NULL) { + (void) fprintf(stderr, + "No output filename argument provided\n"); + exit(EXIT_ERROR); + } + if (p.output) { + (void) free(p.output); + } + p.output = strdup(optarg); + break; + case RESULTS: + if (optarg == NULL) { + (void) fprintf(stderr, + "No output filename argument provided\n"); + exit(EXIT_ERROR); + } + netpgp_setvar(&netpgp, "results", optarg); + break; + case SSHKEYFILE: + netpgp_setvar(&netpgp, "ssh keys", "1"); + netpgp_setvar(&netpgp, "sshkeyfile", optarg); + break; + case MAX_MEM_ALLOC: + netpgp_setvar(&netpgp, "max mem alloc", optarg); + break; + default: + p.cmd = HELP_CMD; + break; + } + } + if (!homeset) { + netpgp_set_homedir(&netpgp, getenv("HOME"), + netpgp_getvar(&netpgp, "ssh keys") ? "/.ssh" : "/.gnupg", 1); + } + /* initialise, and read keys from file */ + if (!netpgp_init(&netpgp)) { + printf("can't initialise\n"); + exit(EXIT_ERROR); + } + /* now do the required action for each of the command line args */ + ret = EXIT_SUCCESS; + if (optind == argc) { + if (!netpgp_cmd(&netpgp, &p, NULL)) { + ret = EXIT_FAILURE; + } + } else { + for (i = optind; i < argc; i++) { + if (!netpgp_cmd(&netpgp, &p, argv[i])) { + ret = EXIT_FAILURE; + } + } + } + netpgp_end(&netpgp); + exit(ret); +} |