This should exactly match OpenSSL's SSL_set_fd except for using my BIO */
| 1774 | |
| 1775 | /* This should exactly match OpenSSL's SSL_set_fd except for using my BIO */ |
| 1776 | static int |
| 1777 | my_SSL_set_fd(PGconn *conn, int fd) |
| 1778 | { |
| 1779 | int ret = 0; |
| 1780 | BIO *bio; |
| 1781 | BIO_METHOD *bio_method; |
| 1782 | |
| 1783 | bio_method = my_BIO_s_socket(); |
| 1784 | if (bio_method == NULL) |
| 1785 | { |
| 1786 | SSLerr(SSL_F_SSL_SET_FD, ERR_R_BUF_LIB); |
| 1787 | goto err; |
| 1788 | } |
| 1789 | bio = BIO_new(bio_method); |
| 1790 | if (bio == NULL) |
| 1791 | { |
| 1792 | SSLerr(SSL_F_SSL_SET_FD, ERR_R_BUF_LIB); |
| 1793 | goto err; |
| 1794 | } |
| 1795 | BIO_set_app_data(bio, conn); |
| 1796 | |
| 1797 | SSL_set_bio(conn->ssl, bio, bio); |
| 1798 | BIO_set_fd(bio, fd, BIO_NOCLOSE); |
| 1799 | ret = 1; |
| 1800 | err: |
| 1801 | return ret; |
| 1802 | } |
| 1803 | |
| 1804 | /* |
| 1805 | * This is the default handler to return a client cert password from |
no test coverage detected