diff --git a/cyassl/ctaocrypt/asn_public.h b/cyassl/ctaocrypt/asn_public.h index 8873fcaf2..34c899dc0 100644 --- a/cyassl/ctaocrypt/asn_public.h +++ b/cyassl/ctaocrypt/asn_public.h @@ -75,10 +75,10 @@ enum Ctc_Encoding { #endif enum Ctc_Misc { - CTC_NAME_SIZE = 64, - CTC_DATE_SIZE = 32, - CTC_MAX_ALT_SIZE = 8192, /* may be huge */ - CTC_SERIAL_SIZE = 8 + CTC_NAME_SIZE = 64, + CTC_DATE_SIZE = 32, + CTC_MAX_ALT_SIZE = 16384, /* may be huge */ + CTC_SERIAL_SIZE = 8 }; typedef struct CertName { diff --git a/src/internal.c b/src/internal.c index feff4ae65..451d16f3d 100644 --- a/src/internal.c +++ b/src/internal.c @@ -4111,7 +4111,7 @@ static INLINE int DtlsCheckWindow(DtlsState* state) if ((next > DTLS_SEQ_BITS) && (cur < next - DTLS_SEQ_BITS)) { return 0; } - else if ((cur < next) && (window & (1 << (next - cur - 1)))) { + else if ((cur < next) && (window & ((DtlsSeq)1 << (next - cur - 1)))) { return 0; } @@ -4137,7 +4137,7 @@ static INLINE int DtlsUpdateWindow(DtlsState* state) cur = state->curSeq; if (cur < *next) { - *window |= (1 << (*next - cur - 1)); + *window |= ((DtlsSeq)1 << (*next - cur - 1)); } else { *window <<= (1 + cur - *next); @@ -8689,7 +8689,7 @@ static void PickHashSigAlgo(CYASSL* ssl, if (esSz > MAX_PSK_ID_LEN) return CLIENT_ID_ERROR; - c16toa(esSz, es); + c16toa((word16)esSz, es); es += OPAQUE16_LEN; XMEMCPY(es, ssl->arrays->client_identity, esSz); es += esSz; @@ -11763,7 +11763,7 @@ static void PickHashSigAlgo(CYASSL* ssl, FreeDhKey(&dhKey); *inOutIdx += clientSz; - c16toa(ssl->arrays->preMasterSz, pms); + c16toa((word16)ssl->arrays->preMasterSz, pms); ssl->arrays->preMasterSz += OPAQUE16_LEN; pms += ssl->arrays->preMasterSz;