DTLS to use recvfrom and sendto in embed recv and send callbacks. Added support for storing dtls peer address.

This commit is contained in:
John Safranek
2012-10-02 09:15:50 -07:00
parent bd849ea9d7
commit 6d1e485ef4
9 changed files with 255 additions and 20 deletions

View File

@@ -70,8 +70,6 @@ void echoclient_test(void* args)
doDTLS = 1;
#endif
tcp_connect(&sockfd, yasslIP, yasslPort, doDTLS);
#if defined(CYASSL_DTLS)
method = DTLSv1_client_method();
#elif !defined(NO_TLS)
@@ -102,6 +100,16 @@ void echoclient_test(void* args)
#endif
ssl = SSL_new(ctx);
if (doDTLS) {
SOCKADDR_IN_T addr;
build_addr(&addr, yasslIP, yasslPort);
CyaSSL_dtls_set_peer(ssl, &addr, sizeof(addr));
tcp_socket(&sockfd, 1);
}
else {
tcp_connect(&sockfd, yasslIP, yasslPort, 0);
}
SSL_set_fd(ssl, sockfd);
#if defined(USE_WINDOWS_API) && defined(CYASSL_DTLS) && defined(NO_MAIN_DRIVER)
/* let echoserver bind first, TODO: add Windows signal like pthreads does */