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.
This commit is contained in:
Timo Schulz 2003-08-20 20:20:59 +00:00
parent 238a1b26b8
commit 4498a55dfb
2 changed files with 8 additions and 3 deletions

View File

@ -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>

View File

@ -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");