]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
fips: use gnutls_hex_decode for MAC decoding
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Tue, 21 Jul 2015 06:37:34 +0000 (08:37 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Tue, 21 Jul 2015 07:10:39 +0000 (09:10 +0200)
lib/fips.c

index 565976e4af9cb641052dbc5f9205bc53c5b42590..e5028d958fb563306cd29fbf751d05cf7083ff93 100644 (file)
@@ -27,6 +27,7 @@
 #include <fips.h>
 #include <gnutls/self-test.h>
 #include <stdio.h>
+#include <extras/hex.h>
 #include <random.h>
 
 unsigned int _gnutls_lib_mode = LIB_STATE_POWERON;
@@ -224,8 +225,8 @@ static unsigned check_binary_integrity(const char* libname, const char* symbol)
                }
        }
 
-       hmac_size = sizeof(hmac);
-       ret = _gnutls_hex2bin((void*)data.data, data.size, hmac, &hmac_size);
+       hmac_size = hex_data_size(data->size);
+       ret = gnutls_hex_decode(&data, hmac, hmac_size);
        gnutls_free(data.data);
 
        if (ret < 0) {