blob: b722183b685ec272ad5f9066187796542e8d0963 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001Subject: Change to calling bswap_* instead of htobe* and be*toh
2
3We can't use htobe* and be*toh functions because they are not
4available on older versions of glibc, For example, shipped on Centos 5.5.
5
6Change to directly calling bswap_* as defined in+byteswap.h.
7
8Upstream-Status: Inappropriate
9
10Signed-off-by: Ting Liu <b28495@freescale.com>
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12---
13 libkmod/libkmod-signature.c | 3 ++-
14 1 file changed, 2 insertions(+), 1 deletion(-)
15
16diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
17index 6fc06fc..912185a 100644
18--- a/libkmod/libkmod-signature.c
19+++ b/libkmod/libkmod-signature.c
20@@ -18,6 +18,7 @@
21 */
22
23 #include <endian.h>
24+#include <byteswap.h>
25 #include <inttypes.h>
26 #include <stdio.h>
27 #include <stdlib.h>
28@@ -127,7 +128,7 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat
29 modsig->hash >= PKEY_HASH__LAST ||
30 modsig->id_type >= PKEY_ID_TYPE__LAST)
31 return false;
32- sig_len = be32toh(get_unaligned(&modsig->sig_len));
33+ sig_len = bswap_32(get_unaligned(&modsig->sig_len));
34 if (sig_len == 0 ||
35 size < (int64_t)(modsig->signer_len + modsig->key_id_len + sig_len))
36 return false;
37--
381.9.1
39