Remove unused OpenSSL RAND methods 60/233160/3
authorLukasz Pawelczyk <l.pawelczyk@samsung.com>
Tue, 12 May 2020 12:57:29 +0000 (14:57 +0200)
committerLukasz Pawelczyk <l.pawelczyk@samsung.com>
Fri, 26 Jun 2020 15:36:20 +0000 (17:36 +0200)
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

src/crypto.c

index 585114a0c982e18ed0c17d158f8a1d0fe071630c..b7981961a795ebfab1cb8f20f35024b07ae6ca85 100644 (file)
@@ -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,
 };