Skip to content

Commit 1744c11

Browse files
authored
Merge pull request #9570 from kareem-wolfssl/variousFixes
Add SSL_get_rfd and SSL_get_wfd. Various documentation updates.
2 parents 48d6811 + fe45b74 commit 1744c11

File tree

4 files changed

+56
-1
lines changed

4 files changed

+56
-1
lines changed

doc/dox_comments/header_files/coding.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ int Base64_Decode(const byte* in, word32 inLen, byte* out,
4646
traditional ‘\n’ line endings, instead of escaped %0A line endings. Upon
4747
successfully completing, this function also sets outLen to the number
4848
of bytes written to the output buffer.
49+
If there is enough room in out to store an extra byte, a NULL terminator
50+
will be added. This will NOT be included in outLen.
4951
5052
\return 0 Returned upon successfully decoding the Base64 encoded input
5153
\return BAD_FUNC_ARG Returned if the output buffer is too small to
@@ -203,6 +205,8 @@ int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen);
203205
\ingroup Base_Encoding
204206
205207
\brief Encode input to base16 output.
208+
If there is enough room in out to store an extra byte, a NULL terminator
209+
will be added and included in outLen.
206210
207211
\return 0 Success
208212
\return BAD_FUNC_ARG Returns if in, out, or outLen is null or if outLen is

doc/dox_comments/header_files/ssl.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,6 +1742,7 @@ int wolfSSL_CTX_der_load_verify_locations(WOLFSSL_CTX* ctx,
17421742
\param method pointer to the desired WOLFSSL_METHOD to use for the SSL
17431743
context. This is created using one of the wolfSSLvXX_XXXX_method()
17441744
functions to specify SSL/TLS/DTLS protocol level.
1745+
This function frees the passed in WOLFSSL_METHOD struct on failure.
17451746
17461747
_Example_
17471748
\code
@@ -15935,3 +15936,51 @@ WOLFSSL_CIPHERSUITE_INFO wolfSSL_get_ciphersuite_info(byte first,
1593515936
*/
1593615937
int wolfSSL_get_sigalg_info(byte first, byte second,
1593715938
int* hashAlgo, int* sigAlgo);
15939+
15940+
/*!
15941+
\brief This function will set the password callback in the provided CTX.
15942+
This callback is used when loading an encrypted cert or key which requires
15943+
a password.
15944+
15945+
\param ctx a pointer to a WOLFSSL_CTX structure, created with
15946+
wolfSSL_CTX_new().
15947+
\param cb a function pointer to (*wc_pem_password_cb) that is set to the
15948+
passwd_cb member of the WOLFSSL_CTX.
15949+
15950+
_Example_
15951+
\code
15952+
WOLFSSL_CTX* ctx = wolfSSL_CTX_new( protocol method );
15953+
int PasswordCallBack(char* passwd, int sz, int rw, void* userdata) {
15954+
15955+
}
15956+
15957+
wolfSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
15958+
\endcode
15959+
15960+
\sa wolfSSL_CTX_set_default_passwd_cb_userdata
15961+
*/
15962+
void wolfSSL_CTX_set_default_passwd_cb(WOLFSSL_CTX* ctx,
15963+
wc_pem_password_cb* cb);
15964+
15965+
/*!
15966+
\brief This function will set the userdata argument to the passwd_userdata
15967+
member of the WOLFSSL_CTX structure.
15968+
This member is passed into the CTX's password callback when called.
15969+
15970+
\param ctx a pointer to a WOLFSSL_CTX structure, created with
15971+
wolfSSL_CTX_new().
15972+
\param userdata a pointer to userdata which is passed into the
15973+
password callback.
15974+
15975+
_Example_
15976+
\code
15977+
WOLFSSL_CTX* ctx = wolfSSL_CTX_new( protocol method );
15978+
int data;
15979+
15980+
wolfSSL_CTX_set_default_passwd_cb_userdata(ctx, (void*)&data);
15981+
\endcode
15982+
15983+
\sa wolfSSL_CTX_set_default_passwd_cb
15984+
*/
15985+
void wolfSSL_CTX_set_default_passwd_cb_userdata(WOLFSSL_CTX* ctx,
15986+
void* userdata);

src/internal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26979,7 +26979,7 @@ const char* wolfSSL_ERR_reason_error_string(unsigned long e)
2697926979
return "Certificate context does not match request or not empty";
2698026980

2698126981
case BAD_KEY_SHARE_DATA:
26982-
return "The Key Share data contains group that wasn't in Client Hello";
26982+
return "The Key Share data contains a group which is invalid";
2698326983

2698426984
case MISSING_HANDSHAKE_DATA:
2698526985
return "The handshake message is missing required data";

wolfssl/openssl/ssl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
346346
#define SSL_new wolfSSL_new
347347
#define SSL_set_fd wolfSSL_set_fd
348348
#define SSL_get_fd wolfSSL_get_fd
349+
#define SSL_get_rfd wolfSSL_get_fd
350+
#define SSL_get_wfd wolfSSL_get_wfd
349351
#define SSL_connect wolfSSL_connect
350352
#define SSL_clear wolfSSL_clear
351353
#define SSL_state wolfSSL_state

0 commit comments

Comments
 (0)