]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Moved prng_uninit out of crypto_uninit_lib
authorAdriaan de Jong <dejong@fox-it.com>
Mon, 31 Oct 2011 15:29:14 +0000 (16:29 +0100)
committerDavid Sommerseth <davids@redhat.com>
Mon, 21 Nov 2011 10:51:39 +0000 (11:51 +0100)
Since prng_uninit is SSL-library agnostic, but crypto_uninit_lib isn't,
the function was moved up a level.

Also removed one unused variable (j) in tls1_P_hash().

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
crypto.c
crypto_openssl.c
crypto_polarssl.c
ssl.c

index d17f706544ab3367497d8b4a70e17c8fcf7c44ad..375d35ac3708ab06de1056690b1e30cb55f0e574 100644 (file)
--- 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 ();
 }
index 9906479a8381522c899f8cc114b4bd243e55eecf..db6b78e50732e7eb5ac601e3c73ad7c7cabdf559 100644 (file)
@@ -277,8 +277,6 @@ crypto_uninit_lib (void)
       engine_initialized = false;
     }
 #endif
-
-  prng_uninit ();
 }
 
 void
index 8119d58a231b1685f38452b158139e15d49268aa..e7470d50d1403b0b3d4606529ea91ea64f00f1bf 100644 (file)
@@ -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 30f6eb2ca14b1684a4b5726e258a6038f71f52d5..955a0d1adec9931217c1bb040eaefd9c39e9e3c4 100644 (file)
--- 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];