Skip to content

Commit

Permalink
Fixed build for openssl compiled with OPENSSL_NO_ENGINE.
Browse files Browse the repository at this point in the history
Closes #2589. Thanks to Dirk Feytons.
  • Loading branch information
ralight committed Aug 6, 2022
1 parent a146c21 commit 8c0600c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Broker:
- Fix mosquitto_plugin.h not including mosquitto_broker.h. Closes #2350.
- Fix unlimited message quota not being properly checked for incoming
messages. Closes #2593.
- Fixed build for openssl compiled with OPENSSL_NO_ENGINE. Closes #2589.

Client library:
- Initialise sockpairR/W to invalid in `mosquitto_reinitialise()` to avoid
Expand Down
8 changes: 5 additions & 3 deletions src/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ int net__tls_load_verify(struct mosquitto__listener *listener)
#ifdef WITH_TLS
int rc;

#if OPENSSL_VERSION_NUMBER < 0x30000000L
# if OPENSSL_VERSION_NUMBER < 0x30000000L
if(listener->cafile || listener->capath){
rc = SSL_CTX_load_verify_locations(listener->ssl_ctx, listener->cafile, listener->capath);
if(rc == 0){
Expand All @@ -583,7 +583,7 @@ int net__tls_load_verify(struct mosquitto__listener *listener)
}
}
}
#else
# else
if(listener->cafile){
rc = SSL_CTX_load_verify_file(listener->ssl_ctx, listener->cafile);
if(rc == 0){
Expand All @@ -600,11 +600,13 @@ int net__tls_load_verify(struct mosquitto__listener *listener)
return MOSQ_ERR_TLS;
}
}
#endif
# endif

# if !defined(OPENSSL_NO_ENGINE)
if(net__load_engine(listener)){
return MOSQ_ERR_TLS;
}
# endif
#endif
return net__load_certificates(listener);
}
Expand Down

0 comments on commit 8c0600c

Please sign in to comment.