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 Don't warn about err...
details: https://anonhg.NetBSD.org/src/rev/f008f4998422
branches: trunk
changeset: 753912:f008f4998422
user: agc <agc%NetBSD.org@localhost>
date: Wed Apr 14 00:18:46 2010 +0000
description:
Don't warn about erroneous errors in skey_checksum_finaliser().
Allocate space for the checkhash before attempting to use it - a
long-standing bug from openpgpsdk. Part of the fix for PR 42435 from
Jukka Ruohonen.
diffstat:
crypto/external/bsd/netpgp/dist/src/lib/writer.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diffs (36 lines):
diff -r 6d2087290197 -r f008f4998422 crypto/external/bsd/netpgp/dist/src/lib/writer.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/writer.c Tue Apr 13 22:46:10 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/writer.c Wed Apr 14 00:18:46 2010 +0000
@@ -58,7 +58,7 @@
#if defined(__NetBSD__)
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: writer.c,v 1.19 2010/03/05 16:01:10 agc Exp $");
+__RCSID("$NetBSD: writer.c,v 1.20 2010/04/14 00:18:46 agc Exp $");
#endif
#include <sys/types.h>
@@ -1351,10 +1351,10 @@
skey_checksum_t *sum;
sum = __ops_writer_get_arg(writer);
- if (errors) {
+ if (errors && *errors) {
printf("errors in skey_checksum_finaliser\n");
}
- sum->hash.finish(&sum->hash, sum->hashed);
+ (*sum->hash.finish)(&sum->hash, sum->hashed);
return 1;
}
@@ -1384,7 +1384,9 @@
} else {
/* configure the arg */
sum->hash_alg = seckey->hash_alg;
- sum->hashed = seckey->checkhash;
+ if ((sum->hashed = seckey->checkhash) == NULL) {
+ sum->hashed = seckey->checkhash = calloc(1, OPS_CHECKHASH_SIZE);
+ }
/* init the hash */
__ops_hash_any(&sum->hash, sum->hash_alg);
if (!sum->hash.init(&sum->hash)) {
Home |
Main Index |
Thread Index |
Old Index