I am running into an Overflow error when parsing CMS messages with content larger than 256MiB in DER format. OpenSSL produces and parses messages of this size without problems, and for my application it's crucial to handle files larger than this limit.
The value of MAX_LENGTHthat results in this overflow is specified here:
|
/// Maximum length as a `u32` (256 MiB). |
|
const MAX_U32: u32 = 0xfff_ffff; |
Some years ago this commit bumped the max size from 1MiB to 256MiB. Mentioning that it would be possible to bump this value again if needed in the future. Since the value is parsed from up to 4 octets I don't see an obvious reason to limit this to less than 4GiB.
Would it be possible to increase this value to at least 1 GiB?
I am running into an
Overflowerror when parsing CMS messages with content larger than 256MiB in DER format. OpenSSL produces and parses messages of this size without problems, and for my application it's crucial to handle files larger than this limit.The value of
MAX_LENGTHthat results in this overflow is specified here:formats/der/src/length.rs
Lines 10 to 11 in 057aa1f
Some years ago this commit bumped the max size from 1MiB to 256MiB. Mentioning that it would be possible to bump this value again if needed in the future. Since the value is parsed from up to 4 octets I don't see an obvious reason to limit this to less than 4GiB.
Would it be possible to increase this value to at least 1 GiB?