Introduce macro-based read access to ctx->pk_info
diff --git a/include/mbedtls/pk_internal.h b/include/mbedtls/pk_internal.h
index fcf4887..94dd9aa 100644
--- a/include/mbedtls/pk_internal.h
+++ b/include/mbedtls/pk_internal.h
@@ -231,6 +231,13 @@
}
#endif /* MBEDTLS_ECDSA_C && MBEDTLS_ECP_RESTARTABLE */
+/*
+ * Macros to access pk_info
+ */
+#define MBEDTLS_PK_CTX_INFO( ctx ) ( (ctx)->pk_info )
+#define MBEDTLS_PK_CTX_IS_VALID( ctx ) \
+ ( MBEDTLS_PK_CTX_INFO( (ctx) ) != MBEDTLS_PK_INVALID_HANDLE )
+
#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT)
/* Container for RSA-alt */
typedef struct