SSL modules now using x509_crt_parse_der()
Avoid uselessly trying to decode PEM.
diff --git a/library/ssl_srv.c b/library/ssl_srv.c
index dfa7e48..7a5f462 100644
--- a/library/ssl_srv.c
+++ b/library/ssl_srv.c
@@ -149,7 +149,8 @@
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 );
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index 1c5249c..ce6730d 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -101,8 +101,8 @@
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;