mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 13:55:45 +01:00
Fix pk_can_do() constness issue
This commit is contained in:
parent
b295e4fdc4
commit
0db107e4ba
@ -292,7 +292,7 @@ static inline size_t pk_get_len( const pk_context *ctx )
|
|||||||
* \return 0 if context can't do the operations,
|
* \return 0 if context can't do the operations,
|
||||||
* 1 otherwise.
|
* 1 otherwise.
|
||||||
*/
|
*/
|
||||||
int pk_can_do( pk_context *ctx, pk_type_t type );
|
int pk_can_do( const pk_context *ctx, pk_type_t type );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Verify signature (including padding if relevant).
|
* \brief Verify signature (including padding if relevant).
|
||||||
|
@ -144,7 +144,7 @@ int pk_init_ctx_rsa_alt( pk_context *ctx, void * key,
|
|||||||
/*
|
/*
|
||||||
* Tell if a PK can do the operations of the given type
|
* Tell if a PK can do the operations of the given type
|
||||||
*/
|
*/
|
||||||
int pk_can_do( pk_context *ctx, pk_type_t type )
|
int pk_can_do( const pk_context *ctx, pk_type_t type )
|
||||||
{
|
{
|
||||||
/* null or NONE context can't do anything */
|
/* null or NONE context can't do anything */
|
||||||
if( ctx == NULL || ctx->pk_info == NULL )
|
if( ctx == NULL || ctx->pk_info == NULL )
|
||||||
@ -351,7 +351,7 @@ int pk_debug( const pk_context *ctx, pk_debug_item *items )
|
|||||||
/*
|
/*
|
||||||
* Access the PK type name
|
* Access the PK type name
|
||||||
*/
|
*/
|
||||||
const char * pk_get_name( const pk_context *ctx )
|
const char *pk_get_name( const pk_context *ctx )
|
||||||
{
|
{
|
||||||
if( ctx == NULL || ctx->pk_info == NULL )
|
if( ctx == NULL || ctx->pk_info == NULL )
|
||||||
return( "invalid PK" );
|
return( "invalid PK" );
|
||||||
|
@ -3992,7 +3992,7 @@ int ssl_parse_certificate( ssl_context *ssl )
|
|||||||
|
|
||||||
#if defined(POLARSSL_SSL_SET_CURVES)
|
#if defined(POLARSSL_SSL_SET_CURVES)
|
||||||
{
|
{
|
||||||
pk_context *pk = &ssl->session_negotiate->peer_cert->pk;
|
const pk_context *pk = &ssl->session_negotiate->peer_cert->pk;
|
||||||
|
|
||||||
/* If certificate uses an EC key, make sure the curve is OK */
|
/* If certificate uses an EC key, make sure the curve is OK */
|
||||||
if( pk_can_do( pk, POLARSSL_PK_ECKEY ) &&
|
if( pk_can_do( pk, POLARSSL_PK_ECKEY ) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user