mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-10-13 12:27:25 +00:00
fix: add missing deprecation guards
Signed-off-by: Valerio Setti <[email protected]>
This commit is contained in:
@@ -996,7 +996,7 @@ void mbedtls_x509write_crt_init( mbedtls_x509write_cert *ctx );
|
|||||||
*/
|
*/
|
||||||
void mbedtls_x509write_crt_set_version( mbedtls_x509write_cert *ctx, int version );
|
void mbedtls_x509write_crt_set_version( mbedtls_x509write_cert *ctx, int version );
|
||||||
|
|
||||||
#if defined(MBEDTLS_BIGNUM_C)
|
#if defined(MBEDTLS_BIGNUM_C) && !defined(MBEDTLS_DEPRECATED_REMOVED)
|
||||||
/**
|
/**
|
||||||
* \brief Set the serial number for a Certificate.
|
* \brief Set the serial number for a Certificate.
|
||||||
*
|
*
|
||||||
@@ -1014,8 +1014,9 @@ void mbedtls_x509write_crt_set_version( mbedtls_x509write_cert *ctx, int version
|
|||||||
*
|
*
|
||||||
* \return 0 if successful
|
* \return 0 if successful
|
||||||
*/
|
*/
|
||||||
int mbedtls_x509write_crt_set_serial( mbedtls_x509write_cert *ctx, const mbedtls_mpi *serial );
|
int MBEDTLS_DEPRECATED mbedtls_x509write_crt_set_serial(
|
||||||
#endif
|
mbedtls_x509write_cert *ctx, const mbedtls_mpi *serial );
|
||||||
|
#endif // MBEDTLS_BIGNUM_C && !MBEDTLS_DEPRECATED_REMOVED
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Set the serial number for a Certificate.
|
* \brief Set the serial number for a Certificate.
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ int mbedtls_x509write_crt_set_issuer_name( mbedtls_x509write_cert *ctx,
|
|||||||
return mbedtls_x509_string_to_names( &ctx->issuer, issuer_name );
|
return mbedtls_x509_string_to_names( &ctx->issuer, issuer_name );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MBEDTLS_BIGNUM_C)
|
#if defined(MBEDTLS_BIGNUM_C) && !defined(MBEDTLS_DEPRECATED_REMOVED)
|
||||||
int mbedtls_x509write_crt_set_serial( mbedtls_x509write_cert *ctx,
|
int mbedtls_x509write_crt_set_serial( mbedtls_x509write_cert *ctx,
|
||||||
const mbedtls_mpi *serial )
|
const mbedtls_mpi *serial )
|
||||||
{
|
{
|
||||||
@@ -126,7 +126,7 @@ int mbedtls_x509write_crt_set_serial( mbedtls_x509write_cert *ctx,
|
|||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
#endif
|
#endif // MBEDTLS_BIGNUM_C && !MBEDTLS_DEPRECATED_REMOVED
|
||||||
|
|
||||||
int mbedtls_x509write_crt_set_serial_new( mbedtls_x509write_cert *ctx,
|
int mbedtls_x509write_crt_set_serial_new( mbedtls_x509write_cert *ctx,
|
||||||
char* serial_buff, size_t serial_buff_len)
|
char* serial_buff, size_t serial_buff_len)
|
||||||
|
|||||||
@@ -723,7 +723,7 @@ int main( int argc, char *argv[] )
|
|||||||
mbedtls_x509write_crt_set_version( &crt, opt.version );
|
mbedtls_x509write_crt_set_version( &crt, opt.version );
|
||||||
mbedtls_x509write_crt_set_md_alg( &crt, opt.md );
|
mbedtls_x509write_crt_set_md_alg( &crt, opt.md );
|
||||||
|
|
||||||
#if defined(MBEDTLS_BIGNUM_C)
|
#if defined(MBEDTLS_BIGNUM_C) && !defined(MBEDTLS_DEPRECATED_REMOVED)
|
||||||
ret = mbedtls_x509write_crt_set_serial( &crt, &serial );
|
ret = mbedtls_x509write_crt_set_serial( &crt, &serial );
|
||||||
if( ret != 0 )
|
if( ret != 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -377,14 +377,11 @@ void x509_crt_check( char *subject_key_file, char *subject_pwd,
|
|||||||
if( pk_wrap == 2 )
|
if( pk_wrap == 2 )
|
||||||
TEST_ASSERT( mbedtls_pk_get_type( &issuer_key ) == MBEDTLS_PK_OPAQUE );
|
TEST_ASSERT( mbedtls_pk_get_type( &issuer_key ) == MBEDTLS_PK_OPAQUE );
|
||||||
|
|
||||||
#if !defined(MBEDTLS_BIGNUM_C)
|
|
||||||
TEST_ASSERT( mbedtls_test_read_mpi( &serial, serial_str ) == 0 );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if( ver != -1 )
|
if( ver != -1 )
|
||||||
mbedtls_x509write_crt_set_version( &crt, ver );
|
mbedtls_x509write_crt_set_version( &crt, ver );
|
||||||
|
|
||||||
#if !defined(MBEDTLS_BIGNUM_C)
|
#if defined(MBEDTLS_BIGNUM_C) && !defined(MBEDTLS_DEPRECATED_REMOVED)
|
||||||
|
TEST_ASSERT( mbedtls_test_read_mpi( &serial, serial_str ) == 0 );
|
||||||
TEST_ASSERT( mbedtls_x509write_crt_set_serial( &crt, &serial ) == 0 );
|
TEST_ASSERT( mbedtls_x509write_crt_set_serial( &crt, &serial ) == 0 );
|
||||||
#else
|
#else
|
||||||
TEST_ASSERT( mbedtls_x509write_crt_set_serial_new( &crt, serial_str,
|
TEST_ASSERT( mbedtls_x509write_crt_set_serial_new( &crt, serial_str,
|
||||||
|
|||||||
Reference in New Issue
Block a user