net/tls: fix mutex bug with cookie context
authorJunyeon LEE <junyeon2.lee@samsung.com>
Tue, 11 Apr 2017 01:46:13 +0000 (10:46 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Tue, 18 Apr 2017 03:02:16 +0000 (12:02 +0900)
Uninitialized mutex context has possible to make data abort and
fixes it with this commit. Excepts this patch, ssl context can't
get a mutex.

Change-Id: I942e8bf8e971206eeb58e5d68e3ec9458270f614
Signed-off-by: Junyeon LEE <junyeon2.lee@samsung.com>
os/net/tls/ssl_cookie.c

index a9d10ce..501cbe5 100644 (file)
@@ -98,6 +98,8 @@ static void mbedtls_zeroize(void *v, size_t n)
 
 void mbedtls_ssl_cookie_init(mbedtls_ssl_cookie_ctx *ctx)
 {
+       mbedtls_zeroize(&ctx->mutex, sizeof(mbedtls_threading_mutex_t));
+
        mbedtls_md_init(&ctx->hmac_ctx);
 #if !defined(MBEDTLS_HAVE_TIME)
        ctx->serial = 0;