From caa3af47c0242ebe7da1bb5bb2be13ef893fab8f Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Thu, 26 Sep 2013 13:32:43 +0200
Subject: [PATCH] Handle missing curve extension correctly in
ssl_parse_client_hello()
---
library/ssl_srv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/library/ssl_srv.c b/library/ssl_srv.c
index 960906bd1..15d14fa88 100644
--- a/library/ssl_srv.c
+++ b/library/ssl_srv.c
@@ -1389,7 +1389,8 @@ static int ssl_parse_client_hello( ssl_context *ssl )
#if defined(POLARSSL_ECDH_C) || defined(POLARSSL_ECDSA_C)
if( ssl_ciphersuite_uses_ec( ciphersuite_info ) &&
- ssl->handshake->curves[0] == NULL )
+ ( ssl->handshake->curves == NULL ||
+ ssl->handshake->curves[0] == NULL ) )
continue;
#endif