diff --git a/src/ocsp.c b/src/ocsp.c index 8cbe95627..7a8014b1a 100644 --- a/src/ocsp.c +++ b/src/ocsp.c @@ -1587,7 +1587,7 @@ int wolfSSL_OCSP_REQ_CTX_set1_req(WOLFSSL_OCSP_REQ_CTX *ctx, OcspRequest *req) static int OCSP_REQ_CTX_bio_cb(char *buf, int sz, void *ctx) { - return BioReceive((WOLFSSL_BIO*)ctx, NULL, buf, sz); + return BioReceiveInternal((WOLFSSL_BIO*)ctx, NULL, buf, sz); } int wolfSSL_OCSP_REQ_CTX_nbio(WOLFSSL_OCSP_REQ_CTX *ctx) diff --git a/src/wolfio.c b/src/wolfio.c index 51c122978..422ea1ff5 100644 --- a/src/wolfio.c +++ b/src/wolfio.c @@ -260,7 +260,18 @@ static int TranslateIoReturnCode(int err, SOCKET_T sd, int direction) #ifdef OPENSSL_EXTRA #ifndef NO_BIO -int BioReceive(WOLFSSL_BIO* biord, WOLFSSL_BIO* biowr, char* buf, int sz) +int BioSend(WOLFSSL* ssl, char *buf, int sz, void *ctx) +{ + return SslBioSend(ssl, buf, sz, ctx); +} + +int BioReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx) +{ + return SslBioReceive(ssl, buf, sz, ctx); +} + +int BioReceiveInternal(WOLFSSL_BIO* biord, WOLFSSL_BIO* biowr, char* buf, + int sz) { int recvd = WOLFSSL_CBIO_ERR_GENERAL; @@ -325,7 +336,7 @@ int SslBioReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx) { WOLFSSL_ENTER("SslBioReceive"); (void)ctx; - return BioReceive(ssl->biord, ssl->biowr, buf, sz); + return BioReceiveInternal(ssl->biord, ssl->biowr, buf, sz); } diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index bb9f2af6d..82751aff9 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -13543,7 +13543,7 @@ static int AddDNSEntryToList(DNS_entry** lst, DNS_entry* entry) /* Allocate a DNS entry and set the fields. * - * @param [in] cert Certificate object. + * @param [in] heap Heap hint. * @param [in] str DNS name string. * @param [in] strLen Length of DNS name string. * @param [in] type Type of DNS name string. diff --git a/wolfssl/openssl/asn1.h b/wolfssl/openssl/asn1.h index 45cc29899..23be85795 100644 --- a/wolfssl/openssl/asn1.h +++ b/wolfssl/openssl/asn1.h @@ -125,17 +125,17 @@ WOLFSSL_API WOLFSSL_ASN1_OBJECT *wolfSSL_c2i_ASN1_OBJECT(WOLFSSL_ASN1_OBJECT **a * we don't use this. Some projects use OpenSSL to implement ASN1 types and * this section is only to provide those projects with ASN1 functionality. */ -typedef void* (*wolfssl_asn1_new)(void); -typedef void (*wolfssl_asn1_free)(void*); -typedef int (*wolfssl_asn1_i2d)(const void*, unsigned char**); -typedef void* (*wolfssl_asn1_d2i)(void**, const byte **, long); +typedef void* (*WolfsslAsn1NewCb)(void); +typedef void (*WolfsslAsn1FreeCb)(void*); +typedef int (*WolfsslAsn1i2dCb)(const void*, unsigned char**); +typedef void* (*WolfsslAsn1d2iCb)(void**, const byte **, long); struct WOLFSSL_ASN1_TEMPLATE { /* Type functions */ - wolfssl_asn1_new new_func; - wolfssl_asn1_free free_func; - wolfssl_asn1_i2d i2d_func; - wolfssl_asn1_d2i d2i_func; + WolfsslAsn1NewCb new_func; + WolfsslAsn1FreeCb free_func; + WolfsslAsn1i2dCb i2d_func; + WolfsslAsn1d2iCb d2i_func; /* Member info */ size_t offset; /* Offset of this field in structure */ /* DER info */ @@ -232,45 +232,45 @@ static WC_MAYBE_UNUSED const byte ASN1_BIT_STRING_FIRST_BYTE = ASN_BIT_STRING; * incorrectly expand the type. Ex: ASN1_INTEGER -> WOLFSSL_ASN1_INTEGER */ #define ASN1_SIMPLE(type, member, member_type) \ - { (wolfssl_asn1_new)member_type##_new, \ - (wolfssl_asn1_free)member_type##_free, \ - (wolfssl_asn1_i2d)i2d_##member_type, \ - (wolfssl_asn1_d2i)d2i_##member_type, \ + { (WolfsslAsn1NewCb)member_type##_new, \ + (WolfsslAsn1FreeCb)member_type##_free, \ + (WolfsslAsn1i2dCb)i2d_##member_type, \ + (WolfsslAsn1d2iCb)d2i_##member_type, \ ASN1_TYPE(type, member, -1, 0, 0, 0) } #define ASN1_IMP(type, member, member_type, tag) \ - { (wolfssl_asn1_new)member_type##_new, \ - (wolfssl_asn1_free)member_type##_free, \ - (wolfssl_asn1_i2d)i2d_##member_type, \ - (wolfssl_asn1_d2i)d2i_##member_type, \ + { (WolfsslAsn1NewCb)member_type##_new, \ + (WolfsslAsn1FreeCb)member_type##_free, \ + (WolfsslAsn1i2dCb)i2d_##member_type, \ + (WolfsslAsn1d2iCb)d2i_##member_type, \ ASN1_TYPE(type, member, tag, member_type##_FIRST_BYTE, 0, 0) } #define ASN1_EXP(type, member, member_type, tag) \ - { (wolfssl_asn1_new)member_type##_new, \ - (wolfssl_asn1_free)member_type##_free, \ - (wolfssl_asn1_i2d)i2d_##member_type, \ - (wolfssl_asn1_d2i)d2i_##member_type, \ + { (WolfsslAsn1NewCb)member_type##_new, \ + (WolfsslAsn1FreeCb)member_type##_free, \ + (WolfsslAsn1i2dCb)i2d_##member_type, \ + (WolfsslAsn1d2iCb)d2i_##member_type, \ ASN1_TYPE(type, member, tag, 0, 1, 0) } #define ASN1_SEQUENCE_OF(type, member, member_type) \ - { (wolfssl_asn1_new)member_type##_new, \ - (wolfssl_asn1_free)member_type##_free, \ - (wolfssl_asn1_i2d)i2d_##member_type, \ - (wolfssl_asn1_d2i)d2i_##member_type, \ + { (WolfsslAsn1NewCb)member_type##_new, \ + (WolfsslAsn1FreeCb)member_type##_free, \ + (WolfsslAsn1i2dCb)i2d_##member_type, \ + (WolfsslAsn1d2iCb)d2i_##member_type, \ ASN1_TYPE(type, member, -1, 0, 0, 1) } #define ASN1_EXP_SEQUENCE_OF(type, member, member_type, tag) \ - { (wolfssl_asn1_new)member_type##_new, \ - (wolfssl_asn1_free)member_type##_free, \ - (wolfssl_asn1_i2d)i2d_##member_type, \ - (wolfssl_asn1_d2i)d2i_##member_type, \ + { (WolfsslAsn1NewCb)member_type##_new, \ + (WolfsslAsn1FreeCb)member_type##_free, \ + (WolfsslAsn1i2dCb)i2d_##member_type, \ + (WolfsslAsn1d2iCb)d2i_##member_type, \ ASN1_TYPE(type, member, tag, 0, 1, 1) } #define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, member_type) \ - { (wolfssl_asn1_new)member_type##_new, \ - (wolfssl_asn1_free)member_type##_free, \ - (wolfssl_asn1_i2d)i2d_##member_type, \ - (wolfssl_asn1_d2i)d2i_##member_type, \ + { (WolfsslAsn1NewCb)member_type##_new, \ + (WolfsslAsn1FreeCb)member_type##_free, \ + (WolfsslAsn1i2dCb)i2d_##member_type, \ + (WolfsslAsn1d2iCb)d2i_##member_type, \ 0, flags & ASN1_TFLG_TAG_MASK ? tag : -1, 0, \ !!(flags & ASN1_TFLG_EXPLICIT), TRUE } diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index e3d06a2eb..a540699e6 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -723,7 +723,6 @@ typedef struct w64wrapper { #define XMEMMOVE(d,s,l) memmove((d),(s),(l)) #define XSTRLEN(s1) strlen((s1)) - #define XSTRCPY(s1,s2) strcpy((s1),(s2)) #define XSTRNCPY(s1,s2,n) strncpy((s1),(s2),(n)) /* strstr, strncmp, strcmp, and strncat only used by wolfSSL proper, * not required for wolfCrypt only */ diff --git a/wolfssl/wolfio.h b/wolfssl/wolfio.h index acadb3a03..5195208a6 100644 --- a/wolfssl/wolfio.h +++ b/wolfssl/wolfio.h @@ -520,11 +520,14 @@ WOLFSSL_API int wolfIO_RecvFrom(SOCKET_T sd, WOLFSSL_BIO_ADDR *addr, char *buf, #endif #endif /* WOLFSSL_NO_SOCK */ +/* Preseve API previously exposed */ +WOLFSSL_API int BioSend(WOLFSSL* ssl, char *buf, int sz, void *ctx); +WOLFSSL_API int BioReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx); -WOLFSSL_API int SslBioSend(WOLFSSL* ssl, char *buf, int sz, void *ctx); -WOLFSSL_API int BioReceive(WOLFSSL_BIO* biord, WOLFSSL_BIO* biowr, char* buf, - int sz); -WOLFSSL_API int SslBioReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx); +WOLFSSL_LOCAL int SslBioSend(WOLFSSL* ssl, char *buf, int sz, void *ctx); +WOLFSSL_LOCAL int BioReceiveInternal(WOLFSSL_BIO* biord, WOLFSSL_BIO* biowr, + char* buf, int sz); +WOLFSSL_LOCAL int SslBioReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx); #if defined(USE_WOLFSSL_IO) /* default IO callbacks */ WOLFSSL_API int EmbedReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx);