]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/blobdiff - src/tlsproxy.c
Minor documentation update.
[tlsproxy/tlsproxy.git] / src / tlsproxy.c
index ee65febba68ef14445effc63d32851660b3cadef..8b9b6d92e1bb3309010b54a7240900a23419268c 100644 (file)
@@ -375,7 +375,7 @@ static void initialize_gnutls(void) {
     gnutls_datum_t dh_parameters_datum;
 
 /* Recent versions of GnuTLS automatically initialize the cryptography layer
- * in gnutls_global_init(). */
+ * in gnutls_global_init(), including a thread-safe setup. */
 #if GNUTLS_VERSION_NUMBER <= 0x020b00
     gcry_error_t error;
 
@@ -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()");