Fix pk_set_type() behaviour for unkown type
diff --git a/library/pk.c b/library/pk.c
index 18db95a..78ff5e9 100644
--- a/library/pk.c
+++ b/library/pk.c
@@ -114,7 +114,7 @@
         size = sizeof( ecdsa_context );
     else
 #endif
-        size = 0; /* should never be executed */
+        return( POLARSSL_ERR_PK_TYPE_MISMATCH );
 
     if( ( ctx->data = malloc( size ) ) == NULL )
         return( POLARSSL_ERR_PK_MALLOC_FAILED );