Skip to content

Conversation

@mjdemilliano
Copy link
Contributor

The definitions for the following functions are not always available when wolfSSL is configured to only contain a minimum of functionality:

  • wc_GetPkcs8TraditionalOffset (only with ASN, which is required for RSA)
  • wc_PemToDer (only when KEYGEN is enabled)
  • wc_DerToPemEx (only when KEYGEN is enabled)

This change allows for building the Python wrapper when ASN and RSA are both disabled.

The definitions for the following functions are not always available
when wolfSSL is configured to only contain a minimum of functionality:
- wc_GetPkcs8TraditionalOffset (only with ASN, which is required for
      RSA)
- wc_PemToDer (only when KEYGEN is enabled)
- wc_DerToPemEx (only when KEYGEN is enabled)

This change allows for building the Python wrapper when ASN and RSA
are both disabled.
int wc_InitRsaKey(RsaKey* key, void*);
int wc_FreeRsaKey(RsaKey* key);
int wc_GetPkcs8TraditionalOffset(byte* input, word32* inOutIdx, word32 sz);
Copy link
Contributor

Choose a reason for hiding this comment

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

This should depend on the ASN feature, instead of the RSA feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right. I put it here because it wasn’t actually exposed in asn.py, it was just needed for the RSA part in ciphers.py. I now made it separate so that it is included if either the ASN feature is selected (in which case there is not yet any binding for it in asn.py but that is not in scope of this pull request), or the RSA feature (which needs this function).

Copy link
Contributor

@lealem47 lealem47 left a comment

Choose a reason for hiding this comment

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

Just the one comment, the rest of the changes look good

@lealem47 lealem47 assigned mjdemilliano and unassigned wolfSSL-Bot Dec 3, 2025
It's part of the ASN feature but since it's also used by the RSA
binding this function must also be part of the library when only
the RSA feature is selected.
These functions are actually not tied to the KEYGEN feature.
@mjdemilliano
Copy link
Contributor Author

Testing the various combinations is a little tricky because it isn’t automated. I moved the two keygen functions to the ASN feature because in asn.c they do not seem to depend on the keygen configuration option.

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