pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/security/merkletree Initial import of merkletree-20140...
details: https://anonhg.NetBSD.org/pkgsrc/rev/b15482c9e04b
branches: trunk
changeset: 631428:b15482c9e04b
user: agc <agc%pkgsrc.org@localhost>
date: Wed Mar 05 05:19:25 2014 +0000
description:
Initial import of merkletree-20140304 into the Packages Collection
The merkletree(1) command performs Merkle tree calculation and
verification on the input data. This allows the establishment of the
block positions (i.e. relative neighbourhood) of any changed data.
diffstat:
security/merkletree/DESCR | 3 +
security/merkletree/Makefile | 21 +
security/merkletree/PLIST | 3 +
security/merkletree/distinfo | 1 +
security/merkletree/files/Makefile | 67 ++++
security/merkletree/files/Makefile.in | 22 +
security/merkletree/files/Makefile.lib.in | 23 +
security/merkletree/files/Makefile.libtool.in | 26 +
security/merkletree/files/configure | 65 ++++
security/merkletree/files/libmerkle.c | 374 ++++++++++++++++++++++++++
security/merkletree/files/libmerkletree.3 | 127 ++++++++
security/merkletree/files/main.c | 142 +++++++++
security/merkletree/files/merkletree.1 | 135 +++++++++
security/merkletree/files/merkletree.h | 67 ++++
14 files changed, 1076 insertions(+), 0 deletions(-)
diffs (truncated from 1132 to 300 lines):
diff -r 250aebc4128b -r b15482c9e04b security/merkletree/DESCR
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/security/merkletree/DESCR Wed Mar 05 05:19:25 2014 +0000
@@ -0,0 +1,3 @@
+The merkletree(1) command performs Merkle tree calculation and
+verification on the input data. This allows the establishment of the
+block positions (i.e. relative neighbourhood) of any changed data.
diff -r 250aebc4128b -r b15482c9e04b security/merkletree/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/security/merkletree/Makefile Wed Mar 05 05:19:25 2014 +0000
@@ -0,0 +1,21 @@
+# $NetBSD: Makefile,v 1.1.1.1 2014/03/05 05:19:25 agc Exp $
+
+DISTNAME= merkletree-20140304
+CATEGORIES= security
+MASTER_SITES= # not used
+DISTFILES= # not used
+
+MAINTAINER= agc%NetBSD.org@localhost
+HOMEPAGE= http://www.NetBSD.org/
+COMMENT= Library and utility to calculate merkle trees
+LICENSE= modified-bsd
+
+AUTO_MKDIRS= yes
+GNU_CONFIGURE= yes
+
+do-extract:
+ ${CP} -R ${FILESDIR} ${WRKSRC}
+
+.include "../../security/libmultigest/buildlink3.mk"
+
+.include "../../mk/bsd.pkg.mk"
diff -r 250aebc4128b -r b15482c9e04b security/merkletree/PLIST
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/security/merkletree/PLIST Wed Mar 05 05:19:25 2014 +0000
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2014/03/05 05:19:25 agc Exp $
+bin/merkletree
+man/man1/merkletree.1
diff -r 250aebc4128b -r b15482c9e04b security/merkletree/distinfo
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/security/merkletree/distinfo Wed Mar 05 05:19:25 2014 +0000
@@ -0,0 +1,1 @@
+$NetBSD: distinfo,v 1.1.1.1 2014/03/05 05:19:25 agc Exp $
diff -r 250aebc4128b -r b15482c9e04b security/merkletree/files/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/security/merkletree/files/Makefile Wed Mar 05 05:19:25 2014 +0000
@@ -0,0 +1,67 @@
+PROG=m
+SRCS=libmerkle.c main.c
+WARNS=6
+MKMAN=no
+CPPFLAGS+=-g -O0
+LDFLAGS+=-g -O0
+
+LDADD+= -lmultigest
+
+.include <bsd.prog.mk>
+
+t: ${PROG}
+ @echo "1. basic test"
+ ./${PROG} 1.in > 1.out
+ diff 1.expected 1.out
+ rm -f 1.out
+ @echo "2. blocksize"
+ ./${PROG} -b 1024 1.in > 2.out
+ diff 2.expected 2.out
+ rm -f 2.out
+ @echo "3. algorithm"
+ ./${PROG} -a md5 1.in > 3.out
+ diff 3.expected 3.out
+ rm -f 3.out
+ @echo "4. verify digests"
+ ./${PROG} -b 2048 1.in > 4.out
+ diff 4.expected 4.out
+ rm -f 4.out
+ @echo "5. stdin"
+ ./${PROG} < 1.in > 5.out
+ diff 5.expected 5.out
+ rm -f 5.out
+ @echo "6. concatenated digests"
+ ./${PROG} -a rmd160,sha1 1.in > 6.out
+ diff 6.expected 6.out
+ rm -f 6.out
+ @echo "7. concatenated digests"
+ ./${PROG} -a md5,sha256 1.in > 7.out
+ diff 7.expected 7.out
+ rm -f 7.out
+ @echo "8. concatenated digests"
+ ./${PROG} -a sha512,sha256 1.in > 8.out
+ diff 8.expected 8.out
+ rm -f 8.out
+ @echo "9. verify"
+ -./${PROG} -V 1.sum 2.in > 9.out
+ diff 9.expected 9.out
+ rm -f 9.out
+ @echo "10. verify again"
+ ./${PROG} -a sha512,sha256 1.in > 2.sum
+ -./${PROG} -V 2.sum 2.in > 10.out
+ diff 10.expected 10.out
+ rm -f 2.sum 10.out
+ @echo "11. verify again again"
+ ./${PROG} -b 128 -a sha512,sha256 1.in > 2.sum
+ -./${PROG} -V 2.sum 2.in > 11.out
+ diff 11.expected 11.out
+ rm -f 2.sum 11.out
+ @echo "12. crc32c algorithm"
+ ./${PROG} -a crc32c 1.in > 12.out
+ diff 12.expected 12.out
+ rm -f 12.out
+ @echo "13. crc32c algorithm verify"
+ ./${PROG} -b 32 -a crc32c 1.in > 13.sum
+ -./${PROG} -V 13.sum 2.in > 13.out
+ diff 13.expected 13.out
+ rm -f 13.sum 13.out
diff -r 250aebc4128b -r b15482c9e04b security/merkletree/files/Makefile.in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/security/merkletree/files/Makefile.in Wed Mar 05 05:19:25 2014 +0000
@@ -0,0 +1,22 @@
+# $NetBSD: Makefile.in,v 1.1.1.1 2014/03/05 05:19:25 agc Exp $
+
+PROG=merkletree
+
+OBJS= libmerkle.o main.o
+
+PREFIX=@PREFIX@
+MANDIR=@MANDIR@
+
+all: ${PROG}
+
+${PROG}: ${OBJS}
+ ${CC} ${OBJS} -L${PREFIX}/lib -Wl,-R${PREFIX}/lib -o ${PROG} -lmultigest
+
+install:
+ install -c -s ${PROG} ${DESTDIR}${PREFIX}/bin
+ install -c merkletree.1 ${DESTDIR}${MANDIR}/man1
+
+clean:
+ rm -rf *.core ${OBJS} ${PROG}
+cleandist:
+ rm -rf *.core ${OBJS} ${PROG} Makefile
diff -r 250aebc4128b -r b15482c9e04b security/merkletree/files/Makefile.lib.in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/security/merkletree/files/Makefile.lib.in Wed Mar 05 05:19:25 2014 +0000
@@ -0,0 +1,23 @@
+# $NetBSD: Makefile.lib.in,v 1.1.1.1 2014/03/05 05:19:25 agc Exp $
+
+LIB= libmerkletree.a
+
+OBJS+= libmerkle.o
+
+PREFIX=@PREFIX@
+MANDIR=@MANDIR@
+
+all: ${LIB}
+
+${LIB}: ${OBJS}
+ ar crv ${LIB} ${OBJS}
+
+install:
+ ${BSD_INSTALL_LIB} ${LIB} ${DESTDIR}${PREFIX}/lib
+ ${BSD_INSTALL_DATA} merkletree.h ${DESTDIR}${PREFIX}/include
+ ${BSD_INSTALL_DATA} libmerkletree.3 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man3
+
+clean:
+ rm -rf *.core ${OBJS} ${LIB}
+cleandist:
+ rm -rf *.core ${OBJS} ${LIB} Makefile
diff -r 250aebc4128b -r b15482c9e04b security/merkletree/files/Makefile.libtool.in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/security/merkletree/files/Makefile.libtool.in Wed Mar 05 05:19:25 2014 +0000
@@ -0,0 +1,26 @@
+# $NetBSD: Makefile.libtool.in,v 1.1.1.1 2014/03/05 05:19:25 agc Exp $
+
+LIB= libmerkletree.a
+
+OBJS+= libmerkle.o
+
+PREFIX=@PREFIX@
+MANDIR=@MANDIR@
+
+all: ${LIB}
+
+${LIB}: ${OBJS}
+ ${LIBTOOL} --mode=link --tag=CC cc -o ${.TARGET:.a=.la} ${OBJS:.o=.lo} -rpath ${PREFIX}/lib -version-info 0:0
+
+.c.o:
+ ${LIBTOOL} --mode=compile --tag=CC ${CC} ${CFLAGS} -c $<
+
+install:
+ libtool --mode=install ${BSD_INSTALL_LIB} libmerkletree.la ${DESTDIR}${PREFIX}/lib
+ ${BSD_INSTALL_DATA} merkletree.h ${DESTDIR}${PREFIX}/include
+ ${BSD_INSTALL_DATA} libmerkletree.3 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man3
+
+clean:
+ rm -rf *.core ${OBJS} ${LIB}
+cleandist:
+ rm -rf *.core ${OBJS} ${LIB} Makefile
diff -r 250aebc4128b -r b15482c9e04b security/merkletree/files/configure
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/security/merkletree/files/configure Wed Mar 05 05:19:25 2014 +0000
@@ -0,0 +1,65 @@
+#! /bin/sh
+
+# $NetBSD: configure,v 1.1.1.1 2014/03/05 05:19:25 agc Exp $
+
+# Copyright (c) 2013 Alistair Crooks <agc%NetBSD.org@localhost>
+# 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.
+#
+
+# set up defs and paths, etc
+prefix=/usr/local
+mandir=${prefix}/man
+while [ $# -gt 0 ]; do
+ case "$1" in
+ # do all shells have ${1#--prefix=} yet?
+ --prefix=*) prefix=$(echo "$1" | sed -e 's|--prefix=||') ;;
+ --mandir=*) mandir=$(echo "$1" | sed -e 's|--mandir=||') ;;
+ --build=*|--host=*|--infodir=*) ;;
+ *) break ;;
+ esac
+ shift
+done
+
+rm -f config.h
+echo "#ifndef CONFIG_H_" > config.h
+echo "#define CONFIG_H_ $(date '+%Y%m%d')" >> config.h
+echo "" >> config.h
+
+# portability macros
+echo "#ifndef __UNCONST" >> config.h
+echo "#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))" >> config.h
+echo "#endif /* __UNCONST */" >> config.h
+echo "" >> config.h
+echo "#ifndef USE_ARG" >> config.h
+echo "#define USE_ARG(x) /*LINTED*/(void)&(x)" >> config.h
+echo "#endif /* USE_ARG */" >> config.h
+
+echo "" >> config.h
+echo "#endif /* CONFIG_H_ */" >> config.h
+
+for f in Makefile.in; do
+ sed -e 's|@PREFIX@|'${prefix}'|g' \
+ -e 's|@MANDIR@|'${mandir}'|g' $f > $(basename $f .in)
+done
+
+exit 0
diff -r 250aebc4128b -r b15482c9e04b security/merkletree/files/libmerkle.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/security/merkletree/files/libmerkle.c Wed Mar 05 05:19:25 2014 +0000
@@ -0,0 +1,374 @@
+/*-
+ * Copyright (c) 2013 Alistair Crooks <agc%NetBSD.org@localhost>
+ * 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 <sys/stat.h>
+#include <sys/mman.h>
+#include <sys/param.h>
+
Home |
Main Index |
Thread Index |
Old Index