]> err.no Git - yubikey-personalization.old/commitdiff
Fix CRC in test cases on big endian systems.
authorFredrik Thulin <fredrik@yubico.com>
Mon, 12 Dec 2011 08:35:54 +0000 (09:35 +0100)
committerFredrik Thulin <fredrik@yubico.com>
Mon, 12 Dec 2011 08:35:54 +0000 (09:35 +0100)
Noticed failure in Debian build of 1.6.2 on mips.

tests/test_args_to_config.c

index 63435e583ffe8d9832f78ee66807f871e7ee0bd0..edb8e194c0dab639d59fac58c6ee406a7803fb04 100644 (file)
@@ -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) {