Skip to content

Improve validity checks on EC_POINT data when returning from PKCS#11 provider #601

Open
@paulhowardarm

Description

@paulhowardarm

Summary

In this PR we made Parsec less strict about the PKCS#11 spec when returning the public portion of elliptic curve keys. This was to resolve an interoperability issue with a PKCS#11 library that was not precisely following the spec. In the code review, we discussed adding some additional validity checks to make sure that the data being returned is in fact a valid EC public key and not garbage.

Detail

Probably the most sensible approach is to refactor the existing handle_ecc_public_import_attrib() function, which already contains some of the checks that we need. The checks themselves could be factored out into a validate_ecc_public_key_data() method (or some other suitable name). As inputs, this function would take the key data and the key size (in bits). This function can then be used in common both when importing and exporting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    code healthIssues concerning overall code quality, safety and best practiceplatformsCompatibility with different secure services or hardware platforms

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions