mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Adapt ssl_set_own_cert() to generic keys
This commit is contained in:
@ -3143,22 +3143,35 @@ void ssl_set_ca_chain( ssl_context *ssl, x509_cert *ca_chain,
|
||||
}
|
||||
|
||||
void ssl_set_own_cert( ssl_context *ssl, x509_cert *own_cert,
|
||||
rsa_context *rsa_key )
|
||||
pk_context *pk_key )
|
||||
{
|
||||
ssl->own_cert = own_cert;
|
||||
ssl->pk_key = pk_key;
|
||||
|
||||
/* Temporary, until everything is moved to PK */
|
||||
if( pk_key->pk_info->type == POLARSSL_PK_RSA )
|
||||
ssl->rsa_key = pk_key->pk_ctx;
|
||||
}
|
||||
|
||||
#if defined(POLARSSL_RSA_C)
|
||||
void ssl_set_own_cert_rsa( ssl_context *ssl, x509_cert *own_cert,
|
||||
rsa_context *rsa_key )
|
||||
{
|
||||
ssl->own_cert = own_cert;
|
||||
ssl->rsa_key = rsa_key;
|
||||
}
|
||||
#endif /* POLARSSL_RSA_C */
|
||||
|
||||
void ssl_set_own_cert_alt( ssl_context *ssl, x509_cert *own_cert,
|
||||
void *rsa_key,
|
||||
rsa_decrypt_func rsa_decrypt,
|
||||
rsa_sign_func rsa_sign,
|
||||
rsa_key_len_func rsa_key_len )
|
||||
void ssl_set_own_cert_alt_rsa( ssl_context *ssl, x509_cert *own_cert,
|
||||
void *rsa_key,
|
||||
rsa_decrypt_func rsa_decrypt,
|
||||
rsa_sign_func rsa_sign,
|
||||
rsa_key_len_func rsa_key_len )
|
||||
{
|
||||
ssl->own_cert = own_cert;
|
||||
ssl->rsa_key = rsa_key;
|
||||
ssl->own_cert = own_cert;
|
||||
ssl->rsa_key = rsa_key;
|
||||
ssl->rsa_decrypt = rsa_decrypt;
|
||||
ssl->rsa_sign = rsa_sign;
|
||||
ssl->rsa_sign = rsa_sign;
|
||||
ssl->rsa_key_len = rsa_key_len;
|
||||
}
|
||||
#endif /* POLARSSL_X509_PARSE_C */
|
||||
|
Reference in New Issue
Block a user