Hello,

Andreas Metzler <ametz...@bebt.de> writes:

> Hello,
>
> p11-kit >= 0.23.6 has a testsuite error on 32bit big endian (e.g.
> mips, PowerPC or hppa):
> ok 12 /rpc/byte-value
> not ok 13 /rpc/ulong-value
> # assertion failed ((CK_ULONG)0x0123456708ABCDEF == val64): (145477103
> == 4294967295)
> # in test_ulong_value() at test-rpc.c:436
> ok 14 /rpc/attribute-array-value
>
> I have bisected the issue:

Thank you for the report and the analysis.  Although I don't have access
to such systems, I believe the attached patch should fix the problem.

Regards,
-- 
Daiki Ueno
>From c567ac46d83e1e237deddb6a9ca72d3e6f92e59a Mon Sep 17 00:00:00 2001
From: Daiki Ueno <du...@redhat.com>
Date: Mon, 3 Jul 2017 15:40:16 +0200
Subject: [PATCH] test: Fix failure on 32-bit big endian platform

The value returned from p11_rpc_buffer_get_ulong_value() must be
converted to CK_ULONG before comparison.

Reported by Andreas Metzler in:
https://lists.freedesktop.org/archives/p11-glue/2017-July/000665.html
---
 p11-kit/test-rpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/p11-kit/test-rpc.c b/p11-kit/test-rpc.c
index b57d633..241c964 100644
--- a/p11-kit/test-rpc.c
+++ b/p11-kit/test-rpc.c
@@ -433,7 +433,7 @@ test_ulong_value (void)
 	ret = p11_rpc_buffer_get_ulong_value (&buffer, &offset, &val64, &val_size);
 	assert_num_eq (true, ret);
 	assert_num_eq (15, offset);
-	assert_num_eq ((CK_ULONG)0x0123456708ABCDEF, val64);
+	assert_num_eq ((CK_ULONG)0x0123456708ABCDEF, *(CK_ULONG *)&val64);
 
 	/* Read out of bound */
 	val64 = 0xFFFFFFFFFFFFFFFF;
-- 
2.9.4

_______________________________________________
p11-glue mailing list
p11-glue@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/p11-glue

Reply via email to