mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
Fixes for better backwards compatibility.
This commit is contained in:
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
typedef struct CryptoCb {
|
typedef struct CryptoCb {
|
||||||
int devId;
|
int devId;
|
||||||
wc_CryptoCallbackFunc cb;
|
CryptoDevCallbackFunc cb;
|
||||||
void* ctx;
|
void* ctx;
|
||||||
} CryptoCb;
|
} CryptoCb;
|
||||||
static CryptoCb gCryptoDev[MAX_CRYPTO_DEVID_CALLBACKS];
|
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 */
|
/* find existing or new */
|
||||||
CryptoCb* dev = wc_CryptoCb_FindDevice(devId);
|
CryptoCb* dev = wc_CryptoCb_FindDevice(devId);
|
||||||
|
@ -172,22 +172,18 @@ typedef struct wc_CryptoInfo {
|
|||||||
#endif
|
#endif
|
||||||
} wc_CryptoInfo;
|
} 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_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);
|
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
|
#ifndef NO_RSA
|
||||||
WOLFSSL_LOCAL int wc_CryptoCb_Rsa(const byte* in, word32 inLen, byte* out,
|
WOLFSSL_LOCAL int wc_CryptoCb_Rsa(const byte* in, word32 inLen, byte* out,
|
||||||
|
Reference in New Issue
Block a user