MCPcopy Create free account
hub / github.com/apache/cloudberry / my_SSL_set_fd

Function my_SSL_set_fd

src/interfaces/libpq/fe-secure-openssl.c:1776–1802  ·  view source on GitHub ↗

This should exactly match OpenSSL's SSL_set_fd except for using my BIO */

Source from the content-addressed store, hash-verified

1774
1775/* This should exactly match OpenSSL's SSL_set_fd except for using my BIO */
1776static int
1777my_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;
1800err:
1801 return ret;
1802}
1803
1804/*
1805 * This is the default handler to return a client cert password from

Callers 1

initialize_SSLFunction · 0.70

Calls 1

my_BIO_s_socketFunction · 0.70

Tested by

no test coverage detected