From 1b9fb4e5416a0002d3e6442d6e73f922b93d4677 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Thu, 8 Aug 2013 21:08:47 +0200 Subject: [PATCH] Check library version with gnutls_check_version(). --- src/tlsproxy.c | 6 ++++++ 1 file changed, 6 insertions(+) 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()"); -- 2.45.2