Module Name:    othersrc
Committed By:   agc
Date:           Sun Aug 18 04:45:26 UTC 2013

Modified Files:
        othersrc/external/bsd/multigest/bin: Makefile
        othersrc/external/bsd/multigest/dist: libmultigest.3 main.c multigest.1
            multigest.c multigest.h
Added Files:
        othersrc/external/bsd/multigest/bin: 21.expected

Log Message:
introduce an output separator to multigest(1), suggested by Thomas Klausner.

Use the output separator to separate the individual digests in the output.
The output separator defaults to the null string, i.e. no output separator.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/multigest/bin/21.expected
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/multigest/bin/Makefile
cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/multigest/dist/libmultigest.3 \
    othersrc/external/bsd/multigest/dist/main.c \
    othersrc/external/bsd/multigest/dist/multigest.c \
    othersrc/external/bsd/multigest/dist/multigest.h
cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/multigest/dist/multigest.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/multigest/bin/Makefile
diff -u othersrc/external/bsd/multigest/bin/Makefile:1.2 othersrc/external/bsd/multigest/bin/Makefile:1.3
--- othersrc/external/bsd/multigest/bin/Makefile:1.2	Sat Aug 17 18:29:35 2013
+++ othersrc/external/bsd/multigest/bin/Makefile	Sun Aug 18 04:45:26 2013
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2013/08/17 18:29:35 agc Exp $
+# $NetBSD: Makefile,v 1.3 2013/08/18 04:45:26 agc Exp $
 
 .include <bsd.own.mk>
 
@@ -85,3 +85,6 @@ t: ${PROG}
 	env LD_LIBRARY_PATH=${LIB_MULTIGEST_DIR} ./${PROG} -o 20.out -a blake2,crc32c,md5,rmd160,sha1,sha256,sha3-224,sha3-256,sha3-384,sha3-512,sha512,size,tiger2,tiger,whirlpool -r 2.in
 	diff 20.expected 20.out
 	rm -f 20.out
+	env LD_LIBRARY_PATH=${LIB_MULTIGEST_DIR} ./${PROG} -o 21.out -S, -a blake2,crc32c,md5,rmd160,sha1,sha256,sha3-224,sha3-256,sha3-384,sha3-512,sha512,size,tiger2,tiger,whirlpool -r 2.in
+	diff 21.expected 21.out
+	rm -f 21.out

Index: othersrc/external/bsd/multigest/dist/libmultigest.3
diff -u othersrc/external/bsd/multigest/dist/libmultigest.3:1.3 othersrc/external/bsd/multigest/dist/libmultigest.3:1.4
--- othersrc/external/bsd/multigest/dist/libmultigest.3:1.3	Sat Aug 17 20:15:35 2013
+++ othersrc/external/bsd/multigest/dist/libmultigest.3	Sun Aug 18 04:45:26 2013
@@ -1,4 +1,4 @@
-.\" $NetBSD: libmultigest.3,v 1.3 2013/08/17 20:15:35 agc Exp $
+.\" $NetBSD: libmultigest.3,v 1.4 2013/08/18 04:45:26 agc Exp $
 .\"
 .\" Copyright (c) 2013 Alistair Crooks <[email protected]>
 .\" All rights reserved.
@@ -23,7 +23,7 @@
 .\" (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 August 13, 2013
+.Dd August 17, 2013
 .Dt LIBMULTIGEST 3
 .Os
 .Sh NAME
@@ -78,6 +78,7 @@
 .Fo multigest_print_hex
 .Fa "unsigned char *rawinput" "const char *algorithms"
 .Fa "const char *outname" "const char *filename" "const char *substregex"
+.Fa "const char *output_separator"
 .Fc
 .Sh DESCRIPTION
 .Nm
Index: othersrc/external/bsd/multigest/dist/main.c
diff -u othersrc/external/bsd/multigest/dist/main.c:1.3 othersrc/external/bsd/multigest/dist/main.c:1.4
--- othersrc/external/bsd/multigest/dist/main.c:1.3	Sat Aug 17 20:13:48 2013
+++ othersrc/external/bsd/multigest/dist/main.c	Sun Aug 18 04:45:26 2013
@@ -144,6 +144,7 @@ main(int argc, char **argv)
 	const char	*check;
 	const char	*alg;
 	const char	*sub;
