pk_set_type() cannot be used to reset key type
diff --git a/library/error.c b/library/error.c
index 0a739b5..560c54c 100644
--- a/library/error.c
+++ b/library/error.c
@@ -250,6 +250,8 @@
#if defined(POLARSSL_PK_C)
if( use_ret == -(POLARSSL_ERR_PK_MALLOC_FAILED) )
snprintf( buf, buflen, "PK - Memory alloation failed" );
+ if( use_ret == -(POLARSSL_ERR_PK_TYPE_MISMATCH) )
+ snprintf( buf, buflen, "PK - Type mismatch, eg attempt to use a RSA key as EC, or to modify key type" );
#endif /* POLARSSL_PK_C */
#if defined(POLARSSL_PKCS12_C)