1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

- Certificate Requests written now have the Email address written in IA5String

This commit is contained in:
Paul Bakker
2012-02-16 10:26:57 +00:00
parent bdb912db69
commit 058881547f
4 changed files with 35 additions and 4 deletions

View File

@ -215,4 +215,27 @@ int asn1_write_printable_string( unsigned char **p, unsigned char *start,
return( len );
}
int asn1_write_ia5_string( unsigned char **p, unsigned char *start,
char *text )
{
int ret;
size_t len = 0;
// Write string
//
len = strlen( text );
if( *p - start < (int) len )
return( POLARSSL_ERR_ASN1_BUF_TOO_SMALL );
(*p) -= len;
memcpy( *p, text, len );
ASN1_CHK_ADD( len, asn1_write_len( p, start, len ) );
ASN1_CHK_ADD( len, asn1_write_tag( p, start, ASN1_IA5_STRING ) );
return( len );
}
#endif