fixed padding bug in RSA_encrypt()

This commit is contained in:
Andreas Steffen
2008-01-27 20:17:15 +00:00
parent 5bb8fcc074
commit e575b3daff
+4 -2
View File
@@ -442,11 +442,13 @@ RSA_encrypt(const RSA_public_key_t *key, chunk_t in)
*pos++ = 0x02;
/* pad with pseudo random bytes unequal to zero */
get_rnd_bytes(pos, padding);
for (i = 0; i < padding; i++)
{
get_rnd_bytes(pos, padding);
while (!*pos)
get_rnd_bytes(pos, 1);
{
get_rnd_bytes(pos, 1);
}
pos++;
}