Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix leak for openssl > 3.0 and fix all openssl deprecations #1791

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

michaelortmann
Copy link
Member

@michaelortmann michaelortmann commented Mar 8, 2025

Found by: michaelortmann
Patch by: michaelortmann
Fixes:

One-line summary:
Fix leak for openssl > 3.0 and fix all openssl deprecations

Additional description (if needed):
Fix leak for openssl > 3.0

The leak is happening in ssl_getuid() which is called only in dcc_telnet_id() for telnet over ssl when ssl-cert-auth is set to 2. This PR fixes the leak for eggdrop using openssl >= 3.0.

Fix openssl 1.1 deprecation SSLeay_version() -> OpenSSL_version()
Fix openssl 1.1 deprecation ERR_free_strings()
Fix openssl 3.0 deprecation SSL_get_peer_certificate()
Fix openssl 1.1 deprecation X509_get_notBefore() and X509_get_notAfter() and make ssl_printtime() parameter const

Test cases demonstrating functionality (if applicable):
Fixes the following errors when openssl 3.4.1 is compiled with no-deprecated:
1.

chanprog.c: In function ‘tell_verbose_status’:
chanprog.c:300:11: error: implicit declaration of function ‘SSLeay_version’; did you mean ‘SSL_version’? [-Wimplicit-function-declaration]
  300 |           SSLeay_version(SSLEAY_VERSION), MISC_HEADERVERSION);
      |           ^~~~~~~~~~~~~~
      |           SSL_version
chanprog.c:300:26: error: ‘SSLEAY_VERSION’ undeclared (first use in this function); did you mean ‘SSL3_VERSION’?
  300 |           SSLeay_version(SSLEAY_VERSION), MISC_HEADERVERSION);
      |                          ^~~~~~~~~~~~~~
      |                          SSL3_VERSION
tls.c: In function ‘ssl_init’:
tls.c:132:5: error: implicit declaration of function ‘ERR_free_strings’; did you mean ‘ERR_load_strings’? [-Wimplicit-function-declaration]
  132 |     ERR_free_strings();
      |     ^~~~~~~~~~~~~~~~
      |     ERR_load_strings
tls.c: In function ‘ssl_getcert’:
tls.c:346:10: error: implicit declaration of function ‘SSL_get_peer_certificate’; did you mean ‘SSL_get1_peer_certificate’? [-Wimplicit-function-declaration]
  346 |   return SSL_get_peer_certificate(td->socklist[i].ssl);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
      |          SSL_get1_peer_certificate
tls.c:346:10: error: returning ‘int’ from a function with return type ‘X509 *’ {aka ‘struct x509_st *’} makes pointer from integer without a cast [-Wint-conversion]
  346 |   return SSL_get_peer_certificate(td->socklist[i].ssl);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tls.c: In function ‘ssl_showcert’:
tls.c:694:24: error: implicit declaration of function ‘X509_get_notBefore’; did you mean ‘X509_getm_notBefore’? [-Wimplicit-function-declaration]
  694 |   from = ssl_printtime(X509_get_notBefore(cert));
      |                        ^~~~~~~~~~~~~~~~~~
      |                        X509_getm_notBefore
tls.c:694:24: error: passing argument 1 of ‘ssl_printtime’ makes pointer from integer without a cast [-Wint-conversion]
  694 |   from = ssl_printtime(X509_get_notBefore(cert));
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~
      |                        |
      |                        int

@michaelortmann michaelortmann changed the title Fix openssl deprecation Fix leak for openssl > 3.0 and fix openssl deprecations Mar 9, 2025
…r() and make ssl_printtime() parameter const
@michaelortmann michaelortmann changed the title Fix leak for openssl > 3.0 and fix openssl deprecations Fix leak for openssl > 3.0 and fix all openssl deprecations Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant