From: cedric Date: Fri, 18 Dec 2009 17:41:43 +0000 (+0000) Subject: * eet: Correctly detect GNUTLS hability. X-Git-Tag: 1.0_branch~388 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50fa34c4a5044d5de54c19cd9d825c1d13e952d9;p=profile%2Fivi%2Feet.git * eet: Correctly detect GNUTLS hability. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eet@44548 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/configure.ac b/configure.ac index f91e2fc..591954c 100644 --- a/configure.ac +++ b/configure.ac @@ -95,11 +95,11 @@ AC_MSG_RESULT([${want_gnutls}]) # Specific GNUTLS improvement -new_gnutls_api="no" +new_gnutls_api="yes" AC_ARG_ENABLE(new-gnutls-api, [AC_HELP_STRING( - [--enable-new-gnutls-api], - [enable use of gnutls_x509_crt_verify_hash. [[default=disable]]] + [--disable-new-gnutls-api], + [enable use of gnutls_x509_crt_verify_hash. [[default=enable]]] )], [new_gnutls_api=$enableval] ) @@ -107,9 +107,14 @@ AC_MSG_CHECKING([whether to use gnutls_x509_crt_verify_hash]) AC_MSG_RESULT([${new_gnutls_api}]) if test "x${new_gnutls_api}" = "xyes" ; then - AC_DEFINE(EET_USE_NEW_GNUTLS_API, 1, [use gnutls_x509_crt_verify_hash]) -else - AC_DEFINE(EET_USE_NEW_GNUTLS_API, 0, [don't use gnutls_x509_crt_verify_hash]) + AC_CHECK_LIB(gnutls, gnutls_x509_crt_verify_hash, + [ new_gnutls_api="yes" ], + [ new_gnutls_api="no" ] + ) + + if test "x${new_gnutls_api}" = "xyes"; then + AC_DEFINE(EET_USE_NEW_GNUTLS_API, 1, [use gnutls_x509_crt_verify_hash]) + fi fi # Openssl support diff --git a/src/lib/eet_cipher.c b/src/lib/eet_cipher.c index 52ba09b..903e4b6 100644 --- a/src/lib/eet_cipher.c +++ b/src/lib/eet_cipher.c @@ -558,11 +558,13 @@ eet_identity_check(const void *data_base, unsigned int data_length, # ifdef HAVE_GNUTLS gnutls_x509_crt_t cert; - gcry_md_hd_t md; gnutls_datum_t datum; gnutls_datum_t signature; +# if EET_USE_NEW_GNUTLS_API unsigned char *hash; + gcry_md_hd_t md; int err; +# endif /* Create an understanding certificate structure for gnutls */ datum.data = (void *)cert_der;