mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
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:
parent
238a1b26b8
commit
4498a55dfb
@ -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>
|
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.
|
is now in Libgcrypt, use the new interface.
|
||||||
|
|
||||||
2003-07-31 Werner Koch <wk@gnupg.org>
|
2003-07-31 Werner Koch <wk@gnupg.org>
|
||||||
|
@ -39,7 +39,7 @@ do_encode_md (const byte * md, size_t mdlen, int algo, gcry_sexp_t * r_hash)
|
|||||||
char * p, tmp[16];
|
char * p, tmp[16];
|
||||||
int i, rc;
|
int i, rc;
|
||||||
|
|
||||||
p = xmalloc (64+mdlen);
|
p = xmalloc (64 + 2 * mdlen);
|
||||||
s = gcry_md_algo_name (algo);
|
s = gcry_md_algo_name (algo);
|
||||||
if (s && strlen (s) < 16)
|
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);
|
sprintf (p, "(data\n (flags pkcs1)\n (hash %s #", tmp);
|
||||||
for (i=0; i < mdlen; i++)
|
for (i=0; i < mdlen; i++)
|
||||||
{
|
{
|
||||||
sprintf (tmp, "%02x", md[i]);
|
sprintf (tmp, "%02x", (byte)md[i]);
|
||||||
strcat (p, tmp);
|
strcat (p, tmp);
|
||||||
}
|
}
|
||||||
strcat (p, "#))\n");
|
strcat (p, "#))\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user