Move internal mbedtls_x509_crt_cache to x509_internal.h

We cannot move it to x509_crt.c because there are some static inline
function definitions in x509_crt.h which access members of
mbedtls_x509_crt_cache.
This commit is contained in:
Hanno Becker 2019-05-13 12:39:44 +01:00
parent 54f1c2cb20
commit 00d390338d
2 changed files with 19 additions and 18 deletions

View file

@ -32,7 +32,7 @@
#include "x509.h"
#include "x509_crl.h"
#include "threading.h"
#include "x509_internal.h"
/**
* \addtogroup x509_module
@ -97,22 +97,6 @@ typedef struct mbedtls_x509_crt_frame
} mbedtls_x509_crt_frame;
/* This is an internal structure used for caching parsed data from an X.509 CRT.
*
* This structure may change at any time, and it is discouraged
* to access it directly.
*/
typedef struct mbedtls_x509_crt_cache
{
#if defined(MBEDTLS_THREADING_C)
mbedtls_threading_mutex_t frame_mutex;
mbedtls_threading_mutex_t pk_mutex;
#endif
mbedtls_x509_buf_raw pk_raw;
mbedtls_x509_crt_frame *frame;
mbedtls_pk_context *pk;
} mbedtls_x509_crt_cache;
/**
* Container for an X.509 certificate. The certificate may be chained.
*/
@ -121,7 +105,7 @@ typedef struct mbedtls_x509_crt
int own_buffer; /**< Indicates if \c raw is owned
* by the structure or not. */
mbedtls_x509_buf raw; /**< The raw certificate data (DER). */
mbedtls_x509_crt_cache *cache; /**< Internal parsing cache. */
mbedtls_x509_crt_cache *cache; /**< Internal parsing cache. */
struct mbedtls_x509_crt *next; /**< Next certificate in the CA-chain. */

View file

@ -26,6 +26,23 @@
#define MBEDTLS_X509_INTERNAL_H
#include "x509.h"
#include "threading.h"
/* Internal structure used for caching parsed data from an X.509 CRT. */
struct mbedtls_x509_crt;
struct mbedtls_pk_context;
struct mbedtls_x509_crt_frame;
typedef struct mbedtls_x509_crt_cache
{
#if defined(MBEDTLS_THREADING_C)
mbedtls_threading_mutex_t frame_mutex;
mbedtls_threading_mutex_t pk_mutex;
#endif
mbedtls_x509_buf_raw pk_raw;
struct mbedtls_x509_crt_frame *frame;
struct mbedtls_pk_context *pk;
} mbedtls_x509_crt_cache;
int mbedtls_x509_get_name( unsigned char *p, size_t len,
mbedtls_x509_name *cur );