* eet: Fix compilation when disabling signature, with gnutls enabled.

SVN revision: 41256
This commit is contained in:
Cedric BAIL 2009-07-06 13:25:29 +00:00
parent dbaeb5eaba
commit 0e2a57f8c8
1 changed files with 9 additions and 5 deletions

View File

@ -348,22 +348,26 @@ eet_identity_compute_sha1(const void *data_base, unsigned int data_length,
{
void *result;
#ifdef HAVE_GNUTLS
#ifdef HAVE_SIGNATURE
# ifdef HAVE_GNUTLS
result = malloc(gcry_md_get_algo_dlen(GCRY_MD_SHA1));
if (!result) return NULL;
gcry_md_hash_buffer(GCRY_MD_SHA1, result, data_base, data_length);
if (sha1_length) *sha1_length = gcry_md_get_algo_dlen(GCRY_MD_SHA1);
#else
# ifdef HAVE_OPENSSL
# else
# ifdef HAVE_OPENSSL
result = malloc(SHA_DIGEST_LENGTH);
if (!result) return NULL;
SHA1(data_base, data_length, result);
if (sha1_length) *sha1_length = SHA_DIGEST_LENGTH;
# else
# else
result = NULL;
# endif
# endif
#else
result = NULL;
# endif
#endif
return result;