Since prng_uninit is SSL-library agnostic, but crypto_uninit_lib isn't, the 
function was moved up a level.

Signed-off-by: Adriaan de Jong <dej...@fox-it.com>
---
 crypto.c          |    1 +
 crypto_openssl.c  |    2 --
 crypto_polarssl.c |    1 -
 ssl.c             |    4 ++--
 4 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/crypto.c b/crypto.c
index d17f706..375d35a 100644
--- a/crypto.c
+++ b/crypto.c
@@ -1388,6 +1388,7 @@ void
 free_ssl_lib (void)
 {
   crypto_uninit_lib ();
+  prng_uninit();
   EVP_cleanup ();
   ERR_free_strings ();
 }
diff --git a/crypto_openssl.c b/crypto_openssl.c
index 9906479..db6b78e 100644
--- a/crypto_openssl.c
+++ b/crypto_openssl.c
@@ -277,8 +277,6 @@ crypto_uninit_lib (void)
       engine_initialized = false;
     }
 #endif
-
-  prng_uninit ();
 }

 void
diff --git a/crypto_polarssl.c b/crypto_polarssl.c
index 8119d58..e7470d5 100644
--- a/crypto_polarssl.c
+++ b/crypto_polarssl.c
@@ -69,7 +69,6 @@ crypto_init_lib (void)
 void
 crypto_uninit_lib (void)
 {
-  prng_uninit();
 }

 void
diff --git a/ssl.c b/ssl.c
index 30f6eb2..955a0d1 100644
--- a/ssl.c
+++ b/ssl.c
@@ -162,7 +162,8 @@ void
 free_ssl_lib ()
 {
   crypto_uninit_lib ();
-
+  prng_uninit();
+  
   tls_free_lib();
 }

@@ -1168,7 +1169,6 @@ tls1_P_hash(const md_kt_t *md_kt,
 {
   struct gc_arena gc = gc_new ();
   int chunk,n;
-  unsigned int j;
   hmac_ctx_t ctx;
   hmac_ctx_t ctx_tmp;
   uint8_t A1[MAX_HMAC_KEY_LENGTH];
-- 
1.7.5.4


Reply via email to