File tree 3 files changed +17
-2
lines changed
3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1010 * Fixed offset for cert_type list in ssl_parse_certificate_request()
1111 * Fixed const correctness issues that have no impact on the ABI
1212 * x509parse_crt() now better handles PEM error situations
13+ * ssl_parse_certificate() now calls x509parse_crt_der() directly
14+ instead of the x509parse_crt() wrapper that can also parse PEM
15+ certificates
1316
1417= Version 1.2.7 released 2013-04-13
1518Features
Original file line number Diff line number Diff line change @@ -424,6 +424,18 @@ extern "C" {
424424 */
425425
426426/** \ingroup x509_module */
427+ /**
428+ * \brief Parse a single DER formatted certificate and add it
429+ * to the chained list.
430+ *
431+ * \param chain points to the start of the chain
432+ * \param buf buffer holding the certificate DER data
433+ * \param buflen size of the buffer
434+ *
435+ * \return 0 if successful, or a specific X509 or PEM error code
436+ */
437+ int x509parse_crt_der ( x509_cert * chain , const unsigned char * buf , size_t buflen );
438+
427439/**
428440 * \brief Parse one or more certificates and add them
429441 * to the chained list. Parses permissively. If some
Original file line number Diff line number Diff line change @@ -2375,8 +2375,8 @@ int ssl_parse_certificate( ssl_context *ssl )
23752375 return ( POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE );
23762376 }
23772377
2378- ret = x509parse_crt ( ssl -> session_negotiate -> peer_cert , ssl -> in_msg + i ,
2379- n );
2378+ ret = x509parse_crt_der ( ssl -> session_negotiate -> peer_cert ,
2379+ ssl -> in_msg + i , n );
23802380 if ( ret != 0 )
23812381 {
23822382 SSL_DEBUG_RET ( 1 , " x509parse_crt" , ret );
You can’t perform that action at this time.
0 commit comments