mirror of
https://github.com/openssl/openssl.git
synced 2025-03-19 19:50:42 +08:00
Get pointer type right in BIO_ssl_shutdown()
Also, restore 1.0.2 behavior of looping over all BIO's in the chain. Thanks to Joseph Bester for finding this and suggesting a fix to the crash. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2651)
This commit is contained in:
parent
f8418d87e1
commit
9015d34e14
@ -506,12 +506,13 @@ int BIO_ssl_copy_session_id(BIO *t, BIO *f)
|
||||
|
||||
void BIO_ssl_shutdown(BIO *b)
|
||||
{
|
||||
SSL *s;
|
||||
BIO_SSL *bdata;
|
||||
|
||||
b = BIO_find_type(b, BIO_TYPE_SSL);
|
||||
if (b == NULL)
|
||||
return;
|
||||
|
||||
s = BIO_get_data(b);
|
||||
SSL_shutdown(s);
|
||||
for (; b != NULL; b = BIO_next(b)) {
|
||||
if (BIO_method_type(b) != BIO_TYPE_SSL)
|
||||
continue;
|
||||
bdata = BIO_get_data(b);
|
||||
if (bdata != NULL && bdata->ssl != NULL)
|
||||
SSL_shutdown(bdata->ssl);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user