'Is the named_curve_list max size in RFC 8422 wrong?
In Chapter 5.1.1. of the RFC 8422 ECC Cipher Suites for TLS the NamedCurveList is described as:
struct {
NamedCurve named_curve_list<2..2^16-1>
} NamedCurveList;
And NamedCurve:
enum {
deprecated(1..22),
secp256r1 (23), secp384r1 (24), secp521r1 (25),
x25519(29), x448(30),
reserved (0xFE00..0xFEFF),
deprecated(0xFF01..0xFF02),
(0xFFFF)
} NamedCurve;
From Chapter 4.3 in RFC 5246 it says;
... the length declares the number of bytes, not the number of elements, in the vector.
and also:
The length of an encoded vector must be an even multiple of the length of a single element
And in Chapter 4.5:
An enumerated occupies as much space in the byte stream as would its maximal defined ordinal value.
My understanding is that the NamedCurve occupies two bytes and a list of NamedCurve would always occupy a multiple of two bytes. So why is the upper limit of the named_curve_list written as 2^16-1 which is an odd number?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
