aboutsummaryrefslogtreecommitdiff
path: root/src/hsts.c
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2023-12-22 20:39:57 +0100
committerRodrigo Arias Mallo <rodarima@gmail.com>2023-12-30 01:37:14 +0100
commit7357e0ee1e8ae1ee9259a3181e400db0d570362b (patch)
tree026805d25ea7500c160a113eae45c1a8019c7e6c /src/hsts.c
parentd3d890f3b48cf6f3494ed0d6d06b37e5376cd188 (diff)
Add support for OpenSSL, mbedTLS 2 and mbedTLS 3
Brings the previous OpenSSL implementation into src/IO/tls_openssl.c. Now, the TLS functions have the implementation name as prefix, like a_Tls_openssl_connect(). The generic interface at IO/tls.h hides the implementation which is selected at configure time. The appropriate functions of that implementation are called from IO/tls.c to IO/tls_<impl>.c. In this way, support for more TLS libraries can easily be added. In the case of mbedTLS, there are some incompatible changes from version 2 to 3, so we use some ifdefs to fix the differences.
Diffstat (limited to 'src/hsts.c')
-rw-r--r--src/hsts.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/hsts.c b/src/hsts.c
index cc4d0dea..b11e9ffb 100644
--- a/src/hsts.c
+++ b/src/hsts.c
@@ -3,6 +3,7 @@
* HTTP Strict Transport Security
*
* Copyright 2015 corvid
+ * Copyright (C) 2023 Rodrigo Arias Mallo <rodarima@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -195,7 +196,7 @@ static void Hsts_eat_value(const char **str)
*/
void a_Hsts_set(const char *header, const DilloUrl *url)
{
- long max_age;
+ long max_age = 0;
const char *host = URL_HOST(url);
bool_t max_age_valid = FALSE, subdomains = FALSE;