summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/tasn_new.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2009-09-02 13:54:50 +0000
committerDr. Stephen Henson <steve@openssl.org>2009-09-02 13:54:50 +0000
commit17b5326ba9d072fbf9dca35f70e74361b91a3944 (patch)
treea4ff7debc9494b6774130dabc5f80c4e6bbe1c5c /crypto/asn1/tasn_new.c
parent3d9b105fe042b4986467ec12d881fa8a33ecd9ec (diff)
PR: 2013
Submitted by: steve@openssl.org Include a flag ASN1_STRING_FLAG_MSTRING when a multi string type is created. This makes it possible to tell if the underlying type is UTCTime, GeneralizedTime or Time when the structure is reused and X509_time_adj_ex() can handle each case in an appropriate manner. Add error checking to CRL generation in ca utility when nextUpdate is being set.
Diffstat (limited to 'crypto/asn1/tasn_new.c')
-rw-r--r--crypto/asn1/tasn_new.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/asn1/tasn_new.c b/crypto/asn1/tasn_new.c
index c816e51648..0d9e78cc7c 100644
--- a/crypto/asn1/tasn_new.c
+++ b/crypto/asn1/tasn_new.c
@@ -325,6 +325,7 @@ static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
{
ASN1_TYPE *typ;
+ ASN1_STRING *str;
int utype;
if (it && it->funcs)
@@ -362,7 +363,10 @@ int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
break;
default:
- *pval = (ASN1_VALUE *)ASN1_STRING_type_new(utype);
+ str = ASN1_STRING_type_new(utype);
+ if (it->itype == ASN1_ITYPE_MSTRING && str)
+ str->flags |= ASN1_STRING_FLAG_MSTRING;
+ *pval = (ASN1_VALUE *)str;
break;
}
if (*pval)