Bug 261867

Summary: net-p2p/monero-cli: Fails to build with ssl=libressl: error: member access into incomplete type 'SSL_CTX' (aka 'ssl_ctx_st')
Product: Ports & Packages Reporter: Cameron <cam>
Component: Individual Port(s)Assignee: Vasil Dimov <vd>
Status: Closed FIXED    
Severity: Affects Some People CC: brnrd, vd
Priority: --- Keywords: needs-qa
Version: LatestFlags: brnrd: maintainer-feedback-
koobs: maintainer-feedback? (vd)
koobs: merge-quarterly?
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Full output of failed monero-cli build none

Description Cameron 2022-02-10 16:26:08 UTC
Created attachment 231719 [details]
Full output of failed monero-cli build

net-p2p/monero-cli doesn't build with security/libressl. Here's the relevant portion of the output. The full output is attached. I've reproduced this on 2 machines that are using LibreSSL:

In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.cpp:37:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.h:38:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/bootstrap_daemon.h:11:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/net/http.h:31:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/http_client.h:41:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/net_helper.h:40:
In file included from /usr/local/include/boost/asio/ssl.hpp:18:
In file included from /usr/local/include/boost/asio/ssl/context.hpp:757:
/usr/local/include/boost/asio/ssl/impl/context.ipp:395:32: error: member access into incomplete type 'SSL_CTX' (aka 'ssl_ctx_st')
    void* cb_userdata = handle_->default_passwd_callback_userdata;
                               ^
/usr/local/include/openssl/ossl_typ.h:161:16: note: forward declaration of 'ssl_ctx_st'
typedef struct ssl_ctx_st SSL_CTX;
               ^
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.cpp:37:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.h:38:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/bootstrap_daemon.h:11:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/net/http.h:31:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/http_client.h:41:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/net_helper.h:40:
In file included from /usr/local/include/boost/asio/ssl.hpp:18:
In file included from /usr/local/include/boost/asio/ssl/context.hpp:757:
/usr/local/include/boost/asio/ssl/impl/context.ipp:408:14: error: member access into incomplete type 'SSL_CTX' (aka 'ssl_ctx_st')
      handle_->default_passwd_callback_userdata = 0;
             ^
/usr/local/include/openssl/ossl_typ.h:161:16: note: forward declaration of 'ssl_ctx_st'
typedef struct ssl_ctx_st SSL_CTX;
               ^
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.cpp:37:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.h:38:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/bootstrap_daemon.h:11:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/net/http.h:31:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/http_client.h:41:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/net_helper.h:40:
In file included from /usr/local/include/boost/asio/ssl.hpp:18:
In file included from /usr/local/include/boost/asio/ssl/context.hpp:757:
/usr/local/include/boost/asio/ssl/impl/context.ipp:748:40: error: member access into incomplete type 'SSL_CTX' (aka 'ssl_ctx_st')
    pem_password_cb* callback = handle_->default_passwd_callback;
                                       ^
/usr/local/include/openssl/ossl_typ.h:161:16: note: forward declaration of 'ssl_ctx_st'
typedef struct ssl_ctx_st SSL_CTX;
               ^
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.cpp:37:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.h:38:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/bootstrap_daemon.h:11:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/net/http.h:31:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/http_client.h:41:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/net_helper.h:40:
In file included from /usr/local/include/boost/asio/ssl.hpp:18:
In file included from /usr/local/include/boost/asio/ssl/context.hpp:757:
/usr/local/include/boost/asio/ssl/impl/context.ipp:749:32: error: member access into incomplete type 'SSL_CTX' (aka 'ssl_ctx_st')
    void* cb_userdata = handle_->default_passwd_callback_userdata;
                               ^
/usr/local/include/openssl/ossl_typ.h:161:16: note: forward declaration of 'ssl_ctx_st'
typedef struct ssl_ctx_st SSL_CTX;
               ^
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.cpp:37:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.h:38:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/bootstrap_daemon.h:11:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/net/http.h:31:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/http_client.h:41:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/net_helper.h:40:
In file included from /usr/local/include/boost/asio/ssl.hpp:18:
In file included from /usr/local/include/boost/asio/ssl/context.hpp:757:
/usr/local/include/boost/asio/ssl/impl/context.ipp:776:16: error: member access into incomplete type 'SSL_CTX' (aka 'ssl_ctx_st')
    if (handle_->extra_certs)
               ^
