doxygen: move addtogroup closures to include more elements

Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
diff --git a/include/mbedtls/asn1.h b/include/mbedtls/asn1.h
index d7854e6..4a84bb8 100644
--- a/include/mbedtls/asn1.h
+++ b/include/mbedtls/asn1.h
@@ -122,7 +122,6 @@
 #define MBEDTLS_ASN1_TAG_VALUE_MASK          0x1F
 
 /** \} name DER constants */
-/** \} addtogroup asn1_module */
 
 /** Returns the size of the binary string, without the trailing \\0 */
 #define MBEDTLS_OID_SIZE(x) (sizeof(x) - 1)
@@ -608,6 +607,7 @@
 void mbedtls_asn1_free_named_data_list( mbedtls_asn1_named_data **head );
 
 /** \} name Functions to parse ASN.1 data structures */
+/** \} addtogroup asn1_module */
 
 #ifdef __cplusplus
 }
diff --git a/include/mbedtls/x509.h b/include/mbedtls/x509.h
index 3bce4de..31b78df 100644
--- a/include/mbedtls/x509.h
+++ b/include/mbedtls/x509.h
@@ -255,7 +255,6 @@
 mbedtls_x509_time;
 
 /** \} name Structures for parsing X.509 certificates, CRLs and CSRs */
-/** \} addtogroup x509_module */
 
 /**
  * \brief          Store the certificate DN in printable form into buf;
@@ -311,6 +310,8 @@
  */
 int mbedtls_x509_time_is_future( const mbedtls_x509_time *from );
 
+/** \} addtogroup x509_module */
+
 #if defined(MBEDTLS_SELF_TEST)
 
 /**
diff --git a/include/mbedtls/x509_crt.h b/include/mbedtls/x509_crt.h
index 6e92971..4cc4e13 100644
--- a/include/mbedtls/x509_crt.h
+++ b/include/mbedtls/x509_crt.h
@@ -851,7 +851,6 @@
 #endif /* MBEDTLS_X509_CRT_PARSE_C */
 
 /** \} name Structures and functions for parsing and writing X.509 certificates */
-/** \} addtogroup x509_module */
 
 #if defined(MBEDTLS_X509_CRT_WRITE_C)
 /**
@@ -1087,6 +1086,8 @@
 #endif /* MBEDTLS_PEM_WRITE_C */
 #endif /* MBEDTLS_X509_CRT_WRITE_C */
 
+/** \} addtogroup x509_module */
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/mbedtls/x509_csr.h b/include/mbedtls/x509_csr.h
index dfd48fd..6bea9e1 100644
--- a/include/mbedtls/x509_csr.h
+++ b/include/mbedtls/x509_csr.h
@@ -152,7 +152,6 @@
 #endif /* MBEDTLS_X509_CSR_PARSE_C */
 
 /** \} name Structures and functions for X.509 Certificate Signing Requests (CSR) */
-/** \} addtogroup x509_module */
 
 #if defined(MBEDTLS_X509_CSR_WRITE_C)
 /**
@@ -298,6 +297,8 @@
 #endif /* MBEDTLS_PEM_WRITE_C */
 #endif /* MBEDTLS_X509_CSR_WRITE_C */
 
+/** \} addtogroup x509_module */
+
 #ifdef __cplusplus
 }
 #endif