Some constification and stacks that slipped through the cracks (how?).
[openssl.git] / crypto / pkcs12 / p12_sbag.c
index 7087294..1b3adde 100644 (file)
@@ -98,7 +98,7 @@ int i2d_PKCS12_SAFEBAG(PKCS12_SAFEBAG *a, unsigned char **pp)
                break;
        }
 
-       M_ASN1_I2D_len_SET (a->attrib, i2d_X509_ATTRIBUTE);
+       M_ASN1_I2D_len_SET_type (X509_ATTRIBUTE,a->attrib, i2d_X509_ATTRIBUTE);
 
        M_ASN1_I2D_seq_total ();
        
@@ -134,7 +134,7 @@ int i2d_PKCS12_SAFEBAG(PKCS12_SAFEBAG *a, unsigned char **pp)
                break;
        }
 
-       M_ASN1_I2D_put_SET (a->attrib, i2d_X509_ATTRIBUTE);
+       M_ASN1_I2D_put_SET_type (X509_ATTRIBUTE, a->attrib, i2d_X509_ATTRIBUTE);
 
        M_ASN1_I2D_finish();
 }
@@ -146,7 +146,7 @@ PKCS12_SAFEBAG *PKCS12_SAFEBAG_new(void)
        M_ASN1_New_Malloc(ret, PKCS12_SAFEBAG);
        ret->type=NULL;
        ret->value.other=NULL;
-       M_ASN1_New(ret->attrib, sk_new_null);
+       M_ASN1_New(ret->attrib, sk_X509_ATTRIBUTE_new_null);
        ret->rest=NULL;
        return (ret);
        M_ASN1_New_Error(ASN1_F_PKCS12_SAFEBAG_NEW);
@@ -192,8 +192,8 @@ PKCS12_SAFEBAG *d2i_PKCS12_SAFEBAG(PKCS12_SAFEBAG **a, unsigned char **pp,
                                                         d2i_ASN1_TYPE, 0);
                break;
        }
-       M_ASN1_D2I_get_set_opt(ret->attrib, d2i_X509_ATTRIBUTE,
-                                                        X509_ATTRIBUTE_free);
+       M_ASN1_D2I_get_set_opt_type(X509_ATTRIBUTE,ret->attrib,
+                                   d2i_X509_ATTRIBUTE,X509_ATTRIBUTE_free);
        M_ASN1_D2I_Finish(a, PKCS12_SAFEBAG_free, ASN1_F_D2I_PKCS12_SAFEBAG);
 }
 
@@ -222,6 +222,6 @@ void PKCS12_SAFEBAG_free (PKCS12_SAFEBAG *a)
        }
 
        ASN1_OBJECT_free (a->type);
-       sk_pop_free (a->attrib, X509_ATTRIBUTE_free);
-       Free ((char *)a);
+       sk_X509_ATTRIBUTE_pop_free (a->attrib, X509_ATTRIBUTE_free);
+       Free (a);
 }