]> granicus.if.org Git - openssl/commit
Fix BIO_pop for SSL BIOs
authorMatt Caswell <matt@openssl.org>
Thu, 21 Jul 2016 09:55:31 +0000 (10:55 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 29 Jul 2016 13:09:57 +0000 (14:09 +0100)
commitb46fe860fe18131f72e8bc059defe3acc8a20f5d
tree98e9d88aabbfc9795fa7dcaab6d1ac6eee883486
parenteddef305897cd8e9facbc18ed93a4ec104ab1927
Fix BIO_pop for SSL BIOs

The BIO_pop implementation assumes that the rbio still equals the next BIO
in the chain. While this would normally be the case, it is possible that it
could have been changed directly by the application. It also does not
properly cater for the scenario where the buffering BIO is still in place
for the write BIO.

Most of the existing BIO_pop code for SSL BIOs can be replaced by a single
call to SSL_set_bio(). This is equivalent to the existing code but
additionally handles the scenario where the rbio has been changed or the
buffering BIO is still in place.

Reviewed-by: Rich Salz <rsalz@openssl.org>
ssl/bio_ssl.c