diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2008-01-27 20:17:15 +0000 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2008-01-27 20:17:15 +0000 |
commit | e575b3daff1b34359a80b907c1477343093f9f8e (patch) | |
tree | 8f2c858f06958b0469f3bdcabb206ddf53524089 /src | |
parent | 5bb8fcc074f713af03ab8399cfc57e6e8d7bbade (diff) | |
download | strongswan-e575b3daff1b34359a80b907c1477343093f9f8e.tar.bz2 strongswan-e575b3daff1b34359a80b907c1477343093f9f8e.tar.xz |
fixed padding bug in RSA_encrypt()
Diffstat (limited to 'src')
-rw-r--r-- | src/pluto/pkcs1.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pluto/pkcs1.c b/src/pluto/pkcs1.c index f02dc29df..bc07848e9 100644 --- a/src/pluto/pkcs1.c +++ b/src/pluto/pkcs1.c @@ -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++; } |