From e9ac00becb2aba5bbbf51b4803b81b10ed4d6788 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 7 Aug 2011 21:18:18 +0200 Subject: [PATCH] gcrypt: Fix return value of pad_oaep(). This function returned an uninitialized variable on success. --- gcrypt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 { -- 2.39.5