Add API visibility prefixes to wolfPKCS11 headers#102
Conversation
- Add WP11_LOCAL prefix to all function declarations in wolfpkcs11/internal.h - Add WP11_LOCAL prefix to all function declarations in wolfpkcs11/store.h - Add WP11_API prefix to all API declarations in wolfpkcs11/pkcs11.h This ensures proper symbol visibility control for the wolfPKCS11 library, marking internal functions as library-internal and API functions as publicly exported. Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Remove duplicate wolfPKCS11_Debugging_On/Off declarations from internal.h to resolve visibility conflict. These functions are already properly declared with WP11_API visibility in pkcs11.h as public API functions. Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>
Move wolfPKCS11_Debugging_On/Off declarations outside of DEBUG_WOLFPKCS11 conditional block so they are always declared in the public API. The implementations in src/internal.c already provide empty definitions when debugging is disabled, ensuring proper linking regardless of debug configuration. Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>
|
Why Is this necessary? |
|
@SparkiDev Thank you for the question! You're absolutely right that PKCS#11 functions are typically accessed through the function table via Why
|
Add API visibility prefixes to wolfPKCS11 headers
Summary
This PR adds proper API visibility prefixes to function declarations in the wolfPKCS11 library headers to ensure correct symbol visibility control.
Changes Made
wolfpkcs11/internal.h
WP11_LOCALprefix to all internal function declarations (~100+ functions)wolfPKCS11_Debugging_On/Offwolfpkcs11/store.h
WP11_LOCALprefix to all storage interface function declarations (5 functions)wolfPKCS11_Store_Open,wolfPKCS11_Store_OpenSz,wolfPKCS11_Store_Close,wolfPKCS11_Store_Read,wolfPKCS11_Store_Writewolfpkcs11/pkcs11.h
WP11_APIprefix to all PKCS#11 API function declarations (~60+ functions)C_Initialize,C_Finalize,C_GetSlotList,C_CreateObject,C_Encrypt,C_Sign, etc.C_GetFunctionListand debug functions already hadWP11_APIprefixTechnical Details
WP11_LOCALmarks functions as library-internalWP11_APImarks functions as publicly exportedTesting
The changes are purely additive visibility annotations and do not modify function signatures or behavior. All existing functionality remains unchanged.
Link to Devin run: https://app.devin.ai/sessions/e21eeb0adc8c4a59ab47cc18a07e30f6
Requested by: andrew@wolfssl.com