Improve documentation of x509_attr_descriptor_t

This commit is contained in:
Hanno Becker 2018-10-08 14:32:55 +01:00
parent eba6c9bb50
commit d2c9009e5a

View File

@ -33,11 +33,17 @@
#include <string.h> #include <string.h>
/* Structure linking OIDs for X.509 DN AttributeTypes to their
* string representations and default string encodings used by Mbed TLS. */
typedef struct { typedef struct {
const char *name; const char *name; /* String representation of AttributeType, e.g.
size_t name_len; * "CN" or "emailAddress". */
const char*oid; size_t name_len; /* Length of \c name, without trailing \c 0 byte. */
int tag; const char *oid; /* String representation of OID of AttributeType,
* as per RFC 5280, Appendix A.1. */
int tag; /* The default character encoding used for the
* given attribute type, e.g.
* #MBEDTLS_ASN1_UTF8_STRING for UTF-8. */
} x509_attr_descriptor_t; } x509_attr_descriptor_t;
#define ADD_STRLEN( s ) s, sizeof( s ) - 1 #define ADD_STRLEN( s ) s, sizeof( s ) - 1
@ -87,7 +93,7 @@ static const x509_attr_descriptor_t *x509_attr_descr_from_name( const char *name
if ( cur->name == NULL ) if ( cur->name == NULL )
return( NULL ); return( NULL );
return( cur ); return( cur );
} }