Fixes for better backwards compatibility.

This commit is contained in:
David Garske
2019-01-18 06:54:48 -08:00
parent ee45cfdbcb
commit 357e0c9d15
2 changed files with 8 additions and 12 deletions

View File

@ -41,7 +41,7 @@
typedef struct CryptoCb {
int devId;
wc_CryptoCallbackFunc cb;
CryptoDevCallbackFunc cb;
void* ctx;
} CryptoCb;
static CryptoCb gCryptoDev[MAX_CRYPTO_DEVID_CALLBACKS];
@ -64,7 +64,7 @@ void wc_CryptoCb_Init(void)
}
}
int wc_CryptoCb_RegisterDevice(int devId, wc_CryptoCallbackFunc cb, void* ctx)
int wc_CryptoCb_RegisterDevice(int devId, CryptoDevCallbackFunc cb, void* ctx)
{
/* find existing or new */
CryptoCb* dev = wc_CryptoCb_FindDevice(devId);

View File

@ -172,22 +172,18 @@ typedef struct wc_CryptoInfo {
#endif
} wc_CryptoInfo;
/* old naming */
#ifdef WOLF_CRYPTO_DEV
/* old callback function name */
typedef int (*CryptoDevCallbackFunc)(int devId, wc_CryptoInfo* info, void* ctx);
/* old function names */
#define wc_CryptoDev_RegisterDevice wc_CryptoCb_RegisterDevice
#define wc_CryptoDev_UnRegisterDevice wc_CryptoCb_UnRegisterDevice
#endif
typedef int (*wc_CryptoCallbackFunc)(int devId, wc_CryptoInfo* info, void* ctx);
typedef int (*CryptoDevCallbackFunc)(int devId, wc_CryptoInfo* info, void* ctx);
WOLFSSL_LOCAL void wc_CryptoCb_Init(void);
WOLFSSL_API int wc_CryptoCb_RegisterDevice(int devId, wc_CryptoCallbackFunc cb, void* ctx);
WOLFSSL_API int wc_CryptoCb_RegisterDevice(int devId, CryptoDevCallbackFunc cb, void* ctx);
WOLFSSL_API void wc_CryptoCb_UnRegisterDevice(int devId);
/* old function names */
#define wc_CryptoDev_RegisterDevice wc_CryptoCb_RegisterDevice
#define wc_CryptoDev_UnRegisterDevice wc_CryptoCb_UnRegisterDevice
#ifndef NO_RSA
WOLFSSL_LOCAL int wc_CryptoCb_Rsa(const byte* in, word32 inLen, byte* out,