[network-manager-openvpn/NM_0_8] properties: fix showing unencrypted private keys in the file chooser (bgo #639191)



commit 6dd966d8a2e97cf2314eb5cd052055526135024c
Author: Dan Williams <dcbw redhat com>
Date:   Tue Jan 11 12:28:44 2011 -0600

    properties: fix showing unencrypted private keys in the file chooser (bgo #639191)

 properties/auth-helpers.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/properties/auth-helpers.c b/properties/auth-helpers.c
index 0c0df63..2fa36e0 100644
--- a/properties/auth-helpers.c
+++ b/properties/auth-helpers.c
@@ -695,6 +695,7 @@ static const char *pem_rsa_key_begin = "-----BEGIN RSA PRIVATE KEY-----";
 static const char *pem_dsa_key_begin = "-----BEGIN DSA PRIVATE KEY-----";
 static const char *pem_pkcs8_key_begin = "-----BEGIN ENCRYPTED PRIVATE KEY-----";
 static const char *pem_cert_begin = "-----BEGIN CERTIFICATE-----";
+static const char *pem_unenc_key_begin = "-----BEGIN PRIVATE KEY-----";
 
 static gboolean
 tls_default_filter (const GtkFileFilterInfo *filter_info, gpointer data)
@@ -760,6 +761,11 @@ tls_default_filter (const GtkFileFilterInfo *filter_info, gpointer data)
 		goto out;
 	}
 
+	if (find_tag (pem_unenc_key_begin, (const char *) contents, bytes_read)) {
+		show = TRUE;
+		goto out;
+	}
+
 out:
 	g_free (contents);
 	return show;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]