summaryrefslogtreecommitdiffstats
path: root/agent
diff options
context:
space:
mode:
authorTimo Schulz <twoaday@freakmail.de>2003-08-20 22:20:59 +0200
committerTimo Schulz <twoaday@freakmail.de>2003-08-20 22:20:59 +0200
commit4498a55dfb2d8e294f72571e339c889b5bf5f664 (patch)
tree2cd284be3ca098dcef2fd02fe4fde2ead0fea7ad /agent
parent2003-08-20 Marcus Brinkmann <marcus@g10code.de> (diff)
downloadgnupg2-4498a55dfb2d8e294f72571e339c889b5bf5f664.tar.xz
gnupg2-4498a55dfb2d8e294f72571e339c889b5bf5f664.zip
2003-08-20 Timo Schulz <twoaday@freakmail.de>
* pksign.c (do_encode_md): Allocate enough space. Cast md byte to unsigned char to prevent sign extension.
Diffstat (limited to 'agent')
-rw-r--r--agent/ChangeLog7
-rw-r--r--agent/pksign.c4
2 files changed, 8 insertions, 3 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog
index 0c7857811..39e93f818 100644
--- a/agent/ChangeLog
+++ b/agent/ChangeLog
@@ -1,6 +1,11 @@
+2003-08-20 Timo Schulz <twoaday@freakmail.de>
+
+ * pksign.c (do_encode_md): Allocate enough space. Cast md
+ byte to unsigned char to prevent sign extension.
+
2003-08-14 Timo Schulz <twoaday@freakmail.de>
- * pksign.c: do_encode_md: Due to the fact pkcs#1 padding
+ * pksign.c (do_encode_md): Due to the fact pkcs#1 padding
is now in Libgcrypt, use the new interface.
2003-07-31 Werner Koch <wk@gnupg.org>
diff --git a/agent/pksign.c b/agent/pksign.c
index 3022e79a7..200b6a2cc 100644
--- a/agent/pksign.c
+++ b/agent/pksign.c
@@ -39,7 +39,7 @@ do_encode_md (const byte * md, size_t mdlen, int algo, gcry_sexp_t * r_hash)
char * p, tmp[16];
int i, rc;
- p = xmalloc (64+mdlen);
+ p = xmalloc (64 + 2 * mdlen);
s = gcry_md_algo_name (algo);
if (s && strlen (s) < 16)
{
@@ -50,7 +50,7 @@ do_encode_md (const byte * md, size_t mdlen, int algo, gcry_sexp_t * r_hash)
sprintf (p, "(data\n (flags pkcs1)\n (hash %s #", tmp);
for (i=0; i < mdlen; i++)
{
- sprintf (tmp, "%02x", md[i]);
+ sprintf (tmp, "%02x", (byte)md[i]);
strcat (p, tmp);
}
strcat (p, "#))\n");