Skip to content
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

Make RsaPad/UnPad available when -DWOLFSSL_PUBLIC_MP set #7366

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kaleb-himes
Copy link
Contributor

Description

Customer requested this change, being tracked under OE addition effort and was scheduled to go into master as part of OE check-in. However, FIPS cert is taking longer than anticipated, OE work is feature complete but only gets checked-in when approved by CSTL review. The customer is eager to see this in the next release.

Testing

N/A

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@@ -434,11 +434,11 @@ WOLFSSL_API int wc_RsaExportKey(RsaKey* key,
int nlen, int* isPrime);
#endif

WOLFSSL_LOCAL int wc_RsaPad_ex(const byte* input, word32 inputLen, byte* pkcsBlock,
MP_API int wc_RsaPad_ex(const byte* input, word32 inputLen, byte* pkcsBlock,
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought MP was for multi precision and related to the math library API's. Why was MP_API chosen here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MP_API allows this function to be public (non-opaque / WOLFSSL_API) when -DWOLFSSL_PUBLIC_MP is defined. Otherwise MP_API defaults to opaque (WOLFSSL_LOCAL). MP_API was selected as the "configurable" visibility option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From wolfmath.h:

 36 #ifdef WOLFSSL_PUBLIC_MP                                                         
 37     #define MP_API   WOLFSSL_API                                                 
 38 #else                                                                            
 39     #define MP_API   WOLFSSL_LOCAL                                               
 40 #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.

Following an internal discussion we will instead make a brand new public accessor function instead of making the opaqueness of the API configurable.

@@ -434,11 +434,11 @@ WOLFSSL_API int wc_RsaExportKey(RsaKey* key,
int nlen, int* isPrime);
#endif

WOLFSSL_LOCAL int wc_RsaPad_ex(const byte* input, word32 inputLen, byte* pkcsBlock,
MP_API int wc_RsaPad_ex(const byte* input, word32 inputLen, byte* pkcsBlock,
Copy link
Contributor

Choose a reason for hiding this comment

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

My preference would be to make these public all the time going forward.

@dgarske dgarske removed the request for review from wolfSSL-Bot May 16, 2024 16:50
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.

None yet

4 participants