From: Andre Noll Date: Sun, 7 Aug 2011 19:18:18 +0000 (+0200) Subject: gcrypt: Fix return value of pad_oaep(). X-Git-Tag: v0.4.8~20 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=e9ac00becb2aba5bbbf51b4803b81b10ed4d6788;p=paraslash.git gcrypt: Fix return value of pad_oaep(). This function returned an uninitialized variable on success. --- diff --git a/gcrypt.c b/gcrypt.c index b40b7b6e..c6365470 100644 --- a/gcrypt.c +++ b/gcrypt.c @@ -164,7 +164,7 @@ static void pad_oaep(unsigned char *in, size_t in_len, unsigned char *out, /* rfc 3447, section 7.1.2 */ static int unpad_oaep(unsigned char *in, size_t in_len, unsigned char *out, size_t *out_len) -{ int ret; +{ unsigned char *masked_seed = in + 1; unsigned char *db = in + 1 + HASH_SIZE; unsigned char seed[HASH_SIZE], seed_mask[HASH_SIZE]; @@ -189,7 +189,7 @@ static int unpad_oaep(unsigned char *in, size_t in_len, unsigned char *out, p++; *out_len = in + in_len - p; memcpy(out, p, *out_len); - return ret; + return 1; } struct asymmetric_key {