Module Name:    src
Committed By:   rillig
Date:           Sat Aug 27 08:58:32 UTC 2022

Modified Files:
        src/crypto/external/bsd/netpgp/bin/netpgpverify: Makefile
        src/crypto/external/bsd/netpgp/dist/src/lib: keyring.c netpgp.c
        src/crypto/external/bsd/netpgp/dist/src/libmj: mj.c
        src/crypto/external/bsd/netpgp/dist/src/netpgpverify: rsa.c
        src/crypto/external/bsd/netpgp/lib/verify: Makefile

Log Message:
netpgp: fix or suppress a few lint warnings

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
    src/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile
cvs rdiff -u -r1.57 -r1.58 \
    src/crypto/external/bsd/netpgp/dist/src/lib/keyring.c
cvs rdiff -u -r1.105 -r1.106 \
    src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
cvs rdiff -u -r1.6 -r1.7 src/crypto/external/bsd/netpgp/dist/src/libmj/mj.c
cvs rdiff -u -r1.4 -r1.5 \
    src/crypto/external/bsd/netpgp/dist/src/netpgpverify/rsa.c
cvs rdiff -u -r1.13 -r1.14 src/crypto/external/bsd/netpgp/lib/verify/Makefile

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/bin/netpgpverify/Makefile
diff -u src/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile:1.18 src/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile:1.19
--- src/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile:1.18	Sun Oct 13 07:28:04 2019
+++ src/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile	Sat Aug 27 08:58:31 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.18 2019/10/13 07:28:04 mrg Exp $
+#	$NetBSD: Makefile,v 1.19 2022/08/27 08:58:31 rillig Exp $
 
 PROG=netpgpverify
 BINDIR=		/usr/bin
@@ -19,6 +19,10 @@ CPPFLAGS+=-g -O0
 LDFLAGS+=-g -O0
 .endif
 
+LINTFLAGS.bzlib.c+=	-X 161	# constant in conditional context
+LINTFLAGS.bzlib.c+=	-X 220	# fallthrough on case statement
+LINTFLAGS.zlib.c+=	-X 220	# fallthrough on case statement
+
 MAN=	netpgpverify.1
 WARNS=	5
 

Index: src/crypto/external/bsd/netpgp/dist/src/lib/keyring.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/keyring.c:1.57 src/crypto/external/bsd/netpgp/dist/src/lib/keyring.c:1.58
--- src/crypto/external/bsd/netpgp/dist/src/lib/keyring.c:1.57	Wed Oct 14 05:19:41 2020
+++ src/crypto/external/bsd/netpgp/dist/src/lib/keyring.c	Sat Aug 27 08:58:32 2022
@@ -57,7 +57,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: keyring.c,v 1.57 2020/10/14 05:19:41 jhigh Exp $");
+__RCSID("$NetBSD: keyring.c,v 1.58 2022/08/27 08:58:32 rillig Exp $");
 #endif
 
 #ifdef HAVE_FCNTL_H
