From 64c690aaaf0fab35814b298c457b149c06778dc5 Mon Sep 17 00:00:00 2001 From: wiz Date: Sun, 1 Nov 2020 11:29:17 +0000 Subject: [PATCH] Sync with netpgpverify-20201101 from pkgsrc (the master for this). No effective change except for version bump. --- .../bsd/netpgp/dist/src/netpgpverify/HOWTO | 55 +++++++++++++++++++ .../netpgp/dist/src/netpgpverify/Makefile.in | 4 +- .../dist/src/netpgpverify/bzlib_private.h | 4 +- .../dist/src/netpgpverify/dash-escaped-text | 7 +++ .../src/netpgpverify/dash-escaped-text.asc | 21 +++++++ .../netpgp/dist/src/netpgpverify/libverify.c | 2 +- .../netpgpverify/{bzlib.h => netpgpv-bzlib.h} | 2 +- .../bsd/netpgp/dist/src/netpgpverify/verify.h | 4 +- .../netpgp/dist/src/netpgpverify/verify.map | 17 ++++++ 9 files changed, 108 insertions(+), 8 deletions(-) create mode 100644 crypto/external/bsd/netpgp/dist/src/netpgpverify/HOWTO create mode 100644 crypto/external/bsd/netpgp/dist/src/netpgpverify/dash-escaped-text create mode 100644 crypto/external/bsd/netpgp/dist/src/netpgpverify/dash-escaped-text.asc rename crypto/external/bsd/netpgp/dist/src/netpgpverify/{bzlib.h => netpgpv-bzlib.h} (98%) create mode 100644 crypto/external/bsd/netpgp/dist/src/netpgpverify/verify.map diff --git a/crypto/external/bsd/netpgp/dist/src/netpgpverify/HOWTO b/crypto/external/bsd/netpgp/dist/src/netpgpverify/HOWTO new file mode 100644 index 000000000000..b2a1d2253ab4 --- /dev/null +++ b/crypto/external/bsd/netpgp/dist/src/netpgpverify/HOWTO @@ -0,0 +1,55 @@ +How to use ssh keys in PGP signatures +===================================== + +1. generate a new ssh key pair + + % ssh-keygen -t rsa -b 4096 -f sshtest-20140202 + Generating public/private rsa key pair. + Enter passphrase (empty for no passphrase): + Enter same passphrase again: + Your identification has been saved in sshtest-20140202. + Your public key has been saved in sshtest-20140202.pub. + The key fingerprint is: + 73:98:cf:3d:89:05:a1:6b:39:6b:24:f9:10:32:7a:05 agc@netbsd-001.cupertino.alistaircrooks.com + The key's randomart image is: + +--[ RSA 4096]----+ + | E . | + | . . . | + | o o . . | + | . + o = . | + | . . + S . . | + | . * B + . | + | + + + | + | . . | + | | + +-----------------+ + % + +2. sign newdata using netpgp + + % netpgp -s -S sshtest-20140202 newdata + signature 4096/RSA (Encrypt or Sign) 1c5ef29143e3e3ae 2014-02-02 + Key fingerprint: a4eb b577 ff2e f878 ea40 8c14 1c5e f291 43e3 e3ae + uid netbsd-001.cupertino.alistaircrooks.com (sshtest-20140202.pub) + % + +3. verify signature on newdata + + % ./netpgpverify -S sshtest-20140202.pub newdata.gpg + Good signature for newdata.gpg made Sun Feb 2 13:40:07 2014 + signature 4096/RSA (Encrypt or Sign) 1c5ef29143e3e3ae 2014-02-02 + fingerprint a4eb b577 ff2e f878 ea40 8c14 1c5e f291 43e3 e3ae + uid netbsd-001.cupertino.alistaircrooks.com (sshtest-20140202.pub) + + % + +4. get the contents of the file (only if the signature verifies ok) + + % ./netpgpverify -c cat -S sshtest-20140202.pub newdata.gpg + /*- + * Copyright (c) 2012 Alistair Crooks + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: diff --git a/crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile.in b/crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile.in index d463af9574e4..1a8546eebf4c 100644 --- a/crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile.in +++ b/crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile.in @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.in,v 1.11 2017/04/17 19:50:28 agc Exp $ +# $NetBSD: Makefile.in,v 1.12 2020/11/01 11:29:17 wiz Exp $ PROG=netpgpverify @@ -16,7 +16,7 @@ MANDIR=@MANDIR@ all: ${PROG} ${PROG}: ${OBJS} - ${CC} ${OBJS} -o ${PROG} + ${CC} ${LDFLAGS} ${CFLAGS} ${OBJS} -o ${PROG} install: install -c -s ${PROG} ${DESTDIR}${PREFIX}/bin diff --git a/crypto/external/bsd/netpgp/dist/src/netpgpverify/bzlib_private.h b/crypto/external/bsd/netpgp/dist/src/netpgpverify/bzlib_private.h index f5100aa94475..d21ee70664d9 100644 --- a/crypto/external/bsd/netpgp/dist/src/netpgpverify/bzlib_private.h +++ b/crypto/external/bsd/netpgp/dist/src/netpgpverify/bzlib_private.h @@ -1,4 +1,4 @@ -/* $NetBSD: bzlib_private.h,v 1.4 2020/05/04 00:18:34 agc Exp $ */ +/* $NetBSD: bzlib_private.h,v 1.5 2020/11/01 11:29:17 wiz Exp $ */ /*-------------------------------------------------------------*/ @@ -32,7 +32,7 @@ #include #endif -#include "bzlib.h" +#include "netpgpv-bzlib.h" diff --git a/crypto/external/bsd/netpgp/dist/src/netpgpverify/dash-escaped-text b/crypto/external/bsd/netpgp/dist/src/netpgpverify/dash-escaped-text new file mode 100644 index 000000000000..014e4d7aa233 --- /dev/null +++ b/crypto/external/bsd/netpgp/dist/src/netpgpverify/dash-escaped-text @@ -0,0 +1,7 @@ +From sea to shining sea +Dash escape me harder +- at least once +-- no, twice +-well, curses, folied again +------- +-if it wasn't for you pesky kids, I'd have got away with it diff --git a/crypto/external/bsd/netpgp/dist/src/netpgpverify/dash-escaped-text.asc b/crypto/external/bsd/netpgp/dist/src/netpgpverify/dash-escaped-text.asc new file mode 100644 index 000000000000..100a7c8f7279 --- /dev/null +++ b/crypto/external/bsd/netpgp/dist/src/netpgpverify/dash-escaped-text.asc @@ -0,0 +1,21 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +- From sea to shining sea +Dash escape me harder +- - at least once +- -- no, twice +- -well, curses, folied again +- ------- +- -if it wasn't for you pesky kids, I'd have got away with it +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1 + +iQEcBAEBAgAGBQJXbXhIAAoJEBto3PzAWWgjuCUH/0kGBjK2RshejxKf+87xZNV9 +zSqoc17n5ViXDbVM5v7P6zAdjYVVaaZc6U+8DMJhbPbvbUTsEiFlp3Kh9BiBz5A5 +BtqXJmkyF2C5y/HTf9vPgbw8UAiqnNFYwlpWvrlxopAv31x7UIDNGJ9/oAKw0dqM +XujJub4lRBX+V2RlFWage/fAmuslq3lz7QJpLM5EpePNGQVXM1c9x+jhvgSXucHU +2UVcsUb8Y2nCXRoJKcIK4iGoIoqnoFk1WAa+/S593h2Iz+zzPqvVlPU1tyA27v/s +lgQ3DakeOeiae33gqK3iXqDNXady1te7hYGyhWT4G5Kuz+8tMMQXWAg4e+olEtk= +=n0R+ +-----END PGP SIGNATURE----- diff --git a/crypto/external/bsd/netpgp/dist/src/netpgpverify/libverify.c b/crypto/external/bsd/netpgp/dist/src/netpgpverify/libverify.c index f87eb32280d8..7d0818a50cad 100644 --- a/crypto/external/bsd/netpgp/dist/src/netpgpverify/libverify.c +++ b/crypto/external/bsd/netpgp/dist/src/netpgpverify/libverify.c @@ -40,7 +40,7 @@ #include #include -#include "bzlib.h" +#include "netpgpv-bzlib.h" #include "zlib.h" #include "array.h" diff --git a/crypto/external/bsd/netpgp/dist/src/netpgpverify/bzlib.h b/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpv-bzlib.h similarity index 98% rename from crypto/external/bsd/netpgp/dist/src/netpgpverify/bzlib.h rename to crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpv-bzlib.h index e6f8741ecef8..1d722bb798c3 100644 --- a/crypto/external/bsd/netpgp/dist/src/netpgpverify/bzlib.h +++ b/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpv-bzlib.h @@ -1,4 +1,4 @@ -/* $NetBSD: bzlib.h,v 1.2 2020/05/04 00:18:34 agc Exp $ */ +/* $NetBSD: netpgpv-bzlib.h,v 1.1 2020/11/01 11:29:17 wiz Exp $ */ /*-------------------------------------------------------------*/ diff --git a/crypto/external/bsd/netpgp/dist/src/netpgpverify/verify.h b/crypto/external/bsd/netpgp/dist/src/netpgpverify/verify.h index c39bc2d04d49..7f2db16dd5c6 100644 --- a/crypto/external/bsd/netpgp/dist/src/netpgpverify/verify.h +++ b/crypto/external/bsd/netpgp/dist/src/netpgpverify/verify.h @@ -23,9 +23,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef NETPGP_VERIFY_H_ -#define NETPGP_VERIFY_H_ 20200503 +#define NETPGP_VERIFY_H_ 20201101 -#define NETPGPVERIFY_VERSION "netpgpverify portable 20200503" +#define NETPGPVERIFY_VERSION "netpgpverify portable 20201101" #include diff --git a/crypto/external/bsd/netpgp/dist/src/netpgpverify/verify.map b/crypto/external/bsd/netpgp/dist/src/netpgpverify/verify.map new file mode 100644 index 000000000000..8da95be0a01f --- /dev/null +++ b/crypto/external/bsd/netpgp/dist/src/netpgpverify/verify.map @@ -0,0 +1,17 @@ +NETPGPVERIFY_5_0 { + global: + pgpv_new; + pgpv_new_cursor; + pgpv_read_pubring; + pgpv_read_ssh_pubkeys; + pgpv_verify; + pgpv_get_verified; + pgpv_dump; + pgpv_get_entry; + pgpv_get_cursor_num; + pgpv_get_cursor_str; + pgpv_get_cursor_element; + pgpv_close; + pgpv_cursor_close; + local: *; +};