Constify d2i, s2i, c2i and r2i functions and other associated
[openssl.git] / crypto / asn1 / asn_pack.c
index e62eed2afad626debfb50494a68e85b37e5fa9f0..ea56aa6abeda31e73c1b38cc66ea7fb2415fea51 100644 (file)
 
 /* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */
 
-STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(),
+STACK *ASN1_seq_unpack(const unsigned char *buf, int len, char *(*d2i)(),
             void (*free_func)(void *))
 {
     STACK *sk;
-    unsigned char *pbuf;
+    const unsigned char *pbuf;
     pbuf =  buf;
     if (!(sk = d2i_ASN1_SET(NULL, &pbuf, len, d2i, free_func,
                                        V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL)))
@@ -149,7 +149,7 @@ ASN1_STRING *ASN1_pack_string(void *obj, int (*i2d)(), ASN1_STRING **oct)
 
 /* ASN1_ITEM versions of the above */
 
-ASN1_STRING *ASN1_pack_item(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct)
+ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct)
 {
        ASN1_STRING *octmp;
 
@@ -179,9 +179,9 @@ ASN1_STRING *ASN1_pack_item(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct)
 
 /* Extract an ASN1 object from an ASN1_STRING */
 
-void *ASN1_unpack_item(ASN1_STRING *oct, const ASN1_ITEM *it)
+void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it)
 {
-       unsigned char *p;
+       const unsigned char *p;
        void *ret;
 
        p = oct->data;