From fa3e9c3385fc872b705b81860139616851829a71 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Wed, 14 Mar 2018 17:32:04 -0700 Subject: [PATCH] Add |SSL_COMP_get[0_name|_id]|. These functions are needed by MySQL 8.0: https://github.com/mysql/mysql-server/blob/8.0/vio/viossl.cc#L459 Change-Id: I4f13fa26cfe695229d6c8df80bcfc218408184da Reviewed-on: https://boringssl-review.googlesource.com/26544 Commit-Queue: David Benjamin Reviewed-by: David Benjamin CQ-Verified: CQ bot account: commit-bot@chromium.org --- include/openssl/ssl.h | 9 +++++++-- ssl/ssl_cipher.cc | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index 147ea5f4..8e7d5f52 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -3600,6 +3600,7 @@ OPENSSL_EXPORT const char *SSL_CIPHER_get_version(const SSL_CIPHER *cipher); OPENSSL_EXPORT char *SSL_CIPHER_get_rfc_name(const SSL_CIPHER *cipher); typedef void COMP_METHOD; +typedef struct ssl_comp_st SSL_COMP; // SSL_COMP_get_compression_methods returns NULL. OPENSSL_EXPORT STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); @@ -3610,6 +3611,12 @@ OPENSSL_EXPORT int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm); // SSL_COMP_get_name returns NULL. OPENSSL_EXPORT const char *SSL_COMP_get_name(const COMP_METHOD *comp); +// SSL_COMP_get0_name returns the |name| member of |comp|. +OPENSSL_EXPORT const char *SSL_COMP_get0_name(const SSL_COMP *comp); + +// SSL_COMP_get_id returns the |id| member of |comp|. +OPENSSL_EXPORT int SSL_COMP_get_id(const SSL_COMP *comp); + // SSL_COMP_free_compression_methods does nothing. OPENSSL_EXPORT void SSL_COMP_free_compression_methods(void); @@ -3836,8 +3843,6 @@ OPENSSL_EXPORT void SSL_set_tmp_dh_callback(SSL *ssl, #define SSL_set_timeout(session, timeout) \ SSL_SESSION_set_timeout((session), (timeout)) -typedef struct ssl_comp_st SSL_COMP; - struct ssl_comp_st { int id; const char *name; diff --git a/ssl/ssl_cipher.cc b/ssl/ssl_cipher.cc index 3a45f641..32e6c2cd 100644 --- a/ssl/ssl_cipher.cc +++ b/ssl/ssl_cipher.cc @@ -1774,4 +1774,8 @@ int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm) { return 1; } const char *SSL_COMP_get_name(const COMP_METHOD *comp) { return NULL; } +const char *SSL_COMP_get0_name(const SSL_COMP *comp) { return comp->name; } + +int SSL_COMP_get_id(const SSL_COMP *comp) { return comp->id; } + void SSL_COMP_free_compression_methods(void) {}