diff options
author | Tomas Mraz <tomas@openssl.org> | 2022-06-20 18:11:28 +0300 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2022-07-28 12:04:28 +0300 |
commit | 38b051a1fedc79ebf24a96de2e9a326ad3665baf (patch) | |
tree | e32fa2a0a5cf8572b48b3cb8a1aac2a20d0b439f /ssl/ssl_stat.c | |
parent | ce602bb0a20589e5a84c48a55ce13219ab881e84 (diff) |
SSL object refactoring using SSL_CONNECTION object
Make the SSL object polymorphic based on whether this is
a traditional SSL connection, QUIC connection, or later
to be implemented a QUIC stream.
It requires adding if after every SSL_CONNECTION_FROM_SSL() call
which itself has to be added to almost every public SSL_ API call.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18612)
Diffstat (limited to 'ssl/ssl_stat.c')
-rw-r--r-- | ssl/ssl_stat.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ssl/ssl_stat.c b/ssl/ssl_stat.c index f2316f7c98..8854abcbd1 100644 --- a/ssl/ssl_stat.c +++ b/ssl/ssl_stat.c @@ -13,7 +13,9 @@ const char *SSL_state_string_long(const SSL *s) { - if (ossl_statem_in_error(s)) + const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); + + if (sc == NULL || ossl_statem_in_error(sc)) return "error"; switch (SSL_get_state(s)) { @@ -120,7 +122,9 @@ const char *SSL_state_string_long(const SSL *s) const char *SSL_state_string(const SSL *s) { - if (ossl_statem_in_error(s)) + const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); + + if (sc == NULL || ossl_statem_in_error(sc)) return "SSLERR"; switch (SSL_get_state(s)) { |