diff options
author | Adam Langley <agl@google.com> | 2015-02-21 00:43:23 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-02-21 02:44:17 +0300 |
commit | 44972944fd85bb38f5e28a2a912295717258c2cf (patch) | |
tree | 9e52a40c17f78cf7c39a3b20dcd232ffc59f400d | |
parent | 5f0efe06e199a1bd96f161eb45f3dd76924cdc2a (diff) |
Add SSL_get_cipher_by_value.
(Which is just an exported wrapper around ssl3_get_cipher_by_value.)
Change-Id: Ibba166015ce59e337ff50963ba20237ac4949aaf
Reviewed-on: https://boringssl-review.googlesource.com/3543
Reviewed-by: Adam Langley <agl@google.com>
-rw-r--r-- | include/openssl/ssl.h | 5 | ||||
-rw-r--r-- | ssl/ssl_lib.c | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index 0a01fd62..c5645a4c 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -2236,6 +2236,11 @@ OPENSSL_EXPORT void SSL_get_structure_sizes(size_t *ssl_size, OPENSSL_EXPORT void ERR_load_SSL_strings(void); +/* SSL_get_cipher_by_value returns the structure representing a TLS cipher + * suite based on its assigned number, or NULL if unknown. See + * https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4. */ +OPENSSL_EXPORT const SSL_CIPHER *SSL_get_cipher_by_value(uint16_t value); + /* Android compatibility section. * diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index e81df08b..1c4b10c6 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -3131,3 +3131,7 @@ int SSL_is_server(SSL *s) { return s->server; } void SSL_enable_fastradio_padding(SSL *s, char on_off) { s->fastradio_padding = on_off; } + +const SSL_CIPHER *SSL_get_cipher_by_value(uint16_t value) { + return ssl3_get_cipher_by_value(value); +} |