summary refs log tree commit diff
path: root/libnm-util/crypto_nss.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-util/crypto_nss.c')
-rw-r--r--libnm-util/crypto_nss.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/libnm-util/crypto_nss.c b/libnm-util/crypto_nss.c
index 01bb28c3..b55af774 100644
--- a/libnm-util/crypto_nss.c
+++ b/libnm-util/crypto_nss.c
@@ -441,7 +441,10 @@ crypto_verify_pkcs12 (const GByteArray *data,
 	PK11SlotInfo *slot = NULL;
 	SECStatus s;
 	char *ucs2_password;
-	long ucs2_chars = 0;
+	glong ucs2_chars = 0;
+#ifndef WORDS_BIGENDIAN
+	guint16 *p;
+#endif /* WORDS_BIGENDIAN */
 
 	if (error)
 		g_return_val_if_fail (*error == NULL, FALSE);
@@ -467,14 +470,10 @@ crypto_verify_pkcs12 (const GByteArray *data,
 		memset (ucs2_password, 0, ucs2_chars);
 		g_free (ucs2_password);
 
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-		{
-			guint16 *p;
-
-			for (p = (guint16 *) pw.data; p < (guint16 *) (pw.data + pw.len); p++)
-				*p = GUINT16_SWAP_LE_BE (*p);
-		}
-#endif
+#ifndef WORDS_BIGENDIAN
+		for (p = (guint16 *) pw.data; p < (guint16 *) (pw.data + pw.len); p++)
+			*p = GUINT16_SWAP_LE_BE (*p);
+#endif /* WORDS_BIGENDIAN */
 	} else {
 		/* NULL password */
 		pw.data = NULL;