Browse code

tls: add parser logic for previous commits related to TLSv1.3

Henning Westerholt authored on 17/08/2022 16:07:58
Showing 1 changed files
... ...
@@ -125,6 +125,8 @@ static cfg_option_t methods[] = {
125 125
 	{"TLSv1.1+", .val = TLS_USE_TLSv1_1_PLUS},
126 126
 	{"TLSv1.2",  .val = TLS_USE_TLSv1_2},
127 127
 	{"TLSv1.2+", .val = TLS_USE_TLSv1_2_PLUS},
128
+	{"TLSv1.3",  .val = TLS_USE_TLSv1_3},
129
+	{"TLSv1.3+", .val = TLS_USE_TLSv1_3_PLUS},
128 130
 	{0}
129 131
 };
130 132
 
... ...
@@ -528,6 +530,13 @@ int tls_parse_method(str* method)
528 530
 		return -1;
529 531
 	}
530 532
 #endif
533
+#if OPENSSL_VERSION_NUMBER < 0x1010100fL
534
+	if(opt->val == TLS_USE_TLSv1_3 || opt->val == TLS_USE_TLSv1_3_PLUS) {
535
+		LM_ERR("tls v1.3 not supported by this libssl version: %ld\n",
536
+				(long)OPENSSL_VERSION_NUMBER);
537
+		return -1;
538
+	}
539
+#endif
531 540
 
532 541
 	return opt->val;
533 542
 }