SSL modules now using x509_crt_parse_der()

Avoid uselessly trying to decode PEM.
This commit is contained in:
Manuel Pégourié-Gonnard 2014-06-13 20:33:27 +02:00
parent b25f81665f
commit 4d2a8eb6ff
2 changed files with 4 additions and 3 deletions

View File

@ -149,7 +149,8 @@ static int ssl_load_session( ssl_session *session,
x509_crt_init( session->peer_cert );
if( ( ret = x509_crt_parse( session->peer_cert, p, cert_len ) ) != 0 )
if( ( ret = x509_crt_parse_der( session->peer_cert,
p, cert_len ) ) != 0 )
{
x509_crt_free( session->peer_cert );
polarssl_free( session->peer_cert );

View File

@ -101,8 +101,8 @@ static int ssl_session_copy( ssl_session *dst, const ssl_session *src )
x509_crt_init( dst->peer_cert );
if( ( ret = x509_crt_parse( dst->peer_cert, src->peer_cert->raw.p,
src->peer_cert->raw.len ) ) != 0 )
if( ( ret = x509_crt_parse_der( dst->peer_cert, src->peer_cert->raw.p,
src->peer_cert->raw.len ) ) != 0 )
{
polarssl_free( dst->peer_cert );
dst->peer_cert = NULL;