Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/netpgp/dist/src/lib Avoid some type casts



details:   https://anonhg.NetBSD.org/src/rev/7f96294bb4d5
branches:  trunk
changeset: 822600:7f96294bb4d5
user:      khorben <khorben%NetBSD.org@localhost>
date:      Mon Mar 27 20:55:13 2017 +0000

description:
Avoid some type casts

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

No functional change intended.

diffstat:

 crypto/external/bsd/netpgp/dist/src/lib/keyring.c |  6 +++---
 crypto/external/bsd/netpgp/dist/src/lib/keyring.h |  2 +-
 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  |  6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diffs (72 lines):

diff -r 661a574690c4 -r 7f96294bb4d5 crypto/external/bsd/netpgp/dist/src/lib/keyring.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/keyring.c Mon Mar 27 20:50:19 2017 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/keyring.c Mon Mar 27 20:55:13 2017 +0000
@@ -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 @@
 
 /* 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 @@
        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:
diff -r 661a574690c4 -r 7f96294bb4d5 crypto/external/bsd/netpgp/dist/src/lib/keyring.h
--- a/crypto/external/bsd/netpgp/dist/src/lib/keyring.h Mon Mar 27 20:50:19 2017 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/keyring.h Mon Mar 27 20:55:13 2017 +0000
@@ -100,7 +100,7 @@
 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 *);
diff -r 661a574690c4 -r 7f96294bb4d5 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  Mon Mar 27 20:50:19 2017 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  Mon Mar 27 20:55:13 2017 +0000
@@ -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 @@
                                (unsigned)armored, (unsigned)cleartext,
                                overwrite);
        }
-       pgp_forget(seckey, (unsigned)sizeof(*seckey));
+       pgp_forget(seckey, sizeof(*seckey));
        return ret;
 }
 
@@ -1542,7 +1542,7 @@
        } else {
                ret = 0;
        }
-       pgp_forget(seckey, (unsigned)sizeof(*seckey));
+       pgp_forget(seckey, sizeof(*seckey));
        return ret;
 }
 



Home | Main Index | Thread Index | Old Index