DTLS Multicast

1. Allow the MTU size to be changed at compile time for memory
   contrained environments using static memory.
2. Add compile time option to disable the check for DTLS messages
   in the current epoch with an outside-the-window sequence number.
This commit is contained in:
John Safranek 2017-04-25 16:26:29 -07:00
parent 3b5e537f08
commit 1d32409651
2 changed files with 7 additions and 1 deletions

View File

@ -9684,10 +9684,12 @@ static INLINE int DtlsCheckWindow(WOLFSSL* ssl)
WOLFSSL_MSG("Current record sequence number from the past.");
return 0;
}
#ifndef WOLFSSL_DTLS_ALLOW_FUTURE
else if (!curLT && (diff > DTLS_SEQ_BITS)) {
WOLFSSL_MSG("Rejecting message too far into the future.");
return 0;
}
#endif
else if (curLT) {
word32 idx = diff / DTLS_WORD_BITS;
word32 newDiff = diff % DTLS_WORD_BITS;

View File

@ -924,6 +924,10 @@ enum {
#define WOLFSSL_DTLS_PEERSEQ_SZ WOLFSSL_MULTICAST_PEERS
#endif /* WOLFSSL_MULTICAST */
#ifndef WOLFSSL_MAX_MTU
#define WOLFSSL_MAX_MTU 1500
#endif /* WOLFSSL_MAX_MTU */
enum Misc {
@ -970,7 +974,7 @@ enum Misc {
/* RECORD_HEADER_SZ + BLOCK_SZ (pad) + Max
digest sz + BLOC_SZ (iv) + pad byte (1) */
MAX_COMP_EXTRA = 1024, /* max compression extra */
MAX_MTU = 1500, /* max expected MTU */
MAX_MTU = WOLFSSL_MAX_MTU, /* max expected MTU */
MAX_UDP_SIZE = 8192 - 100, /* was MAX_MTU - 100 */
MAX_DH_SZ = 1036, /* 4096 p, pub, g + 2 byte size for each */
MAX_STR_VERSION = 8, /* string rep of protocol version */