Module Name:    src
Committed By:   khorben
Date:           Mon Mar 27 20:55:13 UTC 2017

Modified Files:
        src/crypto/external/bsd/netpgp/dist/src/lib: keyring.c keyring.h
            netpgp.c

Log Message:
Avoid some type casts

Submitted on tech-pkg@ as:
[PATCH 03/11] Avoid some type casts

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 \
    src/crypto/external/bsd/netpgp/dist/src/lib/keyring.c
cvs rdiff -u -r1.32 -r1.33 \
    src/crypto/external/bsd/netpgp/dist/src/lib/keyring.h
cvs rdiff -u -r1.100 -r1.101 \
    src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c

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/keyring.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/keyring.c:1.51 src/crypto/external/bsd/netpgp/dist/src/lib/keyring.c:1.52
--- src/crypto/external/bsd/netpgp/dist/src/lib/keyring.c:1.51	Mon Feb 20 00:51:08 2017
+++ src/crypto/external/bsd/netpgp/dist/src/lib/keyring.c	Mon Mar 27 20:55:13 2017
@@ -57,7 +57,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: keyring.c,v 1.51 2017/02/20 00:51:08 khorben Exp $");
+__RCSID("$NetBSD: keyring.c,v 1.52 2017/03/27 20:55:13 khorben Exp $");
 #endif
 
 #ifdef HAVE_FCNTL_H
@@ -214,7 +214,7 @@ pgp_get_writable_seckey(pgp_key_t *data)
 
 /* utility function to zero out memory */
 void
-pgp_forget(void *vp, unsigned size)
+pgp_forget(void *vp, size_t size)
 {
 	(void) memset(vp, 0x0, size);
 }
@@ -246,7 +246,7 @@ decrypt_cb(const pgp_packet_t *pkt, pgp_
 	case PGP_GET_PASSPHRASE:
 		(void) pgp_getpassphrase(decrypt->passfp, pass, sizeof(pass));
 		*content->skey_passphrase.passphrase = netpgp_strdup(pass);
-		pgp_forget(pass, (unsigned)sizeof(pass));
+		pgp_forget(pass, sizeof(pass));
 		return PGP_KEEP_MEMORY;
 
 	case PGP_PARSER_ERRCODE:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/keyring.h
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/keyring.h:1.32 src/crypto/external/bsd/netpgp/dist/src/lib/keyring.h:1.33
--- src/crypto/external/bsd/netpgp/dist/src/lib/keyring.h:1.32	Sun Nov  7 08:39:59 2010
+++ src/crypto/external/bsd/netpgp/dist/src/lib/keyring.h	Mon Mar 27 20:55:13 2017
@@ -100,7 +100,7 @@ int pgp_keyring_list(pgp_io_t *, const p
 int pgp_keyring_json(pgp_io_t *, const pgp_keyring_t *, mj_t *, const int);
 
 void pgp_set_seckey(pgp_contents_t *, const pgp_key_t *);
-void pgp_forget(void *, unsigned);
+void pgp_forget(void *, size_t);
 
 const uint8_t *pgp_get_key_id(const pgp_key_t *);
 unsigned pgp_get_userid_count(const pgp_key_t *);

Index: src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.100 src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.101
--- src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.100	Fri Feb 24 01:26:17 2017
+++ src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c	Mon Mar 27 20:55:13 2017
@@ -34,7 +34,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: netpgp.c,v 1.100 2017/02/24 01:26:17 khorben Exp $");
+__RCSID("$NetBSD: netpgp.c,v 1.101 2017/03/27 20:55:13 khorben Exp $");
 #endif
 
 #include <sys/types.h>
@@ -1411,7 +1411,7 @@ netpgp_sign_file(netpgp_t *netpgp,
 				(unsigned)armored, (unsigned)cleartext,
 				overwrite);
 	}
-	pgp_forget(seckey, (unsigned)sizeof(*seckey));
+	pgp_forget(seckey, sizeof(*seckey));
 	return ret;
 }
 
@@ -1542,7 +1542,7 @@ netpgp_sign_memory(netpgp_t *netpgp,
 	} else {
 		ret = 0;
 	}
-	pgp_forget(seckey, (unsigned)sizeof(*seckey));
+	pgp_forget(seckey, sizeof(*seckey));
 	return ret;
 }
 

Reply via email to