From 8b52330877a25f2b16a3c53dc5e64cfdb3cd5918 Mon Sep 17 00:00:00 2001 From: toddouska Date: Mon, 18 May 2015 09:48:15 -0700 Subject: [PATCH] add key name compare for session ticket callback example --- wolfssl/test.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wolfssl/test.h b/wolfssl/test.h index 9879735e8..31d90f12b 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -1905,6 +1905,13 @@ static INLINE const char* mymktemp(char *tempfn, int len, int num) *outLen = inLen; /* no padding in this mode */ } else { /* decrypt */ + + /* see if we know this key */ + if (XMEMCMP(key_name, myKey_ctx.name, WOLFSSL_TICKET_NAME_SZ) != 0){ + printf("client presented unknown ticket key name "); + return WOLFSSL_TICKET_RET_FATAL; + } + /* build aad from key name, iv, and length */ XMEMCPY(tmp, key_name, WOLFSSL_TICKET_NAME_SZ); tmp += WOLFSSL_TICKET_NAME_SZ;