Don't reach into SSL in BIO_f_ssl.

We can implement this with the SSL stack's public API fine.

Change-Id: Ia95c9174d7b850b7fed89046d3c351c970855cf3
Reviewed-on: https://boringssl-review.googlesource.com/13565
Commit-Queue: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/decrepit/biossl/bio_ssl.c b/decrepit/biossl/bio_ssl.c
index f8147c6..ad8f5d8 100644
--- a/decrepit/biossl/bio_ssl.c
+++ b/decrepit/biossl/bio_ssl.c
@@ -107,14 +107,14 @@
       return 1;
 
     case BIO_CTRL_WPENDING:
-      return BIO_ctrl(ssl->wbio, cmd, num, ptr);
+      return BIO_ctrl(SSL_get_wbio(ssl), cmd, num, ptr);
 
     case BIO_CTRL_PENDING:
       return SSL_pending(ssl);
 
     case BIO_CTRL_FLUSH: {
       BIO_clear_retry_flags(bio);
-      long ret = BIO_ctrl(ssl->wbio, cmd, num, ptr);
+      long ret = BIO_ctrl(SSL_get_wbio(ssl), cmd, num, ptr);
       BIO_copy_next_retry(bio);
       return ret;
     }
@@ -125,7 +125,7 @@
       return -1;
 
     default:
-      return BIO_ctrl(ssl->rbio, cmd, num, ptr);
+      return BIO_ctrl(SSL_get_rbio(ssl), cmd, num, ptr);
   }
 }
 
@@ -159,7 +159,7 @@
       return -1;
 
     default:
-      return BIO_callback_ctrl(ssl->rbio, cmd, fp);
+      return BIO_callback_ctrl(SSL_get_rbio(ssl), cmd, fp);
   }
 }