From 0da381e01998f7b670d3a68214a96f494cc8c5b2 Mon Sep 17 00:00:00 2001 From: Kaleb Himes Date: Wed, 17 Dec 2014 14:59:19 -0700 Subject: [PATCH] mem.h in wolfcrypt, compatibility layer --- cyassl/ssl.h | 19 ++++++++++++++++--- wolfssl/wolfcrypt/memory.h | 22 +++++++++++----------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/cyassl/ssl.h b/cyassl/ssl.h index 0724dd9e3..c25f580ac 100644 --- a/cyassl/ssl.h +++ b/cyassl/ssl.h @@ -80,7 +80,7 @@ #define CYASSL_X509_OBJECT WOLFSSL_X509_OBJECT #define CYASSL_X509_STORE_CTX WOLFSSL_X509_STORE_CTX -/* ssl.c */ +/* src/ssl.c */ #define CYASSL_CLIENT_END WOLFSSL_CLIENT_END #define CYASSL_CERT_MANAGER WOLFSSL_CERT_MANAGER #define CYASSL_USER_CA WOLFSSL_USER_CA @@ -89,7 +89,17 @@ #define CYASSL_TLSV1_2 WOLFSSL_TLSV1_2 #define CYASSL_SSLV3 WOLFSSL_SSLV3 #define CyaSSL_session_reused wolfSSL_session_reused - +#define CyaSSL_get_version wolfSSL_get_version +#define CyaSSL_get_shutdown wolfSSL_get_shutdown +#define CyaSSL_is_init_finished wolfSSL_is_init_finished +#define CyaSSL_CTX_UnloadCAs wolfSSL_CTX_UnloadCAs +#define CyaSSL_UnloadCertsKeys wolfSSL_UnloadCertsKeys +#define CyaSSL_SetServerID wolfSSL_SetServerID +#define CyaSSL_SetCertCbCtx wolfSSL_SetCertCbCtx +#define CyaSSL_CTX_check_private_key wolfSSL_CTX_check_private_key +#define CyaSSL_get_current_cipher_suite wolfSSL_get_current_cipher_suite +#define CyaSSL_get_cipher wolfSSL_get_cipher +#define CyaSSL_CIPHER_get_name wolfSSL_CIPHER_get_name /* io.c */ #define CYASSL_CBIO_ERR_CONN_CLOSE WOLFSSL_CBIO_ERR_CONN_CLOSE @@ -101,9 +111,12 @@ #define CYASSL_CBIO_ERR_WANT_WRITE WOLFSSL_CBIO_ERR_WANT_WRITE #define CYASSL_CBIO_ERR_TIMEOUT WOLFSSL_CBIO_ERR_TIMEOUT -/* tls.c */ +/* src/tls.c */ #define CYASSL_SERVER_END WOLFSSL_SERVER_END #define CYASSL_TLS_HMAC_INNER_SZ WOLFSSL_TLS_HMAC_INNER_SZ +#define CyaSSL_make_eap_keys wolfSSL_make_eap_keys +#define CyaSSL_MakeTlsMasterSecret wolfSSL_MakeTlsMasterSecret +#define CyaSSL_DeriveTlsKeys wolfSSL_DeriveTlsKeys /* internal.c */ #define CyaSSL_ERR_reason_error_string wolfSSL_ERR_reason_error_string diff --git a/wolfssl/wolfcrypt/memory.h b/wolfssl/wolfcrypt/memory.h index 20e98a392..c2fdca735 100644 --- a/wolfssl/wolfcrypt/memory.h +++ b/wolfssl/wolfcrypt/memory.h @@ -22,8 +22,8 @@ /* submitted by eof */ -#ifndef CYASSL_MEMORY_H -#define CYASSL_MEMORY_H +#ifndef WOLFSSL_MEMORY_H +#define WOLFSSL_MEMORY_H #include @@ -32,20 +32,20 @@ #endif -typedef void *(*CyaSSL_Malloc_cb)(size_t size); -typedef void (*CyaSSL_Free_cb)(void *ptr); -typedef void *(*CyaSSL_Realloc_cb)(void *ptr, size_t size); +typedef void *(*wolfSSL_Malloc_cb)(size_t size); +typedef void (*wolfSSL_Free_cb)(void *ptr); +typedef void *(*wolfSSL_Realloc_cb)(void *ptr, size_t size); /* Public set function */ -CYASSL_API int CyaSSL_SetAllocators(CyaSSL_Malloc_cb malloc_function, - CyaSSL_Free_cb free_function, - CyaSSL_Realloc_cb realloc_function); +WOLFSSL_API int CyaSSL_SetAllocators(wolfSSL_Malloc_cb malloc_function, + wolfSSL_Free_cb free_function, + wolfSSL_Realloc_cb realloc_function); /* Public in case user app wants to use XMALLOC/XFREE */ -CYASSL_API void* CyaSSL_Malloc(size_t size); -CYASSL_API void CyaSSL_Free(void *ptr); -CYASSL_API void* CyaSSL_Realloc(void *ptr, size_t size); +WOLFSSL_API void* wolfSSL_Malloc(size_t size); +WOLFSSL_API void wolfSSL_Free(void *ptr); +WOLFSSL_API void* wolfSSL_Realloc(void *ptr, size_t size); #ifdef __cplusplus