| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
#include "tls/extensions/s2n_supported_versions.h" |
| 17 |
|
| 18 |
#include <stdint.h> |
| 19 |
|
| 20 |
#include "tls/s2n_security_policies.h" |
| 21 |
#include "utils/s2n_safety.h" |
| 22 |
|
| 23 |
S2N_RESULT s2n_connection_get_minimum_supported_version(struct s2n_connection *conn, uint8_t *min_version) |
| 24 |
{ |
| 25 |
RESULT_ENSURE_REF(min_version); |
| 26 |
|
| 27 |
const struct s2n_security_policy *security_policy = NULL; |
| 28 |
RESULT_GUARD_POSIX(s2n_connection_get_security_policy(conn, &security_policy)); |
| 29 |
RESULT_ENSURE_REF(security_policy); |
| 30 |
*min_version = security_policy->minimum_protocol_version; |
| 31 |
|
| 32 |
|
| 33 |
if (s2n_connection_is_quic_enabled(conn)) { |
| 34 |
*min_version = S2N_MAX(*min_version, S2N_TLS13); |
| 35 |
} |
| 36 |
|
| 37 |
return S2N_RESULT_OK; |
| 38 |
} |