+	const char	*sep;
 	uint8_t		 raw[8192];
 	char	 	 from[128];
 	char	 	 to[128];
@@ -151,10 +152,13 @@ main(int argc, char **argv)
 	int		 i;
 
 	alg = "sha1";
-	sub = outname = check = NULL;
+	sep = sub = outname = check = NULL;
 	from[0] = to[0] = 0x0;
-	while ((i = getopt(argc, argv, "a:c:o:rs:")) != -1) {
+	while ((i = getopt(argc, argv, "S:a:c:o:rs:")) != -1) {
 		switch(i) {
+		case 'S':
+			sep = optarg;
+			break;
 		case 'a':
 			alg = optarg;
 			break;
@@ -181,7 +185,7 @@ main(int argc, char **argv)
 		}
 	} else if (optind == argc) {
 		if (do_input(alg, raw, from, to)) {
-			multigest_print_hex(raw, alg, outname, NULL, sub);
+			multigest_print_hex(raw, alg, outname, NULL, sub, sep);
 		} else {
 			ok = 0;
 		}
@@ -190,7 +194,7 @@ main(int argc, char **argv)
 			if (multigest_file(alg, argv[i], raw, from, to) == NULL) {
 				ok = 0;
 			} else {
-				multigest_print_hex(raw, alg, outname, argv[i], sub);
+				multigest_print_hex(raw, alg, outname, argv[i], sub, sep);
 			}
 		}
 	}
