Move accessor definition

Move the definition of the accessor so that it is not defined
within the MBEDTLS_X509_CRT_WRITE_C guards. Thus remove the
dependency from the test and test cases.

Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
diff --git a/include/mbedtls/x509_crt.h b/include/mbedtls/x509_crt.h
index 0b0120b..5ce1443 100644
--- a/include/mbedtls/x509_crt.h
+++ b/include/mbedtls/x509_crt.h
@@ -955,6 +955,23 @@
 #endif /* MBEDTLS_ECDSA_C && MBEDTLS_ECP_RESTARTABLE */
 #endif /* MBEDTLS_X509_CRT_PARSE_C */
 
+/**
+ * \brief               Query certificate for given extension type
+ *
+ * \param[in] ctx       Certificate context to be queried, must not be \c NULL
+ * \param ext_type      Extension type being queried for, must be a valid
+ *                      extension type. Must be one of the MBEDTLS_X509_EXT_XXX
+ *                      values
+ *
+ * \return              0 if the given extension type is not present,
+ *                      non-zero otherwise
+ */
+static inline int mbedtls_x509_crt_has_ext_type( const mbedtls_x509_crt *ctx,
+                                                 int ext_type )
+{
+    return ctx->MBEDTLS_PRIVATE(ext_types) & ext_type;
+}
+
 /** \} name Structures and functions for parsing and writing X.509 certificates */
 
 #if defined(MBEDTLS_X509_CRT_WRITE_C)
@@ -1138,23 +1155,6 @@
                                     unsigned char ns_cert_type );
 
 /**
- * \brief               Query certificate for given extension type
- *
- * \param[in] ctx       Certificate context to be queried, must not be \c NULL
- * \param ext_type      Extension type being queried for, must be a valid
- *                      extension type. Must be one of the MBEDTLS_X509_EXT_XXX
- *                      values
- *
- * \return              0 if the given extension type is not present,
- *                      non-zero otherwise
- */
-static inline int mbedtls_x509_crt_has_ext_type( const mbedtls_x509_crt *ctx,
-                                                 int ext_type )
-{
-    return ctx->MBEDTLS_PRIVATE(ext_types) & ext_type;
-}
-
-/**
  * \brief           Free the contents of a CRT write context
  *
  * \param ctx       CRT context to free