Fix pk_can_do() constness issue
diff --git a/include/mbedtls/pk.h b/include/mbedtls/pk.h
index 8d9407c..14ac65e 100644
--- a/include/mbedtls/pk.h
+++ b/include/mbedtls/pk.h
@@ -292,7 +292,7 @@
* \return 0 if context can't do the operations,
* 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).
diff --git a/library/pk.c b/library/pk.c
index 7652510..af4a302 100644
--- a/library/pk.c
+++ b/library/pk.c
@@ -144,7 +144,7 @@
/*
* 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 */
if( ctx == NULL || ctx->pk_info == NULL )
@@ -351,7 +351,7 @@
/*
* 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 )
return( "invalid PK" );
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index 25d7d25..6cb3590 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -3992,7 +3992,7 @@
#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( pk_can_do( pk, POLARSSL_PK_ECKEY ) &&