mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-04 21:58:22 +00:00
Fix #1510 - wrap X509_VERIFY_PARAM_set1_host() usage inside a conditional
This commit is contained in:
1 parent
fde8b82b78
commit
d11173fe90
2 files changed
+4
No files matched your search
@@ -4540,6 +4540,7 @@ void mg_tls_init(struct mg_connection *c, struct mg_tls_opts *opts) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if OPENSSL_VERSION_NUMBER > 0x10002000L
|
||||||
if (opts->srvname.len > 0) {
|
if (opts->srvname.len > 0) {
|
||||||
char mem[128], *buf = mem;
|
char mem[128], *buf = mem;
|
||||||
size_t len = mg_asprintf(&buf, sizeof(mem), "%.*s", (int) opts->srvname.len,
|
size_t len = mg_asprintf(&buf, sizeof(mem), "%.*s", (int) opts->srvname.len,
|
||||||
@@ -4547,6 +4548,7 @@ void mg_tls_init(struct mg_connection *c, struct mg_tls_opts *opts) {
|
|||||||
X509_VERIFY_PARAM_set1_host(SSL_get0_param(tls->ssl), buf, len);
|
X509_VERIFY_PARAM_set1_host(SSL_get0_param(tls->ssl), buf, len);
|
||||||
if (buf != mem) free(buf);
|
if (buf != mem) free(buf);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (opts->ciphers != NULL) SSL_set_cipher_list(tls->ssl, opts->ciphers);
|
if (opts->ciphers != NULL) SSL_set_cipher_list(tls->ssl, opts->ciphers);
|
||||||
if (opts->srvname.len > 0) {
|
if (opts->srvname.len > 0) {
|
||||||
char mem[128], *buf = mem;
|
char mem[128], *buf = mem;
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ void mg_tls_init(struct mg_connection *c, struct mg_tls_opts *opts) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if OPENSSL_VERSION_NUMBER > 0x10002000L
|
||||||
if (opts->srvname.len > 0) {
|
if (opts->srvname.len > 0) {
|
||||||
char mem[128], *buf = mem;
|
char mem[128], *buf = mem;
|
||||||
size_t len = mg_asprintf(&buf, sizeof(mem), "%.*s", (int) opts->srvname.len,
|
size_t len = mg_asprintf(&buf, sizeof(mem), "%.*s", (int) opts->srvname.len,
|
||||||
@@ -95,6 +96,7 @@ void mg_tls_init(struct mg_connection *c, struct mg_tls_opts *opts) {
|
|||||||
X509_VERIFY_PARAM_set1_host(SSL_get0_param(tls->ssl), buf, len);
|
X509_VERIFY_PARAM_set1_host(SSL_get0_param(tls->ssl), buf, len);
|
||||||
if (buf != mem) free(buf);
|
if (buf != mem) free(buf);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (opts->ciphers != NULL) SSL_set_cipher_list(tls->ssl, opts->ciphers);
|
if (opts->ciphers != NULL) SSL_set_cipher_list(tls->ssl, opts->ciphers);
|
||||||
if (opts->srvname.len > 0) {
|
if (opts->srvname.len > 0) {
|
||||||
char mem[128], *buf = mem;
|
char mem[128], *buf = mem;
|
||||||
|
|||||||
Reference in new issue
Block a user