Address code review

- Use functions instead of accessing `BIO` members
- Add `wolfSSL_BIO_method_type`
This commit is contained in:
Juliusz Sosinowicz
2022-03-02 16:11:07 +01:00
parent a104cf887e
commit c7c3ee00bb
5 changed files with 12 additions and 5 deletions

View File

@@ -134,6 +134,11 @@ static int wolfSSL_BIO_MEMORY_read(WOLFSSL_BIO* bio, void* buf, int len)
return sz;
}
int wolfSSL_BIO_method_type(const WOLFSSL_BIO *b)
{
return b != NULL ? b->type : (int)WOLFSSL_BIO_UNDEF;
}
#ifndef WOLFCRYPT_ONLY
/* Helper function to read from WOLFSSL_BIO_SSL type
*
@@ -1739,8 +1744,6 @@ long wolfSSL_BIO_set_nbio(WOLFSSL_BIO* bio, long on)
return WOLFSSL_SUCCESS;
}
/* creates a new custom WOLFSSL_BIO_METHOD */
WOLFSSL_BIO_METHOD *wolfSSL_BIO_meth_new(int type, const char *name)
{