]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
Check library version with gnutls_check_version().
authorSimon Ruderich <simon@ruderich.org>
Thu, 8 Aug 2013 19:08:47 +0000 (21:08 +0200)
committerSimon Ruderich <simon@ruderich.org>
Thu, 8 Aug 2013 19:08:47 +0000 (21:08 +0200)
src/tlsproxy.c

index ee65febba68ef14445effc63d32851660b3cadef..f7b9f27553a193b4cd8cfcb312af08a0c0c6ede8 100644 (file)
@@ -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()");