From: Nikos Mavrogiannopoulos Date: Wed, 1 Jun 2011 12:36:44 +0000 (+0200) Subject: Use nettle's memxor or gnulib's if it doesn't exist. X-Git-Tag: gnutls_2_99_3~74 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2cfb3af0a6b8cd3a7be436420317da37643d064f;p=thirdparty%2Fgnutls.git Use nettle's memxor or gnulib's if it doesn't exist. --- diff --git a/lib/accelerated/intel/aes-gcm-x86.c b/lib/accelerated/intel/aes-gcm-x86.c index 74de3aad93..e5668db398 100644 --- a/lib/accelerated/intel/aes-gcm-x86.c +++ b/lib/accelerated/intel/aes-gcm-x86.c @@ -32,7 +32,6 @@ #include #include #include -#include #define GCM_BLOCK_SIZE 16 diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h index 104492a578..a352055214 100644 --- a/lib/gnutls_int.h +++ b/lib/gnutls_int.h @@ -50,6 +50,13 @@ typedef int ssize_t; #include #include /* gnulib for uint64_t */ +#ifdef HAVE_LIBNETTLE +# include +#else +# include +# define gl_memxor memxor +#endif + /* some systems had problems with long long int, thus, * it is not used. */ diff --git a/lib/gnutls_state.c b/lib/gnutls_state.c index 93a38b1b2c..859ed146ea 100644 --- a/lib/gnutls_state.c +++ b/lib/gnutls_state.c @@ -891,20 +891,6 @@ _gnutls_P_hash (gnutls_mac_algorithm_t algorithm, return 0; } -/* Xor's two buffers and puts the output in the first one. - */ -inline static void -_gnutls_xor (opaque * o1, opaque * o2, int length) -{ - int i; - for (i = 0; i < length; i++) - { - o1[i] ^= o2[i]; - } -} - - - #define MAX_PRF_BYTES 200 /* The PRF function expands a given secret @@ -982,7 +968,7 @@ _gnutls_PRF (gnutls_session_t session, return result; } - _gnutls_xor (o1, o2, total_bytes); + memxor (o1, o2, total_bytes); memcpy (ret, o1, total_bytes); }