diff options
author | David Benjamin <davidben@google.com> | 2016-07-16 15:51:58 +0300 |
---|---|---|
committer | David Benjamin <davidben@google.com> | 2016-07-17 11:18:58 +0300 |
commit | 225e5ade823b33538f59892736db0055267f92b2 (patch) | |
tree | e70bf7bc04e6ef3e2150e52719714107d1ba9aaf /tool/transport_common.cc | |
parent | f5975d865bbb5b7ad6035eee8ab0db118748dba7 (diff) |
Teach bssl server about -max-version and -min-version.
Change-Id: Ifbfae883638b35bb274f2002bc53fbba77c7aa85
Reviewed-on: https://boringssl-review.googlesource.com/8821
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
Diffstat (limited to 'tool/transport_common.cc')
-rw-r--r-- | tool/transport_common.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tool/transport_common.cc b/tool/transport_common.cc index eff8e755..ed1bc0f9 100644 --- a/tool/transport_common.cc +++ b/tool/transport_common.cc @@ -181,6 +181,26 @@ out: return ok; } +bool VersionFromString(uint16_t *out_version, const std::string &version) { + if (version == "ssl3") { + *out_version = SSL3_VERSION; + return true; + } else if (version == "tls1" || version == "tls1.0") { + *out_version = TLS1_VERSION; + return true; + } else if (version == "tls1.1") { + *out_version = TLS1_1_VERSION; + return true; + } else if (version == "tls1.2") { + *out_version = TLS1_2_VERSION; + return true; + } else if (version == "tls1.3") { + *out_version = TLS1_3_VERSION; + return true; + } + return false; +} + void PrintConnectionInfo(const SSL *ssl) { const SSL_CIPHER *cipher = SSL_get_current_cipher(ssl); |