Skip to content

Resizing/Truncating returned lists #34

@daxpedda

Description

@daxpedda

Pkcs11::get_slots_with_token, Pkcs11::get_all_slots and Pkcs11::get_mechanism_list currently truncate returned lists to account for changed sizes between querying the size and getting the list, a typical race condition.

There are two problems with this currently:

  • Vec::resize is used instead of Vec::truncate for Pkcs11::get_slots_with_token and Pkcs11::get_all_slots
  • Lists can also increase in size, which returns an error, it might be better to put it in a loop until the correct size is established

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersmediumEffort label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions