Module Name:    src
Committed By:   martin
Date:           Sun May  6 09:47:47 UTC 2018

Modified Files:
        src/crypto/external/bsd/netpgp/dist/src/lib [netbsd-8]: libnetpgp.3
        src/crypto/external/bsd/netpgp/dist/src/libbn [netbsd-8]: libnetpgpbn.3
        src/crypto/external/bsd/netpgp/dist/src/libmj [netbsd-8]: libmj.3
        src/crypto/external/bsd/netpgp/dist/src/netpgpverify [netbsd-8]:
            netpgpverify.1

Log Message:
Pull up following revision(s) (requested by sevan in ticket #810):

        crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3: revision 1.5
        crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3: revision 1.6
        crypto/external/bsd/netpgp/dist/src/libmj/libmj.3: revision 1.8
        crypto/external/bsd/netpgp/dist/src/libmj/libmj.3: revision 1.9
        crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3: revision 1.20
        crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3: revision 1.21
        crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3: revision 1.22
        crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1: 
revision 1.12
        crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3: revision 1.23
        crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1: 
revision 1.13
        crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3: revision 1.19

Some further changes from PR bin/48395.

Drop superfluous zero prefix for single digit number days.
heads up by wiz

Break down explanation of netpgp_init to make it easier to extend.

Document how the userid is obtained.

Remove trailing whitespace.

Add the following functions to the list (TODO - add descriptions)
netpgp_unsetvar
netpgp_list_keys_json
netpgp_match_keys
netpgp_match_keys_json
netpgp_match_pubkeys
netpgp_validate_sigs
netpgp_format_json

Remove netpgp_match_list_keys() as function does not exist

Add missing output file to netpgp_verify_file() argument list

Sprinkle const to arguments


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.18.1 \
    src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3
cvs rdiff -u -r1.4 -r1.4.18.1 \
    src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3
cvs rdiff -u -r1.7 -r1.7.18.1 \
    src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3
cvs rdiff -u -r1.11 -r1.11.4.1 \
    src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.16 src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.16.18.1
--- src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.16	Mon Feb 17 07:23:18 2014
+++ src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3	Sun May  6 09:47:47 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: libnetpgp.3,v 1.16 2014/02/17 07:23:18 agc Exp $
+.\" $NetBSD: libnetpgp.3,v 1.16.18.1 2018/05/06 09:47:47 martin Exp $
 .\"
 .\" Copyright (c) 2009,2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 16, 2014
+.Dd April 29, 2018
 .Dt LIBNETPGP 3
 .Os
 .Sh NAME
@@ -79,6 +79,10 @@ The following functions are for variable
 .Fo netpgp_incvar
 .Fa "netpgp_t *netpgp" "const char *name" "const int delta"
 .Fc
+.Ft int
+.Fo netpgp_unsetvar
+.Fa "netpgp_t *netpgp" "const char *name"
+.Fc
 .Pp
 The following function sets the home directory:
 .Ft int
@@ -92,8 +96,20 @@ The following functions are used for key
 .Fa "netpgp_t *netpgp" "const int printsigs"
 .Fc
 .Ft int
-.Fo netpgp_match_list_keys
-.Fa "netpgp_t *netpgp" "char *pattern"
+.Fo netpgp_list_keys_json
+.Fa "netpgp_t *netpgp" "char **json" "const int psigs"
+.Fc
+.Ft int
+.Fo netpgp_match_keys
+.Fa "netpgp_t *netpgp" "char *name" "const char *fmt" "void *vp" "const int psigs"
+.Fc
+.Ft int
+.Fo netpgp_match_keys_json
+.Fa "netpgp_t *netpgp" "char **json" "char *name" "const char *fmt" "const int psigs"
+.Fc
+.Ft int
+.Fo netpgp_match_pubkeys
+.Fa "netpgp_t *netpgp" "char *name" "void *vp"
 .Fc
 .Ft int
 .Fo netpgp_find_key
@@ -101,7 +117,7 @@ The following functions are used for key
 .Fc
 .Ft char *
 .Fo netpgp_get_key
-.Fa "netpgp_t *netpgp" "const char *id"
+.Fa "netpgp_t *netpgp" "const char *name" "const char *fmt"
 .Fc
 .Ft int
 .Fo netpgp_export_key
@@ -115,31 +131,39 @@ The following functions are used for key
 .Fo netpgp_generate_key
 .Fa "netpgp_t *netpgp" "char *userid" "int numbits"
 .Fc
+.Ft int
+.Fo netpgp_validate_sigs
+.Fa "netpgp_t *netpgp"
+.Fc
+.Ft int
+.Fo netpgp_format_json
+.Fa "void *vp" "const char *json" "const int psigs"
+.Fc
 .Pp
 The following functions are used for file management:
 .Ft int
 .Fo netpgp_encrypt_file
-.Fa "netpgp_t *netpgp" "char *userid" "char *filename" "char *out"
+.Fa "netpgp_t *netpgp" "const char *userid" "const char *filename" "char *out"
 .Fa "int armored"
 .Fc
 .Ft int
 .Fo netpgp_decrypt_file
-.Fa "netpgp_t *netpgp" "char *filename" "char *out" "int armored"
+.Fa "netpgp_t *netpgp" "const char *filename" "char *out" "int armored"
 .Fc
 .Ft int
 .Fo netpgp_sign_file
-.Fa "netpgp_t *netpgp" "char *userid" "char *filename" "char *out"
+.Fa "netpgp_t *netpgp" "const char *userid" "const char *filename" "char *out"
 .Fa "int armored" "int cleartext" "int detached"
 .Fc
 .Ft int
 .Fo netpgp_verify_file
-.Fa "netpgp_t *netpgp" "char *f" "int armored"
+.Fa "netpgp_t *netpgp" "const char *in" "const char *out" "int armored"
 .Fc
 .Pp
 The following functions are used for memory signing and encryption:
 .Ft int
 .Fo netpgp_encrypt_memory
-.Fa "netpgp_t *netpgp" "char *userid" "void *in" "const size_t insize"
+.Fa "netpgp_t *netpgp" "const char *userid" "void *in" "const size_t insize"
 .Fa "char *out" "size_t outsize" "int armored"
 .Fc
 .Ft int
@@ -172,12 +196,13 @@ Normal operation sees the
 .Nm
 process be initialised using the
 .Fn netpgp_init
-function, which will set up the public and private keyrings, and set the
-user identity to the
+function, which will set up the public and private keyrings, as well as set the
+user identity in the
 .Ar userid
-argument passed stored in the
+member of the
 .Dv netpgp_t
-structure, and set using the
+structure.
+These are set using the
 .Fn netpgp_setvar
 function.
 If no public key ring file is set, initial values will be taken from those
@@ -189,6 +214,13 @@ initial values will be taken from those
 in the
 .Pa .gnupg/secring.gpg
 file in the user's home directory.
+The user identity is obtained from the
+.Ev userid
+environment variable, or failing that, the value of the
+.Dq default-key
+setting from
+.Pa .gnupg/gpg.conf
+file in the user's home directory is used.
 The
 .Fn netpgp_init
 function returns 1 on success, 0 on failure.
@@ -198,13 +230,6 @@ To list all the keys in a keyring, the
 function is used.
 The signature subkey fields can also be displayed
 using this function.
-The
-.Fn netpgp_match_list_keys
-function is used to match (via regular expression)
-a subset of the keys in the keyring.
-If the expression to match is NULL,
-the search will degenerate into a
-listing of all keys in the keyring.
 .Pp
 The home directory is specified as an internal variable,
 and its existence is checked using the
@@ -223,13 +248,13 @@ Output is sent to the standard output.
 .Pp
 To import a key onto the public keyring, the
 .Fn netpgp_import_key
-is used.
+function is used.
 The name of the file containing the key to be imported is provided
 as the filename argument.
 .Pp
 To generate a key, the
 .Fn netpgp_generate_key
-is used.
+function is used.
 It takes an argument of the number of bits to use in the key.
 At the time that this manual page was created (April 2009),
 the recommendations are that the bare minimum key size

Index: src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3
diff -u src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3:1.4 src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3:1.4.18.1
--- src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3:1.4	Mon Feb 17 07:23:18 2014
+++ src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3	Sun May  6 09:47:47 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: libnetpgpbn.3,v 1.4 2014/02/17 07:23:18 agc Exp $
+.\" $NetBSD: libnetpgpbn.3,v 1.4.18.1 2018/05/06 09:47:47 martin Exp $
 .\"
 .\" Copyright (c) 2010 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 February 16, 2014
+.Dd April 3, 2018
 .Dt LIBNETPGPBN 3
 .Os
 .Sh NAME
@@ -257,7 +257,7 @@ in the
 buffer called
 .Va buf
 where
-.Dq USERNAME
+.Dq USER
 is the name of the user taken from the runtime environment.
 The encoded text will be in an allocated buffer called
 .Va s .

Index: src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3
diff -u src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3:1.7 src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3:1.7.18.1
--- src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3:1.7	Mon Feb 17 07:23:18 2014
+++ src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3	Sun May  6 09:47:47 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: libmj.3,v 1.7 2014/02/17 07:23:18 agc Exp $
+.\" $NetBSD: libmj.3,v 1.7.18.1 2018/05/06 09:47:47 martin Exp $
 .\"
 .\" Copyright (c) 2010 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 February 16, 2014
+.Dd April 3, 2018
 .Dt LIBMJ 3
 .Os
 .Sh NAME
@@ -227,10 +227,10 @@ in the
 buffer called
 .Va buf
 where
-.Dq USERNAME
+.Dq USER
 is the name of the user taken from the runtime environment.
 The encoded text will be in an allocated buffer called
-.Va s
+.Va s .
 .Bd -literal -offset indent
 mj_t atom;
 char buf[BUFSIZ];

Index: src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1
diff -u src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1:1.11 src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1:1.11.4.1
--- src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1:1.11	Mon Apr 17 19:50:28 2017
+++ src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1	Sun May  6 09:47:47 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: netpgpverify.1,v 1.11 2017/04/17 19:50:28 agc Exp $
+.\" $NetBSD: netpgpverify.1,v 1.11.4.1 2018/05/06 09:47:47 martin Exp $
 .\"
 .\" Copyright (c) 2013,2014,2015 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 January 15, 2015
+.Dd April 3, 2018
 .Dt NETPGPVERIFY 1
 .Os
 .Sh NAME
@@ -143,9 +143,16 @@ or 2 if any other error occurs.
 .\" .Xr libbz2 3 ,
 .Xr zlib 3
 .Sh STANDARDS
-The
-.Nm
-utility is designed to conform to IETF RFC 4880.
+.Rs
+.%A J. Callas
+.%A L. Donnerhacke
+.%A H. Finney
+.%A D. Shaw
+.%A R. Thayer
+.%D November 2007
+.%R RFC 4880
+.%T OpenPGP Message Format
+.Re
 .Sh HISTORY
 The
 .Nm

Reply via email to