Module Name: src Committed By: agc Date: Wed Apr 14 00:18:46 UTC 2010
Modified Files: src/crypto/external/bsd/netpgp/dist/src/lib: writer.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 \ src/crypto/external/bsd/netpgp/dist/src/lib/writer.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/writer.c diff -u src/crypto/external/bsd/netpgp/dist/src/lib/writer.c:1.19 src/crypto/external/bsd/netpgp/dist/src/lib/writer.c:1.20 --- src/crypto/external/bsd/netpgp/dist/src/lib/writer.c:1.19 Fri Mar 5 16:01:10 2010 +++ src/crypto/external/bsd/netpgp/dist/src/lib/writer.c Wed Apr 14 00:18:46 2010 @@ -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)) {