Added SSL_want.

This commit is contained in:
David Garske
2019-08-08 19:37:34 -07:00
parent 2cf26a1353
commit 342d03a294
3 changed files with 14 additions and 0 deletions

View File

@ -2857,6 +2857,18 @@ int wolfSSL_get_alert_history(WOLFSSL* ssl, WOLFSSL_ALERT_HISTORY *h)
return WOLFSSL_SUCCESS;
}
/* returns SSL_WRITING, SSL_READING or SSL_NOTHING */
int wolfSSL_want(WOLFSSL* ssl)
{
int rw_state = SSL_NOTHING;
if (ssl) {
if (ssl->error == WANT_READ)
rw_state = SSL_READING;
else if (ssl->error == WANT_WRITE)
rw_state = SSL_WRITING;
}
return rw_state;
}
/* return TRUE if current error is want read */
int wolfSSL_want_read(WOLFSSL* ssl)

View File

@ -626,6 +626,7 @@ typedef WOLFSSL_ASN1_BIT_STRING ASN1_BIT_STRING;
#define SSL_get_peer_certificate wolfSSL_get_peer_certificate
#define SSL_get_peer_cert_chain wolfSSL_get_peer_cert_chain
#define SSL_want wolfSSL_want
#define SSL_want_read wolfSSL_want_read
#define SSL_want_write wolfSSL_want_write

View File

@ -1625,6 +1625,7 @@ WOLFSSL_API int wolfSSL_CTX_set_session_id_context(WOLFSSL_CTX*,
WOLFSSL_API WOLFSSL_X509* wolfSSL_get_peer_certificate(WOLFSSL* ssl);
WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509)* wolfSSL_get_peer_cert_chain(const WOLFSSL*);
WOLFSSL_API int wolfSSL_want(WOLFSSL*);
WOLFSSL_API int wolfSSL_want_read(WOLFSSL*);
WOLFSSL_API int wolfSSL_want_write(WOLFSSL*);