/usr/local/include/openssl/ossl_typ.h:161:16: note: forward declaration of 'ssl_ctx_st'
typedef struct ssl_ctx_st SSL_CTX;
               ^
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.cpp:37:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.h:38:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/bootstrap_daemon.h:11:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/net/http.h:31:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/http_client.h:41:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/net_helper.h:40:
In file included from /usr/local/include/boost/asio/ssl.hpp:18:
In file included from /usr/local/include/boost/asio/ssl/context.hpp:757:
/usr/local/include/boost/asio/ssl/impl/context.ipp:778:33: error: member access into incomplete type 'SSL_CTX' (aka 'ssl_ctx_st')
      ::sk_X509_pop_free(handle_->extra_certs, X509_free);
                                ^
/usr/local/include/openssl/ossl_typ.h:161:16: note: forward declaration of 'ssl_ctx_st'
typedef struct ssl_ctx_st SSL_CTX;
               ^
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.cpp:37:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.h:38:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/bootstrap_daemon.h:11:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/net/http.h:31:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/http_client.h:41:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/net_helper.h:40:
In file included from /usr/local/include/boost/asio/ssl.hpp:18:
In file included from /usr/local/include/boost/asio/ssl/context.hpp:757:
/usr/local/include/boost/asio/ssl/impl/context.ipp:779:14: error: member access into incomplete type 'SSL_CTX' (aka 'ssl_ctx_st')
      handle_->extra_certs = 0;
             ^
/usr/local/include/openssl/ossl_typ.h:161:16: note: forward declaration of 'ssl_ctx_st'
typedef struct ssl_ctx_st SSL_CTX;
               ^
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.cpp:37:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.h:38:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/bootstrap_daemon.h:11:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/net/http.h:31:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/http_client.h:41:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/net_helper.h:40:
In file included from /usr/local/include/boost/asio/ssl.hpp:18:
In file included from /usr/local/include/boost/asio/ssl/context.hpp:757:
/usr/local/include/boost/asio/ssl/impl/context.ipp:856:40: error: member access into incomplete type 'SSL_CTX' (aka 'ssl_ctx_st')
    pem_password_cb* callback = handle_->default_passwd_callback;
                                       ^
/usr/local/include/openssl/ossl_typ.h:161:16: note: forward declaration of 'ssl_ctx_st'
typedef struct ssl_ctx_st SSL_CTX;
               ^
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.cpp:37:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.h:38:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/bootstrap_daemon.h:11:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/net/http.h:31:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/http_client.h:41:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/net_helper.h:40:
In file included from /usr/local/include/boost/asio/ssl.hpp:18:
In file included from /usr/local/include/boost/asio/ssl/context.hpp:757:
/usr/local/include/boost/asio/ssl/impl/context.ipp:857:32: error: member access into incomplete type 'SSL_CTX' (aka 'ssl_ctx_st')
    void* cb_userdata = handle_->default_passwd_callback_userdata;
                               ^
/usr/local/include/openssl/ossl_typ.h:161:16: note: forward declaration of 'ssl_ctx_st'
typedef struct ssl_ctx_st SSL_CTX;
               ^
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.cpp:37:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.h:38:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/bootstrap_daemon.h:11:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/net/http.h:31:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/http_client.h:41:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/net_helper.h:40:
In file included from /usr/local/include/boost/asio/ssl.hpp:18:
In file included from /usr/local/include/boost/asio/ssl/context.hpp:757:
/usr/local/include/boost/asio/ssl/impl/context.ipp:925:40: error: member access into incomplete type 'SSL_CTX' (aka 'ssl_ctx_st')
    pem_password_cb* callback = handle_->default_passwd_callback;
                                       ^
