Skip to content

Commit

Permalink
dtls13: support either side DTLSv1_3 method
Browse files Browse the repository at this point in the history
  • Loading branch information
rizlik committed Sep 24, 2024
1 parent bc68819 commit 5ebdf80
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -15606,6 +15606,26 @@ int TLSX_Parse(WOLFSSL* ssl, const byte* input, word16 length, byte msgType,
return m;
}
#endif /* !WOLFSSL_NO_TLS12 */
#ifdef WOLFSSL_DTLS13
WOLFSSL_METHOD* wolfDTLSv1_3_method(void)
{
return wolfDTLSv1_3_method_ex(NULL);
}
WOLFSSL_METHOD* wolfDTLSv1_3_method_ex(void* heap)
{
WOLFSSL_METHOD* m;
WOLFSSL_ENTER("DTLSv1_3_method");
#ifndef NO_WOLFSSL_CLIENT
m = wolfDTLSv1_3_client_method_ex(heap);
#else
m = wolfDTLSv1_3_server_method_ex(heap);
#endif
if (m != NULL) {
m->side = WOLFSSL_NEITHER_END;
}
return m;
}
#endif /* WOLFSSL_DTLS13 */
#endif /* WOLFSSL_DTLS */
#endif /* OPENSSL_EXTRA || WOLFSSL_EITHER_SIDE */

Expand Down
3 changes: 3 additions & 0 deletions tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,9 @@ static int test_wolfSSL_Method_Allocators(void)
#ifndef WOLFSSL_NO_TLS12
TEST_VALID_METHOD_ALLOCATOR(wolfDTLSv1_2_method);
#endif /* !WOLFSSL_NO_TLS12 */
#ifdef WOLFSSL_DTLS13
TEST_VALID_METHOD_ALLOCATOR(wolfDTLSv1_3_method);
#endif /* WOLFSSL_DTLS13 */
#endif /* WOLFSSL_DTLS */
#endif /* OPENSSL_EXTRA || WOLFSSL_EITHER_SIDE */

Expand Down
4 changes: 4 additions & 0 deletions wolfssl/ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,10 @@ WOLFSSL_API WOLFSSL_METHOD *wolfSSLv23_method(void);
#ifndef NO_WOLFSSL_SERVER
WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_3_server_method_ex(void* heap);
WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_3_server_method(void);
#endif
#ifdef WOLFSSL_EITHER_SIDE
WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_3_method_ex(void* heap);
WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_3_method(void);
#endif
WOLFSSL_API int wolfSSL_dtls13_has_pending_msg(WOLFSSL *ssl);
#endif /* WOLFSSL_DTLS13 */
Expand Down

0 comments on commit 5ebdf80

Please sign in to comment.