|
|
|
@ -88,6 +88,9 @@ static Asn1Generic * DecodeAsn1DerT61String(const unsigned char *buffer,
|
|
|
|
|
static Asn1Generic * DecodeAsn1DerUTCTime(const unsigned char *buffer,
|
|
|
|
|
uint32_t size, uint8_t depth,
|
|
|
|
|
uint32_t *errcode);
|
|
|
|
|
static Asn1Generic * DecodeAsn1DerGeneralizedTime(const unsigned char *buffer,
|
|
|
|
|
uint32_t size, uint8_t depth,
|
|
|
|
|
uint32_t *errcode);
|
|
|
|
|
|
|
|
|
|
static Asn1Generic * Asn1GenericNew(void)
|
|
|
|
|
{
|
|
|
|
@ -220,6 +223,9 @@ static Asn1Generic * DecodeAsn1DerGeneric(const unsigned char *buffer,
|
|
|
|
|
case ASN1_UTCTIME:
|
|
|
|
|
child = DecodeAsn1DerUTCTime(d_ptr, el_max_size, depth+1, errcode);
|
|
|
|
|
break;
|
|
|
|
|
case ASN1_GENERALIZEDTIME:
|
|
|
|
|
child = DecodeAsn1DerGeneralizedTime(d_ptr, el_max_size, depth+1, errcode);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
/* unknown ASN.1 type */
|
|
|
|
|
child = NULL;
|
|
|
|
@ -862,6 +868,20 @@ static Asn1Generic * DecodeAsn1DerUTCTime(const unsigned char *buffer,
|
|
|
|
|
return a;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static Asn1Generic * DecodeAsn1DerGeneralizedTime(const unsigned char *buffer,
|
|
|
|
|
uint32_t max_size,
|
|
|
|
|
uint8_t depth,
|
|
|
|
|
uint32_t *errcode)
|
|
|
|
|
{
|
|
|
|
|
Asn1Generic *a;
|
|
|
|
|
|
|
|
|
|
a = DecodeAsn1DerIA5String(buffer, max_size, depth, errcode);
|
|
|
|
|
if (a != NULL)
|
|
|
|
|
a->type = ASN1_GENERALIZEDTIME;
|
|
|
|
|
|
|
|
|
|
return a;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Asn1Generic * DecodeDer(const unsigned char *buffer, uint32_t size,
|
|
|
|
|
uint32_t *errcode)
|
|
|
|
|
{
|
|
|
|
|