Commit fbc09f3c authored by Paul Bakker's avatar Paul Bakker
Browse files

- Added an EXPLICIT tag number parameter to x509_get_ext()

parent 3329d1f8
......@@ -14,6 +14,7 @@ Changes
* Fixed rsa_encrypt and rsa_decrypt examples to use public key for
encryption and private key for decryption. (Closes ticket #34)
* Inceased maximum size of ASN1 length reads to 32-bits.
* Added an EXPLICIT tag number parameter to x509_get_ext()
Bugfix
* Fixed faulty HMAC-MD2 implementation. Found by dibac. (Closes
......
......@@ -756,7 +756,7 @@ static int x509_get_uid( unsigned char **p,
*/
static int x509_get_ext( unsigned char **p,
const unsigned char *end,
x509_buf *ext )
x509_buf *ext, int tag )
{
int ret;
size_t len;
......@@ -767,7 +767,7 @@ static int x509_get_ext( unsigned char **p,
ext->tag = **p;
if( ( ret = asn1_get_tag( p, end, &ext->len,
ASN1_CONTEXT_SPECIFIC | ASN1_CONSTRUCTED | 3 ) ) != 0 )
ASN1_CONTEXT_SPECIFIC | ASN1_CONSTRUCTED | tag ) ) != 0 )
return( ret );
ext->p = *p;
......@@ -800,9 +800,10 @@ static int x509_get_crl_ext( unsigned char **p,
x509_buf *ext )
{
int ret;
size_t len;
size_t len = 0;
if( ( ret = x509_get_ext( p, end, ext ) ) != 0 )
/* Get explicit tag */
if( ( ret = x509_get_ext( p, end, ext, 0) ) != 0 )
{
if( ret == POLARSSL_ERR_ASN1_UNEXPECTED_TAG )
return( 0 );
......@@ -951,7 +952,7 @@ static int x509_get_crt_ext( unsigned char **p,
size_t len;
unsigned char *end_ext_data, *end_ext_octet;
if( ( ret = x509_get_ext( p, end, &crt->v3_ext ) ) != 0 )
if( ( ret = x509_get_ext( p, end, &crt->v3_ext, 3 ) ) != 0 )
{
if( ret == POLARSSL_ERR_ASN1_UNEXPECTED_TAG )
return( 0 );
......
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