aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asn1/a_type.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>1999-01-17 00:13:14 +0000
committerDr. Stephen Henson <steve@openssl.org>1999-01-17 00:13:14 +0000
commitf6aed2cda608d6291225030fc259f207aac33732 (patch)
tree871e34a38284841b02131a1ad2725485a99a1ecc /crypto/asn1/a_type.c
parentc3ae9a4851463e083e1b5dd803a286a61f2b784b (diff)
downloadopenssl-f6aed2cda608d6291225030fc259f207aac33732.tar.gz
Time to blow up the source tree :-) This is the beginning of support for
GeneralizedTime. At several points PKIX specifies that GeneralizedTime can be used but OpenSSL doesn't currently support it. This patch adds several files and a bunch of functions. Of interest is the ASN1_TIME structure and its related functions. At several points certificates, CRLs et al specify that a time can be expressed as a choice of UTCTime and GeneralizedTime. Currently OpenSSL interprets this (wrongly) as UTCTime because GeneralizedTime isn't supported. The ASN1_TIME stuff provides this functionality. Still todo is to trace which cert and CRL points need an ASN1_TIME and modify the utilities appropriately and of course fix all the bugs. Note new OpenSSL copyright in the new file a_time.c. I didn't put it in a_gentm.c because it is a minimally modified form a_utctm.c . Since this adds new files and error codes you will need to do a 'make errors' at the top level to add the new codes.
Diffstat (limited to 'crypto/asn1/a_type.c')
-rw-r--r--crypto/asn1/a_type.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/asn1/a_type.c b/crypto/asn1/a_type.c
index 7ddf5f9917..63b458358a 100644
--- a/crypto/asn1/a_type.c
+++ b/crypto/asn1/a_type.c
@@ -119,6 +119,9 @@ unsigned char **pp;
case V_ASN1_UTCTIME:
r=i2d_ASN1_UTCTIME(a->value.utctime,pp);
break;
+ case V_ASN1_GENERALIZEDTIME:
+ r=i2d_ASN1_GENERALIZEDTIME(a->value.generalizedtime,pp);
+ break;
case V_ASN1_SET:
case V_ASN1_SEQUENCE:
if (a->value.set == NULL)
@@ -224,6 +227,11 @@ long length;
d2i_ASN1_UTCTIME(NULL,&p,max-p)) == NULL)
goto err;
break;
+ case V_ASN1_GENERALIZEDTIME:
+ if ((ret->value.generalizedtime=
+ d2i_ASN1_GENERALIZEDTIME(NULL,&p,max-p)) == NULL)
+ goto err;
+ break;
case V_ASN1_SET:
case V_ASN1_SEQUENCE:
/* Sets and sequences are left complete */