- Added function for stringified SSL/TLS version

This commit is contained in:
Paul Bakker 2011-01-15 17:35:19 +00:00
parent 1f87fb6896
commit 43ca69c38a
3 changed files with 30 additions and 4 deletions

View file

@ -4,10 +4,8 @@ PolarSSL ChangeLog
Features Features
Note: Most of these features have been donated by Fox-IT Note: Most of these features have been donated by Fox-IT
* Added Doxygen source code documentation parts * Added Doxygen source code documentation parts
* Added generic message digest wrapper for integration * Added generic message digest and cipher wrapper
with OpenVPN for integration with OpenVPN
* Added generic cipher wrapper for integration
with OpenVPN
* Added reading of DHM context from memory and file * Added reading of DHM context from memory and file
* Added verification callback on certificate chain * Added verification callback on certificate chain
verification to allow external blacklisting. verification to allow external blacklisting.

View file

@ -525,6 +525,15 @@ int ssl_get_verify_result( const ssl_context *ssl );
*/ */
const char *ssl_get_cipher( const ssl_context *ssl ); const char *ssl_get_cipher( const ssl_context *ssl );
/**
* \brief Return the current SSL version (SSLv3/TLSv1/etc)
*
* \param ssl SSL context
*
* \return a string containing the SSL version
*/
const char *ssl_get_version( const ssl_context *ssl );
/** /**
* \brief Perform the SSL handshake * \brief Perform the SSL handshake
* *

View file

@ -1918,6 +1918,25 @@ const char *ssl_get_cipher( const ssl_context *ssl )
return( "unknown" ); return( "unknown" );
} }
const char *ssl_get_version( const ssl_context *ssl )
{
switch( ssl->minor_ver )
{
case SSL_MINOR_VERSION_0:
return( "SSLv3.0" );
case SSL_MINOR_VERSION_1:
return( "TLSv1.0" );
case SSL_MINOR_VERSION_2:
return( "TLSv1.1" );
default:
break;
}
return( "unknown" );
}
int ssl_default_ciphers[] = int ssl_default_ciphers[] =
{ {
#if defined(POLARSSL_DHM_C) #if defined(POLARSSL_DHM_C)