]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Added destructor and moved both *structors to fips.c
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 28 Nov 2013 16:35:18 +0000 (17:35 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 28 Nov 2013 16:35:18 +0000 (17:35 +0100)
lib/fips.c
lib/gnutls_global.c

index 690c4cddd8c9b41d7ce011f29024b2367fb72b6a..a8beda02d40d2af4ee5c27de90192a1941ee33ac 100644 (file)
@@ -326,6 +326,21 @@ error:
 
        return GNUTLS_E_SELF_TEST_ERROR;
 }
+
+__attribute__((constructor))
+static void lib_init(void)
+{
+       if (gnutls_global_init2(GNUTLS_GLOBAL_INIT_MINIMAL|GNUTLS_GLOBAL_INIT_CRYPTO) < 0) {
+               fprintf(stderr, "Error in GnuTLS initialization");
+               abort();
+       }
+}
+
+__attribute__((destructor))
+static void lib_deinit(void)
+{
+       gnutls_global_deinit();
+}
 #endif
 
 /**
index 57bd116f53e4b82c8bb5ff7b603885c9eb554e3f..52aa0819b94a376a99efd926d633dd03682e4889 100644 (file)
@@ -338,18 +338,6 @@ out:
        return result;
 }
 
-#ifdef ENABLE_FIPS140
-__attribute__((constructor))
-static void lib_init(void)
-{
-       if (gnutls_global_init2(GNUTLS_GLOBAL_INIT_MINIMAL|GNUTLS_GLOBAL_INIT_CRYPTO) < 0) {
-               fprintf(stderr, "Error in GnuTLS initialization");
-               abort();
-       }
-}
-#endif
-
-
 /**
  * gnutls_global_init:
  *