Fix protos_len size in SSL_set_alpn_protos and SSL_CTX_set_alpn_protos
MakeConstSpan() takes size_t as the second argument, so protos_len ought to also be size_t. Bug: chromium:879657 Change-Id: I93089ea20ce4b9c2b9d4d954dce807feb5341482 Reviewed-on: https://boringssl-review.googlesource.com/c/34164 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: David Benjamin <davidben@google.com>
This commit is contained in:
committed by
CQ bot account: commit-bot@chromium.org
parent
9cde848bd1
commit
35771ff8af
@@ -2661,7 +2661,7 @@ OPENSSL_EXPORT SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx);
|
||||
// WARNING: this function is dangerous because it breaks the usual return value
|
||||
// convention.
|
||||
OPENSSL_EXPORT int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const uint8_t *protos,
|
||||
unsigned protos_len);
|
||||
size_t protos_len);
|
||||
|
||||
// SSL_set_alpn_protos sets the client ALPN protocol list on |ssl| to |protos|.
|
||||
// |protos| must be in wire-format (i.e. a series of non-empty, 8-bit
|
||||
@@ -2671,7 +2671,7 @@ OPENSSL_EXPORT int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const uint8_t *protos,
|
||||
// WARNING: this function is dangerous because it breaks the usual return value
|
||||
// convention.
|
||||
OPENSSL_EXPORT int SSL_set_alpn_protos(SSL *ssl, const uint8_t *protos,
|
||||
unsigned protos_len);
|
||||
size_t protos_len);
|
||||
|
||||
// SSL_CTX_set_alpn_select_cb sets a callback function on |ctx| that is called
|
||||
// during ClientHello processing in order to select an ALPN protocol from the
|
||||
|
||||
+2
-2
@@ -2149,14 +2149,14 @@ void SSL_CTX_set_next_proto_select_cb(
|
||||
}
|
||||
|
||||
int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const uint8_t *protos,
|
||||
unsigned protos_len) {
|
||||
size_t protos_len) {
|
||||
// Note this function's calling convention is backwards.
|
||||
return ctx->alpn_client_proto_list.CopyFrom(MakeConstSpan(protos, protos_len))
|
||||
? 0
|
||||
: 1;
|
||||
}
|
||||
|
||||
int SSL_set_alpn_protos(SSL *ssl, const uint8_t *protos, unsigned protos_len) {
|
||||
int SSL_set_alpn_protos(SSL *ssl, const uint8_t *protos, size_t protos_len) {
|
||||
// Note this function's calling convention is backwards.
|
||||
if (!ssl->config) {
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user