提交 16577339 authored 作者: Brian West's avatar Brian West

FS-6387 don't fail if your openssl package has been compiled without EC…

FS-6387 don't fail if your openssl package has been compiled without EC support...LOOKING AT YOU GENTOO
上级 90404d58
Wed Mar 19 14:23:50 CDT 2014 Thu Mar 20 08:00:42 CDT 2014
...@@ -267,6 +267,7 @@ void tls_init(void) { ...@@ -267,6 +267,7 @@ void tls_init(void) {
ONCE_INIT(tls_init_once); ONCE_INIT(tls_init_once);
} }
#ifndef OPENSSL_NO_EC
static static
int tls_init_ecdh_curve(tls_t *tls) int tls_init_ecdh_curve(tls_t *tls)
{ {
...@@ -287,6 +288,7 @@ int tls_init_ecdh_curve(tls_t *tls) ...@@ -287,6 +288,7 @@ int tls_init_ecdh_curve(tls_t *tls)
EC_KEY_free(ecdh); EC_KEY_free(ecdh);
return 0; return 0;
} }
#endif
static static
int tls_init_context(tls_t *tls, tls_issues_t const *ti) int tls_init_context(tls_t *tls, tls_issues_t const *ti)
...@@ -407,13 +409,13 @@ int tls_init_context(tls_t *tls, tls_issues_t const *ti) ...@@ -407,13 +409,13 @@ int tls_init_context(tls_t *tls, tls_issues_t const *ti)
SSL_CTX_set_verify_depth(tls->ctx, ti->verify_depth); SSL_CTX_set_verify_depth(tls->ctx, ti->verify_depth);
SSL_CTX_set_verify(tls->ctx, verify, tls_verify_cb); SSL_CTX_set_verify(tls->ctx, verify, tls_verify_cb);
#ifndef OPENSSL_NO_EC
if (tls_init_ecdh_curve(tls) == 0) { if (tls_init_ecdh_curve(tls) == 0) {
SU_DEBUG_3(("%s\n", "tls: initialized ECDH")); SU_DEBUG_3(("%s\n", "tls: initialized ECDH"));
} else { } else {
SU_DEBUG_3(("%s\n", "tls: failed to initialize ECDH")); SU_DEBUG_3(("%s\n", "tls: failed to initialize ECDH"));
} }
#endif
if (!SSL_CTX_set_cipher_list(tls->ctx, ti->ciphers)) { if (!SSL_CTX_set_cipher_list(tls->ctx, ti->ciphers)) {
SU_DEBUG_1(("%s: error setting cipher list\n", "tls_init_context")); SU_DEBUG_1(("%s: error setting cipher list\n", "tls_init_context"));
tls_log_errors(3, "tls_init_context", 0); tls_log_errors(3, "tls_init_context", 0);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论