From: Lukasz Pawelczyk Date: Tue, 12 May 2020 12:57:29 +0000 (+0200) Subject: Remove unused OpenSSL RAND methods X-Git-Tag: submit/tizen/20200717.105954~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71cd0b9a8afeed0ce309d8d4fcee48f2ced0fe34;p=platform%2Fcore%2Fsecurity%2Fyaca.git Remove unused OpenSSL RAND methods According to docs we can pass NULL to the functions we don't want/need in RAND_METHOD struct. As we don't use them, drop those unneeded. RAND_pseudo_bytes() was deprecated in OpenSSL 1.1.0. Change-Id: Id28795119d6efdd11664d1d81be0524d87e987cf --- diff --git a/src/crypto.c b/src/crypto.c index 585114a..b798196 100644 --- a/src/crypto.c +++ b/src/crypto.c @@ -78,30 +78,11 @@ static int getrandom_wrapper(unsigned char *buf, int num) return 1; } -static int RAND_METHOD_seed(UNUSED const void *buf, UNUSED int num) -{ - return 1; -} - -static int RAND_METHOD_add(UNUSED const void *buf, UNUSED int num, UNUSED double entropy) -{ - return 1; -} - static int RAND_METHOD_bytes(unsigned char *buf, int num) { return getrandom_wrapper(buf, num); } -static void RAND_METHOD_cleanup(void) -{ -} - -static int RAND_METHOD_pseudorand(UNUSED unsigned char *buf, UNUSED int num) -{ - return getrandom_wrapper(buf, num); -} - static int RAND_METHOD_status(void) { #ifdef SYS_getrandom @@ -115,11 +96,11 @@ static int RAND_METHOD_status(void) } static const RAND_METHOD new_rand_method = { - RAND_METHOD_seed, + NULL, RAND_METHOD_bytes, - RAND_METHOD_cleanup, - RAND_METHOD_add, - RAND_METHOD_pseudorand, + NULL, + NULL, + NULL, RAND_METHOD_status, };