diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2013-08-02 19:19:25 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2013-08-02 19:19:25 +0200 |
commit | 663de422849a591c2b7fdf47fbabdf6e2ecb98da (patch) | |
tree | 9aeb522a13e4232c78ccef92561ab855acd6767e /src/core/wee-network.c | |
parent | fd5fc2e5a35926387eb332f612752a6b0726e10e (diff) | |
parent | ade379ac114ba76a142d9f430defc9579ead029a (diff) | |
download | weechat-663de422849a591c2b7fdf47fbabdf6e2ecb98da.zip |
Merge branch 'secured-data'
Diffstat (limited to 'src/core/wee-network.c')
-rw-r--r-- | src/core/wee-network.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/src/core/wee-network.c b/src/core/wee-network.c index a15eea8b2..aa5ea105e 100644 --- a/src/core/wee-network.c +++ b/src/core/wee-network.c @@ -55,7 +55,7 @@ #include "../plugins/plugin.h" -int network_init_ok = 0; +int network_init_gnutls_ok = 0; #ifdef HAVE_GNUTLS gnutls_certificate_credentials_t gnutls_xcred; /* GnuTLS client credentials */ @@ -63,6 +63,21 @@ gnutls_certificate_credentials_t gnutls_xcred; /* GnuTLS client credentials */ /* + * Initializes gcrypt. + */ + +void +network_init_gcrypt () +{ + if (!weechat_no_gcrypt) + { + gcry_check_version (GCRYPT_VERSION); + gcry_control (GCRYCTL_DISABLE_SECMEM, 0); + gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); + } +} + +/* * Sets trust file with option "gnutls_ca_file". */ @@ -91,11 +106,11 @@ network_set_gnutls_ca_file () } /* - * Initializes network. + * Initializes GnuTLS. */ void -network_init () +network_init_gnutls () { #ifdef HAVE_GNUTLS if (!weechat_no_gnutls) @@ -121,14 +136,7 @@ network_init () } #endif /* HAVE_GNUTLS */ - if (!weechat_no_gcrypt) - { - gcry_check_version (GCRYPT_VERSION); - gcry_control (GCRYCTL_DISABLE_SECMEM, 0); - gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); - } - - network_init_ok = 1; + network_init_gnutls_ok = 1; } /* @@ -138,7 +146,7 @@ network_init () void network_end () { - if (network_init_ok) + if (network_init_gnutls_ok) { #ifdef HAVE_GNUTLS if (!weechat_no_gnutls) @@ -147,7 +155,7 @@ network_end () gnutls_global_deinit(); } #endif - network_init_ok = 0; + network_init_gnutls_ok = 0; } } |