mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-07 06:42:56 +03:00
Improve the method of printing string build version
Following changes are introduced with this commit: - Call mbedtls_version_get_string before printing string build version instead of printing macro directly - Output build version in the beginning of ssl_client2 program Signed-off-by: Yanray Wang <yanray.wang@arm.com>
This commit is contained in:
@@ -26,7 +26,6 @@
|
|||||||
#endif /* MBEDTLS_USE_PSA_CRYPTO || MBEDTLS_SSL_PROTO_TLS1_3 */
|
#endif /* MBEDTLS_USE_PSA_CRYPTO || MBEDTLS_SSL_PROTO_TLS1_3 */
|
||||||
|
|
||||||
#if defined(MBEDTLS_VERSION_C)
|
#if defined(MBEDTLS_VERSION_C)
|
||||||
#include "mbedtls/build_info.h"
|
|
||||||
#include "mbedtls/version.h"
|
#include "mbedtls/version.h"
|
||||||
#endif /* MBEDTLS_VERSION_C */
|
#endif /* MBEDTLS_VERSION_C */
|
||||||
|
|
||||||
@@ -1003,9 +1002,11 @@ int main( int argc, char *argv[] )
|
|||||||
{
|
{
|
||||||
if( strcmp( q, "1" ) == 0 )
|
if( strcmp( q, "1" ) == 0 )
|
||||||
{
|
{
|
||||||
|
char version_str[10];
|
||||||
|
memset( version_str, 0, 10 );
|
||||||
|
mbedtls_version_get_string( version_str );
|
||||||
mbedtls_printf( "build version: %s (build %u)\n",
|
mbedtls_printf( "build version: %s (build %u)\n",
|
||||||
MBEDTLS_VERSION_STRING,
|
version_str, mbedtls_version_get_number() );
|
||||||
mbedtls_version_get_number() );
|
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1722,6 +1723,14 @@ int main( int argc, char *argv[] )
|
|||||||
}
|
}
|
||||||
#endif /* MBEDTLS_SSL_ALPN */
|
#endif /* MBEDTLS_SSL_ALPN */
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_VERSION_C)
|
||||||
|
char version_str[10];
|
||||||
|
memset( version_str, 0, 10 );
|
||||||
|
mbedtls_version_get_string( version_str );
|
||||||
|
mbedtls_printf( "build version: %s (build %u)\n",
|
||||||
|
version_str, mbedtls_version_get_number() );
|
||||||
|
#endif /* MBEDTLS_VERSION_C */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 0. Initialize the RNG and the session data
|
* 0. Initialize the RNG and the session data
|
||||||
*/
|
*/
|
||||||
@@ -2480,11 +2489,6 @@ int main( int argc, char *argv[] )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MBEDTLS_VERSION_C)
|
|
||||||
mbedtls_printf( "build version: %s (build %u)\n",
|
|
||||||
MBEDTLS_VERSION_STRING, mbedtls_version_get_number() );
|
|
||||||
#endif /* MBEDTLS_VERSION_C */
|
|
||||||
|
|
||||||
#if defined(MBEDTLS_X509_CRT_PARSE_C)
|
#if defined(MBEDTLS_X509_CRT_PARSE_C)
|
||||||
/*
|
/*
|
||||||
* 5. Verify the server certificate
|
* 5. Verify the server certificate
|
||||||
|
Reference in New Issue
Block a user