@@ -837,11 +837,8 @@ pgp_keyring_filewrite(pgp_keyring_t *key
 	unsigned	 	res = 1;
 	pgp_key_t		*key;
 	unsigned	 	n;
-	unsigned	 	keyc = (keyring != NULL) ? keyring->keyc : 0;
-	char 			*cp;
 	pgp_content_enum	type;
 	pgp_armor_type_t	atype;
-	char			keyid[PGP_KEY_ID_SIZE * 3];
 
 	fd = pgp_setup_file_write(&output, filename, 1);
 	if (fd < 0) {

Index: src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.105 src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.106
--- src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.105	Sat Aug 27 08:35:01 2022
+++ src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c	Sat Aug 27 08:58:32 2022
@@ -34,7 +34,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: netpgp.c,v 1.105 2022/08/27 08:35:01 rillig Exp $");
+__RCSID("$NetBSD: netpgp.c,v 1.106 2022/08/27 08:58:32 rillig Exp $");
 #endif
 
 #include <sys/types.h>
@@ -471,7 +471,7 @@ get_duration(char *s)
 {
 	uint64_t	 now;
 	int64_t	 	 t;
-	char		*mult;
+	const char	*mult;
 
 	if (s == NULL) {
 		return 0;
@@ -584,8 +584,6 @@ p(FILE *fp, const char *s, ...)
 static void
 pobj(FILE *fp, mj_t *obj, int depth)
 {
-	unsigned	 i;
-	char		*s;
 
 	if (obj == NULL) {
 		(void) fprintf(stderr, "No object found\n");

Index: src/crypto/external/bsd/netpgp/dist/src/libmj/mj.c
diff -u src/crypto/external/bsd/netpgp/dist/src/libmj/mj.c:1.6 src/crypto/external/bsd/netpgp/dist/src/libmj/mj.c:1.7
--- src/crypto/external/bsd/netpgp/dist/src/libmj/mj.c:1.6	Tue Nov 13 14:52:30 2018
+++ src/crypto/external/bsd/netpgp/dist/src/libmj/mj.c	Sat Aug 27 08:58:32 2022
@@ -299,7 +299,6 @@ mj_snprint(char *buf, size_t size, mj_t 
 			*bp = 0x0;
 			return bp - buf;
 		}
-		break;
 	case MJ_ARRAY:
 		cc = snprintf(buf, size, "[ ");
 		for (i = 0 ; i < atom->c ; i++) {

Index: src/crypto/external/bsd/netpgp/dist/src/netpgpverify/rsa.c
diff -u src/crypto/external/bsd/netpgp/dist/src/netpgpverify/rsa.c:1.4 src/crypto/external/bsd/netpgp/dist/src/netpgpverify/rsa.c:1.5
--- src/crypto/external/bsd/netpgp/dist/src/netpgpverify/rsa.c:1.4	Mon May  4 00:18:34 2020
+++ src/crypto/external/bsd/netpgp/dist/src/netpgpverify/rsa.c	Sat Aug 27 08:58:32 2022
@@ -502,7 +502,7 @@ netpgpv_DSA_size(const NETPGPV_DSA *dsa)
 	return (dsa == NULL) ? 0 : PGPV_BN_num_bits(dsa->p);
 }
 
-unsigned 
+unsigned
 netpgpv_dsa_verify(const signature_t *signature,
 	const netpgpv_dsa_pubkey_t *pubdsa, const uint8_t *calculated,
 	size_t hash_length)
@@ -513,7 +513,7 @@ netpgpv_dsa_verify(const signature_t *si
 	int	             ret;
 
 	if (signature == NULL || pubdsa == NULL || calculated == NULL) {
-		return -1;
+		return (unsigned)-1;
 	}
 	(void) memset(&osig, 0x0, sizeof(osig));
 	(void) memset(&odsa, 0x0, sizeof(odsa));

Index: src/crypto/external/bsd/netpgp/lib/verify/Makefile
diff -u src/crypto/external/bsd/netpgp/lib/verify/Makefile:1.13 src/crypto/external/bsd/netpgp/lib/verify/Makefile:1.14
--- src/crypto/external/bsd/netpgp/lib/verify/Makefile:1.13	Sun May  3 21:46:37 2020
+++ src/crypto/external/bsd/netpgp/lib/verify/Makefile	Sat Aug 27 08:58:32 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2020/05/03 21:46:37 christos Exp $
+# $NetBSD: Makefile,v 1.14 2022/08/27 08:58:32 rillig Exp $
 
 LIB=netpgpverify
 SRCS+=b64.c
@@ -30,6 +30,10 @@ INCSDIR=/usr/include/netpgp
 COPTS+=			${${ACTIVE_CC} == "gcc":? -Wno-implicit-fallthrough :}
 COPTS.libverify.c+=	${GCC_NO_FORMAT_TRUNCATION}
 
+LINTFLAGS.bzlib.c+=	-X 161	# constant in conditional context
+LINTFLAGS.bzlib.c+=	-X 220	# fallthrough on case statement
+LINTFLAGS.zlib.c+=	-X 220	# fallthrough on case statement
+
 LDFLAGS+=-Wl,--version-script=${.CURDIR}/verify.map
 
 .include <bsd.lib.mk>

Reply via email to