Skip to content

Add TF-PSA-Crypto public key parsing and mbedtls_pk_get_bitlen - #57

Open
padelsbach wants to merge 1 commit into
wolfSSL:masterfrom
padelsbach:pk-public
Open

padelsbach wants to merge 1 commit into
wolfSSL:masterfrom
padelsbach:pk-public

Conversation

@padelsbach

@padelsbach padelsbach commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Adds mbedtls_pk_parse_public_key, mbedtls_pk_parse_public_keyfile and mbedtls_pk_get_bitlen to the TF-PSA-Crypto pk.h API.

Copilot AI balanced review requested due to automatic review settings November 17, 2026 03:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The EC public-key policy incorrectly matches hashless ECDSA against the ANY_HASH wildcard, reporting VERIFY_HASH support for an algorithm outside the advertised policy.

1 open issue
What changed in this PR

Extends wolfPSA’s TF-PSA-Crypto compatibility layer with public-key parsing and key bit-length reporting.

Changes:

  • Adds public-key parsing from PEM/DER buffers and files for RSA, EC, X25519, and X448.
  • Tracks key sizes and expands capability checks for public-key operations.
  • Adds compatibility tests and documents supported formats and limitations.
File Description
wolfpsa/​mbedtls/​pk.h Adds public-key storage, key size, and API declarations.
test/​mbedtls_compat/​pk_test.c Tests public-key parsing, bit lengths, capabilities, and invalid inputs.
src/​psa_tf_psa.c Implements parsing, size reporting, cleanup, and capability policies.
README.md Documents the expanded key-parsing support.
.gitignore Ignores root build-* directories except build-test.

Review effort: Balanced

Comment thread src/psa_tf_psa.c Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants