From f874bf9b760ff23943ae7c29d561aeaa39e9ec7a Mon Sep 17 00:00:00 2001 From: Todd A Ouska Date: Fri, 11 Mar 2011 14:10:32 -0800 Subject: [PATCH] mix MTU defines and DTLS version info --- include/cyassl_int.h | 2 +- src/cyassl_int.c | 2 +- src/ssl.c | 12 +++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/cyassl_int.h b/include/cyassl_int.h index 62c5d2a87..c70ab970c 100644 --- a/include/cyassl_int.h +++ b/include/cyassl_int.h @@ -499,7 +499,7 @@ enum { #define RECORD_SIZE MAX_RECORD_SIZE #else #ifdef CYASSL_DTLS - #define RECORD_SIZE 1500 + #define RECORD_SIZE MAX_MTU #else #define RECORD_SIZE 128 #endif diff --git a/src/cyassl_int.c b/src/cyassl_int.c index cde43f9d7..6f1c56c2d 100644 --- a/src/cyassl_int.c +++ b/src/cyassl_int.c @@ -1928,7 +1928,7 @@ static int GetInputData(SSL *ssl, size_t size) #ifdef CYASSL_DTLS if (ssl->options.dtls) - inSz = 1500; /* read ahead up to MTU */ + inSz = MAX_MTU; /* read ahead up to MTU */ #endif if (inSz > maxLength) { diff --git a/src/ssl.c b/src/ssl.c index 1312dcb51..02c3fc62d 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -2718,18 +2718,20 @@ int CyaSSL_set_compression(SSL* ssl) const char* SSL_get_version(SSL* ssl) { - if (ssl->version.major == 3) { + if (ssl->version.major == SSLv3_MAJOR) { switch (ssl->version.minor) { - case 0 : + case SSLv3_MINOR : return "SSLv3"; - case 1 : + case TLSv1_MINOR : return "TLSv1"; - case 2 : + case TLSv1_1_MINOR : return "TLSv1.1"; - case 3 : + case TLSv1_2_MINOR : return "TLSv1.2"; } } + else if (ssl->version.major == DTLS_MAJOR) + return "DTLS"; return "unknown"; }