Index: othersrc/external/bsd/multigest/dist/multigest.c
diff -u othersrc/external/bsd/multigest/dist/multigest.c:1.3 othersrc/external/bsd/multigest/dist/multigest.c:1.4
--- othersrc/external/bsd/multigest/dist/multigest.c:1.3	Sat Aug 17 20:13:48 2013
+++ othersrc/external/bsd/multigest/dist/multigest.c	Sun Aug 18 04:45:26 2013
@@ -639,7 +639,7 @@ multigest_format_hex(uint8_t *raw, const
 
 /* print as hex string */
 int
-multigest_print_hex(uint8_t *raw, const char *algname, const char *outname, const char *f, const char *sub)
+multigest_print_hex(uint8_t *raw, const char *algname, const char *outname, const char *f, const char *sub, const char *sep)
 {
 	const Alg	*alg;
 	size_t		 rawsize;
@@ -671,6 +671,9 @@ multigest_print_hex(uint8_t *raw, const 
 		for (i = 0 ; i < alg->rawsize ; i++) {
 			fprintf(fp, "%02hhx", raw[rawsize + i]);
 		}
+		if (sep) {
+			fprintf(fp, "%s", sep);
+		}
 		algname += alg->namelen;
 		if (*algname == ',') {
 			algname += 1;
Index: othersrc/external/bsd/multigest/dist/multigest.h
diff -u othersrc/external/bsd/multigest/dist/multigest.h:1.3 othersrc/external/bsd/multigest/dist/multigest.h:1.4
--- othersrc/external/bsd/multigest/dist/multigest.h:1.3	Sat Aug 17 20:13:48 2013
+++ othersrc/external/bsd/multigest/dist/multigest.h	Sun Aug 18 04:45:26 2013
@@ -89,7 +89,7 @@ uint8_t *multigest_file(const char */*al
 void multigest_unpcstring(const char */*in*/, size_t /*isize*/, char */*out*/, size_t /*osize*/);
 uint32_t multigest_get_rawsize(multigest_t */*multigest*/);
 int multigest_format_hex(uint8_t */*raw*/, const char */*algname*/, char */*out*/, size_t /*size*/);
-int multigest_print_hex(uint8_t */*raw*/, const char */*algname*/, const char */*outname*/, const char */*f*/, const char */*sub*/);
+int multigest_print_hex(uint8_t */*raw*/, const char */*algname*/, const char */*outname*/, const char */*f*/, const char */*sub*/, const char */*sep*/);
 
 __END_DECLS
 

Index: othersrc/external/bsd/multigest/dist/multigest.1
diff -u othersrc/external/bsd/multigest/dist/multigest.1:1.4 othersrc/external/bsd/multigest/dist/multigest.1:1.5
--- othersrc/external/bsd/multigest/dist/multigest.1:1.4	Sat Aug 17 18:56:59 2013
+++ othersrc/external/bsd/multigest/dist/multigest.1	Sun Aug 18 04:45:26 2013
@@ -1,4 +1,4 @@
-.\" $NetBSD: multigest.1,v 1.4 2013/08/17 18:56:59 wiz Exp $
+.\" $NetBSD: multigest.1,v 1.5 2013/08/18 04:45:26 agc Exp $
 .\"
 .\" Copyright (c) 2013 Alistair Crooks <[email protected]>
 .\" All rights reserved.
@@ -23,7 +23,7 @@
 .\" (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 August 13, 2013
+.Dd August 17, 2013
 .Dt MULTIGEST 1
 .Os
 .Sh NAME
@@ -32,6 +32,7 @@
 .Sh SYNOPSIS
 .Nm
 .Fl r
+.Op Fl S Ar output-separator
 .Op Fl a Ar algorithms
 .Op Fl c Ar digestfile
 .Op Fl o Ar output
@@ -61,6 +62,9 @@ library.
 .Pp
 The following options are available:
 .Bl -tag -width XregexXreplacementXYYY
+.It Fl S Ar output-separator
+separate each individual digest on output with the provided string.
+The output separator defaults to the null string, i.e. no separator.
 .It Fl a Ar algorithms
 specifies a comma-separated list of algorithms to be calculated
 .It Fl c Ar stored-digest-file

Added files:

Index: othersrc/external/bsd/multigest/bin/21.expected
diff -u /dev/null othersrc/external/bsd/multigest/bin/21.expected:1.1
--- /dev/null	Sun Aug 18 04:45:26 2013
+++ othersrc/external/bsd/multigest/bin/21.expected	Sun Aug 18 04:45:26 2013
@@ -0,0 +1 @@
+BLAKE2,CRC32C,MD5,RMD160,SHA1,SHA256,SHA3-224,SHA3-256,SHA3-384,SHA3-512,SHA512,SIZE,TIGER2,TIGER,WHIRLPOOL (2.in) (,\%24(Id|NetBSD)[^%0a]*\%24,%24NetBSD%24) = 5388c3a6ac094bd49d82ca1404d111cbf1cbb64cd6a7cd47b7b366b1b89447988a96f2064d9e7d48746fee39128f33bfd3e537085d48088f7ddc6da8d4b2e7df,279934d7,b43c46ba05e28788df71eaea4777912f,faad8f20db6708582703a0ef4bc79a61c34a91bc,114f266e7a71dc51811df9dc994bce4de69170c9,835bc89fbf57f3a6aa9168b776bd3ef2ba6bcf6e6934a12380b10272ae73679c,1cd5c98e369f050cdef21f260e4930e2d4fb50dbd89ebe73b45867f8,c8db407d733900b40499f5103018696d773bb246a23d465d8fa2ef5a8b7ecf29,fd303cf644be9d1c638bb8aaf5f7ba48eadd3e7fd86f6fa3f4fd378e7d39626077a56b343e5beffe6dc1de78b33a4dfa,349259f3a560d4eaef508b4ce9cf1d84199b0a3db8dd0d4f5fe5d9e52beb40d660890296b1275cf75b49544ff76e0db804eca97aa9fc2e7c4de96a3fb8af2069,a92644bdf34583700776b58728501c15ee8300feb6ddba910c462618bce2221a0445036a2d46e676ef32988283372710701eb39fa7a59821b740bf07a3d364a5,0000000000001695,5be276d25e1bb131e
9f3089052492cfa3da484855759a532,38eb28030a6a3e9511e2d1dbee6e37c0dd3f93c55b149acf,4d77b962c86eb1303d186bf2fdc8f011511b0f720f3171850aec1a462e2067218ee672d0b66950cf7ee6078df0593a9fd22109984cc31b2fd327b223f1a7c634,

Reply via email to