Add verify callback functions to lookup a STACK of matching certs or CRLs
[oweals/openssl.git] / crypto / asn1 / asn1_lib.c
index bb94257cee34ae74bac2061ff837f2a5620c7e9b..41e1126e7710423735e16d70eb04bb96786bcf7b 100644 (file)
@@ -340,7 +340,7 @@ int asn1_GetSequence(ASN1_const_CTX *c, long *length)
        return(1);
        }
 
-ASN1_STRING *ASN1_STRING_dup(ASN1_STRING *str)
+ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *str)
        {
        ASN1_STRING *ret;
 
@@ -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));
@@ -423,7 +431,7 @@ void ASN1_STRING_free(ASN1_STRING *a)
        OPENSSL_free(a);
        }
 
-int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b)
+int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
        {
        int i;
 
@@ -449,7 +457,7 @@ void asn1_add_error(const unsigned char *address, int offset)
        ERR_add_error_data(4,"address=",buf1," offset=",buf2);
        }
 
-int ASN1_STRING_length(ASN1_STRING *x)
+int ASN1_STRING_length(const ASN1_STRING *x)
 { return M_ASN1_STRING_length(x); }
 
 void ASN1_STRING_length_set(ASN1_STRING *x, int len)