tls: Allow setting both minimum and maximum TLS versions

This allows to increase the initial minimum version and also prevents
sending a list of versions during retries when 1.3 was already
negotiated.
This commit is contained in:
Tobias Brunner
2021-02-12 11:45:44 +01:00
parent 2b6565c236
commit c4576a1f57
5 changed files with 25 additions and 24 deletions
+9 -6
View File
@@ -263,26 +263,29 @@ struct tls_t {
identification_t* (*get_peer_id)(tls_t *this);
/**
* Get the maximum and negotiated TLS/SSL version.
* Get the maximum and negotiated TLS version.
*
* @return max and negotiated TLS version
*/
tls_version_t (*get_version_max)(tls_t *this);
/**
* Get the minimum TLS/SSL version.
* Get the minimum TLS version.
*
* @return min TLS version
*/
tls_version_t (*get_version_min)(tls_t *this);
/**
* Set the negotiated TLS/SSL version.
* Set the initial minimum/maximum TLS version, or set both to the same
* value once negotiated.
*
* @param version negotiated TLS version
* @return TRUE if version acceptable
* @param min_version minimum (or negotiated) TLS version
* @param max_version maximum (or negotiated) TLS version
* @return TRUE if version(s) acceptable
*/
bool (*set_version)(tls_t *this, tls_version_t version);
bool (*set_version)(tls_t *this, tls_version_t min_version,
tls_version_t max_version);
/**
* Get the purpose of this TLS stack instance.