From 936d0ff7a96bac9905e778cb2f753c72ee292562 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 24 Oct 2012 11:05:50 -0700 Subject: [PATCH] fixed off-by-one dtls cookie size check. fixed some warnings when disabling features --- src/internal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index 779df590a..26bc3ab16 100644 --- a/src/internal.c +++ b/src/internal.c @@ -473,6 +473,7 @@ void InitCiphers(CYASSL* ssl) /* Free ciphers */ void FreeCiphers(CYASSL* ssl) { + (void)ssl; #ifdef BUILD_ARC4 XFREE(ssl->encrypt.arc4, ssl->heap, DYNAMIC_TYPE_CIPHER); XFREE(ssl->decrypt.arc4, ssl->heap, DYNAMIC_TYPE_CIPHER); @@ -522,6 +523,7 @@ void InitSuites(Suites* suites, ProtocolVersion pv, byte haveDH, byte havePSK, int haveRSAsig = 1; (void)tls; /* shut up compiler */ + (void)tls1_2; (void)haveDH; (void)havePSK; (void)haveNTRU; @@ -5218,7 +5220,7 @@ int SetCipherList(Suites* s, const char* list) if (cookieSz) { #ifdef CYASSL_DTLS - if (cookieSz < MAX_COOKIE_LEN) { + if (cookieSz <= MAX_COOKIE_LEN) { XMEMCPY(ssl->arrays->cookie, input + *inOutIdx, cookieSz); ssl->arrays->cookieSz = cookieSz; }