PR: 1422
[oweals/openssl.git] / crypto / asn1 / asn1_lib.c
index d5ae5b2258a4d156d4d7a9d93b6aea0a10523978..5af559ef8da70c5b24da7e620c28f17e6d9a05b9 100644 (file)
@@ -393,6 +393,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));