File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27526,6 +27526,9 @@ const char* wolfSSL_ERR_reason_error_string(unsigned long e)
2752627526
2752727527 case WOLFSSL_EVP_R_PRIVATE_KEY_DECODE_ERROR:
2752827528 return "Private key decode error (EVP)";
27529+
27530+ case SESSION_TICKET_NONCE_OVERFLOW:
27531+ return "Session ticket nonce overflow";
2752927532 }
2753027533
2753127534 return "unknown error number";
Original file line number Diff line number Diff line change @@ -12123,6 +12123,13 @@ static int SendTls13NewSessionTicket(WOLFSSL* ssl)
1212312123 if (ssl->error != WC_NO_ERR_TRACE(WC_PENDING_E))
1212412124 #endif
1212512125 {
12126+ if (ssl->session->ticketNonce.data[0] == 255) {
12127+ /* RFC8446 §4.6.1: Each ticket must have a unique nonce value.
12128+ * As the nonce is only a single byte, we have to prevent
12129+ * the overflow and abort. */
12130+ return SESSION_TICKET_NONCE_OVERFLOW;
12131+ }
12132+ else
1212612133 ssl->session->ticketNonce.data[0]++;
1212712134 }
1212812135
Original file line number Diff line number Diff line change @@ -238,7 +238,9 @@ enum wolfSSL_ErrorCodes {
238238 CRYPTO_POLICY_FORBIDDEN = -516 , /* operation forbidden by system
239239 * crypto-policy */
240240
241- WOLFSSL_LAST_E = -516
241+ SESSION_TICKET_NONCE_OVERFLOW = -517 , /* Session ticket nonce overflow */
242+
243+ WOLFSSL_LAST_E = -517 ,
242244
243245 /* codes -1000 to -1999 are reserved for wolfCrypt. */
244246};
You can’t perform that action at this time.
0 commit comments