SSL modules now using x509_crt_parse_der()

Avoid uselessly trying to decode PEM.
parent b25f8166
......@@ -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 );
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment