Skip to content

OTP slot names with 15 < length <= 30 are truncated without warning #196

@robinkrahl

Description

@robinkrahl

The OTP slot name is sent to the device using the SendOTPData command which can store 30 bytes of data. Yet the firmware only stores the first 15 bytes of the slot name.

For slot names with more than 30 bytes, libnitrokey will raise a TooLongStringException in strcpyT called here. For slot names with more than 15 but less than or exactly 30 bytes, libnitrokey will not raise an error and just send the full data to the device which will then truncate the slot name.

In my opinion, libnitrokey should check the slot name length and raise a TooLongStringException if the slot name is too long.

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