summary refs log tree commit diff
path: root/libnm-util/crypto.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2015-01-22 00:29:39 +0100
committerMichael Biebl <biebl@debian.org>2015-01-22 00:29:39 +0100
commit2c032d8f1c6292c1338a615e6ec40252889ba85c (patch)
tree1f77182220b2b0264288ba4a476ab47e5bc48716 /libnm-util/crypto.c
parent33491bc4279481db8ae47213e34a6d695a0e8830 (diff)
Imported Upstream version 1.0.0 upstream/1.0.0
Diffstat (limited to 'libnm-util/crypto.c')
-rw-r--r--libnm-util/crypto.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/libnm-util/crypto.c b/libnm-util/crypto.c
index 0ac4fbac..8a10af94 100644
--- a/libnm-util/crypto.c
+++ b/libnm-util/crypto.c
@@ -18,7 +18,7 @@
  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2011 Red Hat, Inc.
+ * Copyright 2007 - 2011 Red Hat, Inc.
  */
 
 #include "config.h"
@@ -28,7 +28,7 @@
 #include <strings.h>
 #include <unistd.h>
 #include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
 
 #include "crypto.h"
 
@@ -360,8 +360,8 @@ convert_iv (const char *src,
 
 	conv[2] = '\0';
 	for (i = 0; i < num; i++) {
-        conv[0] = src[(i * 2)];
-        conv[1] = src[(i * 2) + 1];
+		conv[0] = src[(i * 2)];
+		conv[1] = src[(i * 2) + 1];
 		if (!g_ascii_isxdigit (conv[0]) || !g_ascii_isxdigit (conv[1])) {
 			g_set_error (error, NM_CRYPTO_ERROR,
 			             NM_CRYPTO_ERR_RAW_IV_INVALID,
@@ -526,11 +526,11 @@ crypto_decrypt_private_key_data (const GByteArray *contents,
 
 		if (password) {
 			decrypted = decrypt_key (cipher,
-						             key_type,
-						             data,
-						             iv,
-						             password,
-						             error);
+			                         key_type,
+			                         data,
+			                         iv,
+			                         password,
+			                         error);
 		}
 		g_byte_array_free (data, TRUE);
 	}
@@ -569,18 +569,18 @@ extract_pem_cert_data (GByteArray *contents, GError **error)
 
 	if (!find_tag (PEM_CERT_BEGIN, contents, 0, &start)) {
 		g_set_error (error, NM_CRYPTO_ERROR,
-			         NM_CRYPTO_ERR_FILE_FORMAT_INVALID,
-			         _("PEM certificate had no start tag '%s'."),
-			         PEM_CERT_BEGIN);
+		             NM_CRYPTO_ERR_FILE_FORMAT_INVALID,
+		             _("PEM certificate had no start tag '%s'."),
+		             PEM_CERT_BEGIN);
 		goto done;
 	}
 
 	start += strlen (PEM_CERT_BEGIN);
 	if (!find_tag (PEM_CERT_END, contents, start, &end)) {
 		g_set_error (error, NM_CRYPTO_ERROR,
-			         NM_CRYPTO_ERR_FILE_FORMAT_INVALID,
-			         _("PEM certificate had no end tag '%s'."),
-			         PEM_CERT_END);
+		             NM_CRYPTO_ERR_FILE_FORMAT_INVALID,
+		             _("PEM certificate had no end tag '%s'."),
+		             PEM_CERT_END);
 		goto done;
 	}
 
@@ -596,8 +596,8 @@ extract_pem_cert_data (GByteArray *contents, GError **error)
 		g_assert (cert->len == length);
 	} else {
 		g_set_error (error, NM_CRYPTO_ERROR,
-			         NM_CRYPTO_ERR_DECODE_FAILED,
-			         _("Failed to decode certificate."));
+		             NM_CRYPTO_ERR_DECODE_FAILED,
+		             _("Failed to decode certificate."));
 	}
 
 done:
@@ -747,4 +747,3 @@ crypto_verify_private_key (const char *filename,
 	}
 	return format;
 }
-