From 87840d18e62f904b23cb0f33261b18d1e3b9d454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=3D=3FUTF-8=3Fq=3FChristoph=3D20M=3DC3=3DBCllner=3F=3D?= Date: Sat, 24 Jan 2015 15:55:17 +0100 Subject: [PATCH] Subject: [PATCH] Fix error handling when calling "REQUIRES PRIVATE KEY" callback. A recent patch in ssl.c introduced a callback for setting the private key of the SSL context. This code contained a bug, which resulted in lws_context_init_server_ssl() returning always with a return value of 1, indicating an error. This patch introduces the missing curly braces to fix the code's intended behaviour. --- lib/ssl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ssl.c b/lib/ssl.c index cfee6de7..a6be4fbd 100644 --- a/lib/ssl.c +++ b/lib/ssl.c @@ -208,9 +208,10 @@ lws_context_init_server_ssl(struct lws_context_creation_info *info, else { if (context->protocols[0].callback(context, NULL, LWS_CALLBACK_OPENSSL_CONTEXT_REQUIRES_PRIVATE_KEY, - context->ssl_ctx, NULL, 0)) + context->ssl_ctx, NULL, 0)) { lwsl_err("ssl private key not set\n"); return 1; + } } /* verify private key */