summaryrefslogtreecommitdiff
path: root/libnm-util/crypto_gnutls.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2008-09-05 18:10:39 +0000
committerDan Williams <dcbw@redhat.com>2008-09-05 18:10:39 +0000
commitbb6b79a2a623cf401a9c7b81979f40911dede7e1 (patch)
tree60b4dc905e0385a1a1c3635fc6c93fbf3045149c /libnm-util/crypto_gnutls.c
parent814336ec8a4ec6aff7a9077792263887641e0c6d (diff)
downloadNetworkManager-bb6b79a2a623cf401a9c7b81979f40911dede7e1.tar.gz
2008-09-05 Dan Williams <dcbw@redhat.com>
* libnm-util/crypto_nss.c libnm-util/crypto_gnutls.c libnm-util/crypto.h - (crypto_init): return error when init fails git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4042 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Diffstat (limited to 'libnm-util/crypto_gnutls.c')
-rw-r--r--libnm-util/crypto_gnutls.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/libnm-util/crypto_gnutls.c b/libnm-util/crypto_gnutls.c
index 16a92a9f26..922f379215 100644
--- a/libnm-util/crypto_gnutls.c
+++ b/libnm-util/crypto_gnutls.c
@@ -34,8 +34,16 @@ static guint32 refcount = 0;
gboolean
crypto_init (GError **error)
{
- if (refcount == 0)
- gnutls_global_init();
+ if (refcount == 0) {
+ if (gnutls_global_init() != 0) {
+ gnutls_global_deinit();
+ g_set_error (error, NM_CRYPTO_ERROR,
+ NM_CRYPTO_ERR_INIT_FAILED,
+ "%s",
+ _("Failed to initialize the crypto engine."));
+ return FALSE;
+ }
+ }
refcount++;
return TRUE;
}