Skip to content

Move X.509 OIDs out of crypto #252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: development
Choose a base branch
from

Conversation

gilles-peskine-arm
Copy link
Contributor

Move the definitions of OIDs that are only needed X.509 out of oid.c and oid.h out of TF-PSA-Crypto, and into the X.509 library in Mbed TLS.

Note: this pull request does not work against the head of Mbed TLS. After it is merged, TF-PSA-Crypto can only be consumed by an Mbed TLS where Mbed-TLS/mbedtls#10125 is merged. As a consequence, the TF-PSA-Crypto CI will fail. Arranging for a compatibility period would be doable, but quite a bit of extra work.

PR checklist

  • changelog not required because: internal interfaces only (oid.h isn't yet officially a private interface, but it will be)
  • development PR Move X.509 OIDs from crypto mbedtls#10125
  • TF-PSA-Crypto PR here
  • framework PR not required
  • 3.6 PR not required because: product split
  • tests provided | not required because:

Move the corresponding declarations from tf-psa-crypto/include/mbedtls/oid.h
to library/x509_internal.h.

Signed-off-by: Gilles Peskine <[email protected]>
OID_INFO_STRINGS is always disabled when oid_definition_helpers.h is
consumed inside TF-PSA-Crypto. In Mbed TLS, it is enabled when X.509 wants
text information.

Signed-off-by: Gilles Peskine <[email protected]>
Crypto never associates strings to OIDs.

Signed-off-by: Gilles Peskine <[email protected]>
@gilles-peskine-arm gilles-peskine-arm added size-s Estimated task size: small (~2d) priority-high High priority - will be reviewed soon labels Apr 9, 2025
@@ -470,39 +443,6 @@
extern "C" {
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A note for potential future improvements: the functions declared here are only used inside TF-PSA-Crypto, except mbedtls_oid_get_md_alg() which is also used in X.509 and PKCS7 in Mbed TLS.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually mbedtls_oid_get_md_alg() is not used in crypto! It's only called from test_suite_md which validates the OID associated with each hash algorithm. So mbedtls_oid_get_md_alg() should move to X.509 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-high High priority - will be reviewed soon size-s Estimated task size: small (~2d)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant