mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
Remove functions deprecated in 1.3
This commit is contained in:
@ -5392,64 +5392,6 @@ int ssl_set_own_cert( ssl_context *ssl, x509_crt *own_cert,
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
#if defined(POLARSSL_RSA_C)
|
||||
int ssl_set_own_cert_rsa( ssl_context *ssl, x509_crt *own_cert,
|
||||
rsa_context *rsa_key )
|
||||
{
|
||||
int ret;
|
||||
ssl_key_cert *key_cert = ssl_add_key_cert( ssl );
|
||||
|
||||
if( key_cert == NULL )
|
||||
return( POLARSSL_ERR_SSL_MALLOC_FAILED );
|
||||
|
||||
key_cert->key = polarssl_malloc( sizeof(pk_context) );
|
||||
if( key_cert->key == NULL )
|
||||
return( POLARSSL_ERR_SSL_MALLOC_FAILED );
|
||||
|
||||
pk_init( key_cert->key );
|
||||
|
||||
ret = pk_init_ctx( key_cert->key, pk_info_from_type( POLARSSL_PK_RSA ) );
|
||||
if( ret != 0 )
|
||||
return( ret );
|
||||
|
||||
if( ( ret = rsa_copy( pk_rsa( *key_cert->key ), rsa_key ) ) != 0 )
|
||||
return( ret );
|
||||
|
||||
key_cert->cert = own_cert;
|
||||
key_cert->key_own_alloc = 1;
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
#endif /* POLARSSL_RSA_C */
|
||||
|
||||
int ssl_set_own_cert_alt( ssl_context *ssl, x509_crt *own_cert,
|
||||
void *rsa_key,
|
||||
rsa_decrypt_func rsa_decrypt,
|
||||
rsa_sign_func rsa_sign,
|
||||
rsa_key_len_func rsa_key_len )
|
||||
{
|
||||
int ret;
|
||||
ssl_key_cert *key_cert = ssl_add_key_cert( ssl );
|
||||
|
||||
if( key_cert == NULL )
|
||||
return( POLARSSL_ERR_SSL_MALLOC_FAILED );
|
||||
|
||||
key_cert->key = polarssl_malloc( sizeof(pk_context) );
|
||||
if( key_cert->key == NULL )
|
||||
return( POLARSSL_ERR_SSL_MALLOC_FAILED );
|
||||
|
||||
pk_init( key_cert->key );
|
||||
|
||||
if( ( ret = pk_init_ctx_rsa_alt( key_cert->key, rsa_key,
|
||||
rsa_decrypt, rsa_sign, rsa_key_len ) ) != 0 )
|
||||
return( ret );
|
||||
|
||||
key_cert->cert = own_cert;
|
||||
key_cert->key_own_alloc = 1;
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
#endif /* POLARSSL_X509_CRT_PARSE_C */
|
||||
|
||||
#if defined(POLARSSL_KEY_EXCHANGE__SOME__PSK_ENABLED)
|
||||
|
Reference in New Issue
Block a user