From 823effe97507d036f660c6c65203f7551d5f0a99 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Wed, 16 Jan 2019 11:47:47 -0800 Subject: [PATCH] Revert "Fix protos_len size in SSL_set_alpn_protos and SSL_CTX_set_alpn_protos" This reverts commit 35771ff8afc2201b5cf5b884db5b3889edde06bc. It breaks tcnetty, which is tcnetty's fault but we have a large backlog from Christmas to break with at the moment. Bug: chromium:879657 Change-Id: Iafe93b335d88722170ec2689a25e145969e19e73 Reviewed-on: https://boringssl-review.googlesource.com/c/34324 Commit-Queue: David Benjamin Reviewed-by: David Benjamin --- include/openssl/ssl.h | 4 ++-- ssl/ssl_lib.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index f09ffa4b..59b9eac1 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -2658,7 +2658,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, - size_t protos_len); + unsigned 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 @@ -2668,7 +2668,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, - size_t protos_len); + unsigned 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 diff --git a/ssl/ssl_lib.cc b/ssl/ssl_lib.cc index f3d92a6b..bcf4bd22 100644 --- a/ssl/ssl_lib.cc +++ b/ssl/ssl_lib.cc @@ -2141,14 +2141,14 @@ void SSL_CTX_set_next_proto_select_cb( } int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const uint8_t *protos, - size_t protos_len) { + unsigned 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, size_t protos_len) { +int SSL_set_alpn_protos(SSL *ssl, const uint8_t *protos, unsigned protos_len) { // Note this function's calling convention is backwards. if (!ssl->config) { return 1;