openbsd-ports/devel/cjose/patches/patch-test_check_concatkdf_c
yasuoka fa2231099f Import "cjose" 0.6.1
"cjose" is a library for Javascript Object Signing and Encryption
(JOSE).  Original diff from Naoaki Hoshi.

ok jca
2019-01-30 07:58:19 +00:00

24 lines
713 B
Plaintext

$OpenBSD: patch-test_check_concatkdf_c,v 1.1.1.1 2019/01/30 07:58:19 yasuoka Exp $
Index: test/check_concatkdf.c
--- test/check_concatkdf.c.orig
+++ test/check_concatkdf.c
@@ -60,14 +60,9 @@ _create_otherinfo_header_finish:
static bool _cmp_uint32(uint8_t **actual, uint32_t expected)
{
- uint32_t value = htonl(expected);
- uint8_t expectedData[] = {
- (value >> 0) & 0xff,
- (value >> 8) & 0xff,
- (value >> 16) & 0xff,
- (value >> 24) & 0xff
- };
- bool result = (0 == memcmp(*actual, expectedData, 4));
+ uint32_t big_endian_int32 = htonl(expected);
+
+ bool result = (0 == memcmp(*actual, &big_endian_int32, 4));
(*actual) += 4;
return result;
}