Prepare for 0.9.8ze-dev
[oweals/openssl.git] / crypto / asn1 / asn1_lib.c
index d5ae5b2258a4d156d4d7a9d93b6aea0a10523978..d34515577e6eb8226d1d25748a28f9f112e1ffba 100644 (file)
@@ -131,6 +131,9 @@ int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
        *pclass=xclass;
        if (!asn1_get_length(&p,&inf,plength,(int)max)) goto err;
 
+       if (inf && !(ret & V_ASN1_CONSTRUCTED))
+               goto err;
+
 #if 0
        fprintf(stderr,"p=%d + *plength=%ld > omax=%ld + *pp=%d  (%d > %d)\n", 
                (int)p,*plength,omax,(int)*pp,(int)(p+ *plength),
@@ -393,6 +396,14 @@ int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len)
        return(1);
        }
 
+void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len)
+       {
+       if (str->data)
+               OPENSSL_free(str->data);
+       str->data = data;
+       str->length = len;
+       }
+
 ASN1_STRING *ASN1_STRING_new(void)
        {
        return(ASN1_STRING_type_new(V_ASN1_OCTET_STRING));