]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
padlock: Use builtin bswap32() to fix compilation on FreeBSD
authorTobias Brunner <tobias@strongswan.org>
Wed, 31 Aug 2016 08:51:24 +0000 (10:51 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 31 Aug 2016 08:52:55 +0000 (10:52 +0200)
Fixes #591.

src/libstrongswan/plugins/padlock/padlock_sha1_hasher.c

index 107ade09b5ae62e9f40ad4c3edf9133e3b162fb5..30040da397e542890787503fa3d290ae1454ef61 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <string.h>
 #include <arpa/inet.h>
-#include <byteswap.h>
 
 #include "padlock_sha1_hasher.h"
 
@@ -66,11 +65,11 @@ static void sha1(chunk_t data, uint32_t *digest)
 
        padlock_sha1(data.len, data.ptr, (u_char*)hash);
 
-       digest[0] = bswap_32(hash[0]);
-       digest[1] = bswap_32(hash[1]);
-       digest[2] = bswap_32(hash[2]);
-       digest[3] = bswap_32(hash[3]);
-       digest[4] = bswap_32(hash[4]);
+       digest[0] = __builtin_bswap32(hash[0]);
+       digest[1] = __builtin_bswap32(hash[1]);
+       digest[2] = __builtin_bswap32(hash[2]);
+       digest[3] = __builtin_bswap32(hash[3]);
+       digest[4] = __builtin_bswap32(hash[4]);
 }
 
 /**