/usr/local/include/openssl/ossl_typ.h:161:16: note: forward declaration of 'ssl_ctx_st'
typedef struct ssl_ctx_st SSL_CTX;
               ^
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.cpp:37:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.h:38:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/bootstrap_daemon.h:11:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/net/http.h:31:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/http_client.h:41:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/net_helper.h:40:
In file included from /usr/local/include/boost/asio/ssl.hpp:18:
In file included from /usr/local/include/boost/asio/ssl/context.hpp:757:
/usr/local/include/boost/asio/ssl/impl/context.ipp:926:32: error: member access into incomplete type 'SSL_CTX' (aka 'ssl_ctx_st')
    void* cb_userdata = handle_->default_passwd_callback_userdata;
                               ^
/usr/local/include/openssl/ossl_typ.h:161:16: note: forward declaration of 'ssl_ctx_st'
typedef struct ssl_ctx_st SSL_CTX;
               ^
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.cpp:37:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.h:38:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/bootstrap_daemon.h:11:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/net/http.h:31:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/http_client.h:41:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/net_helper.h:40:
In file included from /usr/local/include/boost/asio/ssl.hpp:18:
In file included from /usr/local/include/boost/asio/ssl/context.hpp:757:
/usr/local/include/boost/asio/ssl/impl/context.ipp:1166:31: error: member access into incomplete type 'SSL_CTX' (aka 'ssl_ctx_st')
  void* old_callback = handle_->default_passwd_callback_userdata;
                              ^
/usr/local/include/openssl/ossl_typ.h:161:16: note: forward declaration of 'ssl_ctx_st'
typedef struct ssl_ctx_st SSL_CTX;
               ^
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.cpp:37:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.h:38:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/bootstrap_daemon.h:11:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/net/http.h:31:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/http_client.h:41:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/contrib/epee/include/net/net_helper.h:40:
In file included from /usr/local/include/boost/asio/ssl.hpp:18:
In file included from /usr/local/include/boost/asio/ssl/context.hpp:757:
/usr/local/include/boost/asio/ssl/impl/context.ipp:1167:10: error: member access into incomplete type 'SSL_CTX' (aka 'ssl_ctx_st')
  handle_->default_passwd_callback_userdata = callback;
         ^
/usr/local/include/openssl/ossl_typ.h:161:16: note: forward declaration of 'ssl_ctx_st'
typedef struct ssl_ctx_st SSL_CTX;
               ^
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.cpp:37:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server.h:41:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/rpc/core_rpc_server_commands_defs.h:35:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/cryptonote_protocol/cryptonote_protocol_defs.h:35:
In file included from /usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/cryptonote_basic/cryptonote_basic.h:41:
/usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/serialization/binary_archive.h:200:28: warning: shift count >= width of type [-Wshift-count-overflow]
      if (1 < sizeof(T)) v >>= 8;
                           ^   ~
/usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/serialization/binary_archive.h:193:5: note: in instantiation of function template specialization 'binary_archive<true>::serialize_uint<unsigned char>' requested here
    serialize_uint(static_cast<typename boost::make_unsigned<T>::type>(v));
    ^
/usr/ports/net-p2p/monero-cli/work/monero-0.17.3.0/src/serialization/binary_archive.h:233:5: note: in instantiation of function template specialization 'binary_archive<true>::serialize_int<unsigned char>' requested here
    serialize_int(t);
    ^
1 warning and 13 errors generated.
Comment 1 Bernard Spil freebsd_committer freebsd_triage 2022-03-26 12:18:23 UTC
Proof-of-work stuff relies on bug-compatible OpenSSL implementations.

No support for LibreSSL
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-10-25 08:56:26 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b2d7b5a735d55efe9f8912d57b445c48e86a8e72

commit b2d7b5a735d55efe9f8912d57b445c48e86a8e72
Author:     Vasil Dimov <vd@FreeBSD.org>
AuthorDate: 2022-10-25 08:50:27 +0000
Commit:     Vasil Dimov <vd@FreeBSD.org>
CommitDate: 2022-10-25 08:55:47 +0000

    net-p2p/monero-cli: mark as broken with LibreSSL

    PR:     261867

 net-p2p/monero-cli/Makefile | 1 +
 1 file changed, 1 insertion(+)
Comment 3 Vasil Dimov freebsd_committer freebsd_triage 2022-10-25 08:59:46 UTC
Marked as broken with LibreSSL. Ideally, this should be reported upstream and if/when fixed upstream, then the BROKEN_SSL line removed from the port.