summary refs log tree commit diff
path: root/libnm-util/crypto_nss.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-10-20 01:30:31 +0200
committerMichael Biebl <biebl@debian.org>2018-10-20 01:30:31 +0200
commit6518e361171f64bcaaa4bf868139362ed95cc2e0 (patch)
treed2d5b53faf80646a40ec2c0c7f2a42b3959612f5 /libnm-util/crypto_nss.c
parente126f3e804c35480c4f075777430419d6ece23da (diff)
New upstream version 1.14.2 upstream/1.14.2
Diffstat (limited to 'libnm-util/crypto_nss.c')
-rw-r--r--libnm-util/crypto_nss.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/libnm-util/crypto_nss.c b/libnm-util/crypto_nss.c
index b55af774..01bb28c3 100644
--- a/libnm-util/crypto_nss.c
+++ b/libnm-util/crypto_nss.c
@@ -441,10 +441,7 @@ crypto_verify_pkcs12 (const GByteArray *data,
 	PK11SlotInfo *slot = NULL;
 	SECStatus s;
 	char *ucs2_password;
-	glong ucs2_chars = 0;
-#ifndef WORDS_BIGENDIAN
-	guint16 *p;
-#endif /* WORDS_BIGENDIAN */
+	long ucs2_chars = 0;
 
 	if (error)
 		g_return_val_if_fail (*error == NULL, FALSE);
@@ -470,10 +467,14 @@ crypto_verify_pkcs12 (const GByteArray *data,
 		memset (ucs2_password, 0, ucs2_chars);
 		g_free (ucs2_password);
 
-#ifndef WORDS_BIGENDIAN
-		for (p = (guint16 *) pw.data; p < (guint16 *) (pw.data + pw.len); p++)
-			*p = GUINT16_SWAP_LE_BE (*p);
-#endif /* WORDS_BIGENDIAN */
+#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
 	} else {
 		/* NULL password */
 		pw.data = NULL;