From f3cca8b1eab758bffbd90f179389a9702082c6a5 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 9 Feb 2019 18:06:33 +0200 Subject: [PATCH] TLS server: Check credentials have been configured before using them Allow ServerHello to be built without local credential configuration. Signed-off-by: Jouni Malinen --- src/tls/tlsv1_server_write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tls/tlsv1_server_write.c b/src/tls/tlsv1_server_write.c index bdc6c1199..892b74573 100644 --- a/src/tls/tlsv1_server_write.c +++ b/src/tls/tlsv1_server_write.c @@ -26,7 +26,7 @@ static size_t tls_server_cert_chain_der_len(struct tlsv1_server *conn) size_t len = 0; struct x509_certificate *cert; - cert = conn->cred->cert; + cert = conn->cred ? conn->cred->cert : NULL; while (cert) { len += 3 + cert->cert_len; if (x509_certificate_self_signed(cert))