summary refs log tree commit diff
path: root/libnm-util
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-util')
-rw-r--r--libnm-util/Makefile.in2
-rw-r--r--libnm-util/crypto.c2
-rw-r--r--libnm-util/tests/Makefile.in2
-rw-r--r--libnm-util/tests/test-crypto.c5
4 files changed, 3 insertions, 8 deletions
diff --git a/libnm-util/Makefile.in b/libnm-util/Makefile.in
index 5a6aa2c9..7c274de1 100644
--- a/libnm-util/Makefile.in
+++ b/libnm-util/Makefile.in
@@ -106,7 +106,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/attributes.m4 \
 	$(top_srcdir)/m4/ax_lib_readline.m4 \
 	$(top_srcdir)/m4/compiler_options.m4 \
-	$(top_srcdir)/m4/gettext.m4 \
+	$(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/git-sha-record.m4 \
 	$(top_srcdir)/m4/gnome-code-coverage.m4 \
 	$(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \
 	$(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intltool.m4 \
diff --git a/libnm-util/crypto.c b/libnm-util/crypto.c
index 3dd89f95..9778edeb 100644
--- a/libnm-util/crypto.c
+++ b/libnm-util/crypto.c
@@ -708,7 +708,7 @@ crypto_verify_private_key_data (const GByteArray *contents,
 		/* Maybe it's PKCS#8 */
 		tmp = parse_pkcs8_key_file (contents, &is_encrypted, error);
 		if (tmp) {
-			if (crypto_verify_pkcs8 (tmp, is_encrypted, password, error))
+			if (!password || crypto_verify_pkcs8 (tmp, is_encrypted, password, error))
 				format = NM_CRYPTO_FILE_FORMAT_RAW_KEY;
 		} else {
 			g_clear_error (error);
diff --git a/libnm-util/tests/Makefile.in b/libnm-util/tests/Makefile.in
index f4bcc0a7..d34408d9 100644
--- a/libnm-util/tests/Makefile.in
+++ b/libnm-util/tests/Makefile.in
@@ -100,7 +100,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/attributes.m4 \
 	$(top_srcdir)/m4/ax_lib_readline.m4 \
 	$(top_srcdir)/m4/compiler_options.m4 \
-	$(top_srcdir)/m4/gettext.m4 \
+	$(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/git-sha-record.m4 \
 	$(top_srcdir)/m4/gnome-code-coverage.m4 \
 	$(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \
 	$(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intltool.m4 \
diff --git a/libnm-util/tests/test-crypto.c b/libnm-util/tests/test-crypto.c
index 643418d2..83a183dd 100644
--- a/libnm-util/tests/test-crypto.c
+++ b/libnm-util/tests/test-crypto.c
@@ -334,11 +334,6 @@ test_pkcs8 (gconstpointer test_data)
 
 	test_is_pkcs12 (path, TRUE, "not-pkcs12");
 	test_load_pkcs8 (path, password, FALSE, "pkcs8-private-key");
-	/* Until gnutls and NSS grow support for all the ciphers that openssl
-	 * can use with PKCS#8, we can't actually verify the password.  So we
-	 * expect a bad password to work for the time being.
-	 */
-	test_load_pkcs8 (path, "blahblahblah", FALSE, "pkcs8-private-key-bad-password");
 
 	g_free (path);
 	g_strfreev (parts);