SSL_get_[rw]fd were documented but not implemented.
[openssl.git] / ssl / ssl_lib.c
index ad1af7cda354d3fcf6e75735cceca5530cfd15f5..463ed16020afa8e79582a059423cd583e95b6521 100644 (file)
@@ -444,6 +444,11 @@ BIO *SSL_get_wbio(SSL *s)
        { return(s->wbio); }
 
 int SSL_get_fd(SSL *s)
+       {
+       return(SSL_get_rfc(s));
+       }
+
+int SSL_get_rfd(SSL *s)
        {
        int ret= -1;
        BIO *b,*r;
@@ -455,6 +460,18 @@ int SSL_get_fd(SSL *s)
        return(ret);
        }
 
+int SSL_get_wfd(SSL *s)
+       {
+       int ret= -1;
+       BIO *b,*r;
+
+       b=SSL_get_wbio(s);
+       r=BIO_find_type(b,BIO_TYPE_DESCRIPTOR);
+       if (r != NULL)
+               BIO_get_fd(r,&ret);
+       return(ret);
+       }
+
 #ifndef OPENSSL_NO_SOCK
 int SSL_set_fd(SSL *s,int fd)
        {