summaryrefslogtreecommitdiff
path: root/src/network.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2016-07-05 01:36:57 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2016-07-05 01:36:57 -0400
commitd6c60ebbff85a466bf94634f40964f1a26ad543f (patch)
tree75cf990c3516a7ada3f454f4ab5b58376955baa3 /src/network.c
parent340e9aefa022ea1f7e896394b14335e078017a9b (diff)
downloadlighttpd1.4-d6c60ebbff85a466bf94634f40964f1a26ad543f.tar.gz
lighttpd1.4-d6c60ebbff85a466bf94634f40964f1a26ad543f.zip
[TLS] fix return value checks during cert init
openssl interfaces typically return 1 to indicate success, with varying return values to indicate failure (sometimes 0, sometimes 'not 1') (thx mackyle)
Diffstat (limited to 'src/network.c')
-rw-r--r--src/network.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network.c b/src/network.c
index 62c8e836..f5599294 100644
--- a/src/network.c
+++ b/src/network.c
@@ -951,13 +951,13 @@ int network_init(server *srv) {
SSL_CTX_set_verify_depth(s->ssl_ctx, s->ssl_verifyclient_depth);
}
- if (SSL_CTX_use_certificate(s->ssl_ctx, s->ssl_pemfile_x509) < 0) {
+ if (1 != SSL_CTX_use_certificate(s->ssl_ctx, s->ssl_pemfile_x509)) {
log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
ERR_error_string(ERR_get_error(), NULL), s->ssl_pemfile);
return -1;
}
- if (SSL_CTX_use_PrivateKey(s->ssl_ctx, s->ssl_pemfile_pkey) < 0) {
+ if (1 != SSL_CTX_use_PrivateKey(s->ssl_ctx, s->ssl_pemfile_pkey)) {
log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
ERR_error_string(ERR_get_error(), NULL), s->ssl_pemfile);
return -1;