Align SSL_set_{min,max}_version with upstream.
Upstream added these functions after we did but decided to change the
names slightly. I'm not sure why they wanted to add the "proto" in
there, but align with them nonetheless so the ecosystem only has one set
of these functions.
BUG=90
Change-Id: Ia9863c58c9734374092051f02952b112806040cc
Reviewed-on: https://boringssl-review.googlesource.com/11123
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>
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 0e8b344..8232532 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -311,11 +311,11 @@
/* Lock the SSL_CTX to the specified version, for compatibility with legacy
* uses of SSL_METHOD. */
if (method->version != 0) {
- SSL_CTX_set_max_version(ret, method->version);
- SSL_CTX_set_min_version(ret, method->version);
+ SSL_CTX_set_max_proto_version(ret, method->version);
+ SSL_CTX_set_min_proto_version(ret, method->version);
} else if (!method->method->is_dtls) {
/* TODO(svaldez): Enable TLS 1.3 by default once fully implemented. */
- SSL_CTX_set_max_version(ret, TLS1_2_VERSION);
+ SSL_CTX_set_max_proto_version(ret, TLS1_2_VERSION);
}
return ret;
@@ -949,19 +949,19 @@
return SSL_ERROR_SYSCALL;
}
-int SSL_CTX_set_min_version(SSL_CTX *ctx, uint16_t version) {
+int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version) {
return ctx->method->version_from_wire(&ctx->min_version, version);
}
-int SSL_CTX_set_max_version(SSL_CTX *ctx, uint16_t version) {
+int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version) {
return ctx->method->version_from_wire(&ctx->max_version, version);
}
-int SSL_set_min_version(SSL *ssl, uint16_t version) {
+int SSL_set_min_proto_version(SSL *ssl, uint16_t version) {
return ssl->method->version_from_wire(&ssl->min_version, version);
}
-int SSL_set_max_version(SSL *ssl, uint16_t version) {
+int SSL_set_max_proto_version(SSL *ssl, uint16_t version) {
return ssl->method->version_from_wire(&ssl->max_version, version);
}
@@ -3003,3 +3003,19 @@
gettimeofday(out_clock, NULL);
#endif
}
+
+int SSL_CTX_set_min_version(SSL_CTX *ctx, uint16_t version) {
+ return SSL_CTX_set_min_proto_version(ctx, version);
+}
+
+int SSL_CTX_set_max_version(SSL_CTX *ctx, uint16_t version) {
+ return SSL_CTX_set_max_proto_version(ctx, version);
+}
+
+int SSL_set_min_version(SSL *ssl, uint16_t version) {
+ return SSL_set_min_proto_version(ssl, version);
+}
+
+int SSL_set_max_version(SSL *ssl, uint16_t version) {
+ return SSL_set_max_proto_version(ssl, version);
+}