replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / extlibs / mbedtls / mbedtls / library / ssl_cli.c
index 945c973..c52ee17 100644 (file)
@@ -1981,7 +1981,7 @@ static int ssl_parse_server_psk_hint( mbedtls_ssl_context *ssl,
                                       unsigned char **p,
                                       unsigned char *end )
 {
-    int ret = 0;
+        int ret = 0;
     size_t n;
 
     if( ssl->conf->f_psk == NULL &&
@@ -2004,11 +2004,6 @@ static int ssl_parse_server_psk_hint( mbedtls_ssl_context *ssl,
     n = ( (*p)[0] << 8 ) | (*p)[1];
     *p += 2;
 
-    if (n == 0)
-    {
-        return ( 0 );
-    }
-
     if( n < 1 || n > 65535 || *p + n > end )
     {
         MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad server key exchange message" ) );
@@ -2432,7 +2427,10 @@ static int ssl_parse_server_key_exchange( mbedtls_ssl_context *ssl )
 
 // Anonim cipher suite without sign, ecdh param only
 #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ANON_ENABLED)
-        goto exit;
+        if( ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_ECDH_ANON )
+        {
+            goto exit;
+        }
 #endif
         /*
          * Read signature