From: Fredrik Thulin Date: Mon, 12 Dec 2011 08:35:54 +0000 (+0100) Subject: Fix CRC in test cases on big endian systems. X-Git-Tag: v1.6.3~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2829fd0fb9c0a4ab787bda4f987737918693f94e;p=yubikey-personalization Fix CRC in test cases on big endian systems. Noticed failure in Debian build of 1.6.2 on mips. --- diff --git a/tests/test_args_to_config.c b/tests/test_args_to_config.c index 63435e5..edb8e19 100644 --- a/tests/test_args_to_config.c +++ b/tests/test_args_to_config.c @@ -86,6 +86,7 @@ void _check_success(int rc, YKP_CONFIG *cfg, unsigned char expected[], int calle /* insert CRC */ ycfg->crc = ~yubikey_crc16 ((unsigned char *) ycfg, offsetof(struct config_st, crc)); + ycfg->crc = yk_endian_swap_16(ycfg->crc); config_matches_expected = ! memcmp(expected, ycfg, sizeof(*ycfg)); if (! config_matches_expected) {