From 7d2dbc379197cd6477c27da150f811084b124841 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Sat, 25 Mar 2017 18:22:58 -0500 Subject: [PATCH] Add a comment around the set_{min,max}_version logic. It's not immediately obvious what's going on here. Change-Id: Ibbba80a6ff9ace4d88e89a42efc270b77b4fad12 Reviewed-on: https://boringssl-review.googlesource.com/14368 Reviewed-by: Steven Valdez Reviewed-by: David Benjamin Commit-Queue: Steven Valdez Commit-Queue: David Benjamin CQ-Verified: CQ bot account: commit-bot@chromium.org --- ssl/ssl_lib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 88d5f29c3..240530607 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -924,6 +924,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) { static int set_min_version(const SSL_PROTOCOL_METHOD *method, uint16_t *out, uint16_t version) { + /* Zero is interpreted as the default minimum version. */ if (version == 0) { *out = method->min_version; return 1; @@ -938,6 +939,7 @@ static int set_min_version(const SSL_PROTOCOL_METHOD *method, uint16_t *out, static int set_max_version(const SSL_PROTOCOL_METHOD *method, uint16_t *out, uint16_t version) { + /* Zero is interpreted as the default maximum version. */ if (version == 0) { *out = method->max_version; /* TODO(svaldez): Enable TLS 1.3 by default once fully implemented. */