From 5a21cec030045b8b88d9d290b3ad99fe59974d02 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Mon, 11 Nov 2019 10:12:20 -0800 Subject: [PATCH] wolfSSL ABI Add ABI tags to the functions wolfSSL_Cleanup() to match wolfSSL_Init(), wolfSSL_X509_free to match wolfSSL_load_certificate_file() which allocates memory. --- src/ssl.c | 2 ++ wolfssl/ssl.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index 9ec0bb0f3..68790bd90 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -11760,6 +11760,7 @@ int wolfSSL_SetHsDoneCb(WOLFSSL* ssl, HandShakeDoneCb cb, void* user_ctx) #endif /* NO_HANDSHAKE_DONE_CB */ +WOLFSSL_ABI int wolfSSL_Cleanup(void) { int ret = WOLFSSL_SUCCESS; @@ -17685,6 +17686,7 @@ static void ExternalFreeX509(WOLFSSL_X509* x509) } /* Frees an external WOLFSSL_X509 structure */ +WOLFSSL_ABI void wolfSSL_X509_free(WOLFSSL_X509* x509) { WOLFSSL_ENTER("wolfSSL_FreeX509"); diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index e19ca3a54..449140d04 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -1968,7 +1968,7 @@ WOLFSSL_ABI WOLFSSL_API int wolfSSL_check_domain_name(WOLFSSL*, const char*); /* need to call once to load library (session cache) */ WOLFSSL_ABI WOLFSSL_API int wolfSSL_Init(void); /* call when done to cleanup/free session cache mutex / resources */ -WOLFSSL_API int wolfSSL_Cleanup(void); +WOLFSSL_ABI WOLFSSL_API int wolfSSL_Cleanup(void); /* which library version do we have */ WOLFSSL_API const char* wolfSSL_lib_version(void); @@ -2002,7 +2002,7 @@ WOLFSSL_API unsigned char* wolfSSL_get_chain_cert(WOLFSSL_X509_CHAIN*, int idx); WOLFSSL_API WOLFSSL_X509* wolfSSL_get_chain_X509(WOLFSSL_X509_CHAIN*, int idx); /* free X509 */ #define wolfSSL_FreeX509(x509) wolfSSL_X509_free((x509)) -WOLFSSL_API void wolfSSL_X509_free(WOLFSSL_X509*); +WOLFSSL_ABI WOLFSSL_API void wolfSSL_X509_free(WOLFSSL_X509*); /* get index cert in PEM */ WOLFSSL_API int wolfSSL_get_chain_cert_pem(WOLFSSL_X509_CHAIN*, int idx, unsigned char* buf, int inLen, int* outLen);