Skip to content

der: Encode::encode_to_vec overwrites the start of the vector instead of appending to it. #1758

@turbocool3r

Description

@turbocool3r

The documentation for the method is: "Encode this message as ASN.1 DER, appending it to the provided byte vector". The method then creates a SliceWriter that writes to the start of the vector. This creates problems when more than two entities need to be encoded into a vector (e.g. an X.509 certificate chain).

Is this behavior expected? I'll be happy to submit a PR.

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