From: Simon Ruderich Date: Thu, 8 Aug 2013 19:08:47 +0000 (+0200) Subject: Check library version with gnutls_check_version(). X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=1b9fb4e5416a0002d3e6442d6e73f922b93d4677;p=tlsproxy%2Ftlsproxy.git Check library version with gnutls_check_version(). --- diff --git a/src/tlsproxy.c b/src/tlsproxy.c index ee65feb..f7b9f27 100644 --- a/src/tlsproxy.c +++ b/src/tlsproxy.c @@ -395,6 +395,12 @@ static void initialize_gnutls(void) { } #endif + if (gnutls_check_version(GNUTLS_VERSION) == NULL) { + fprintf(stderr, "gnutls_check_version(): version mismatch, " + "expected at least '" GNUTLS_VERSION "'\n"); + exit(EXIT_FAILURE); + } + /* Initialize GnuTLS. */ result = gnutls_global_init(); GNUTLS_ERROR_EXIT(result, "gnutls_global_init()");