提交 9015d34e 编写于 作者: R Rich Salz

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: NTim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2651)
上级 f8418d87
...@@ -506,12 +506,13 @@ int BIO_ssl_copy_session_id(BIO *t, BIO *f) ...@@ -506,12 +506,13 @@ int BIO_ssl_copy_session_id(BIO *t, BIO *f)
void BIO_ssl_shutdown(BIO *b) void BIO_ssl_shutdown(BIO *b)
{ {
SSL *s; BIO_SSL *bdata;
b = BIO_find_type(b, BIO_TYPE_SSL); for (; b != NULL; b = BIO_next(b)) {
if (b == NULL) if (BIO_method_type(b) != BIO_TYPE_SSL)
return; continue;
bdata = BIO_get_data(b);
s = BIO_get_data(b); if (bdata != NULL && bdata->ssl != NULL)
SSL_shutdown(s); SSL_shutdown(bdata->ssl);
}
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册