Skip to content

der: request to increase MAX_LENGTH for DER Length #1613

Closed
@ramenguy99

Description

@ramenguy99

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions