M_ASN1_I2D_len (a->version, i2d_ASN1_INTEGER);
M_ASN1_I2D_len (a->pkeyalg, i2d_X509_ALGOR);
M_ASN1_I2D_len (a->pkey, i2d_ASN1_TYPE);
- M_ASN1_I2D_len_IMP_SET_opt (a->attributes, i2d_X509_ATTRIBUTE, 0);
+ M_ASN1_I2D_len_IMP_SET_opt_type (X509_ATTRIBUTE, a->attributes,
+ i2d_X509_ATTRIBUTE, 0);
M_ASN1_I2D_seq_total ();
M_ASN1_I2D_put (a->version, i2d_ASN1_INTEGER);
M_ASN1_I2D_put (a->pkeyalg, i2d_X509_ALGOR);
M_ASN1_I2D_put (a->pkey, i2d_ASN1_TYPE);
- M_ASN1_I2D_put_IMP_SET_opt (a->attributes, i2d_X509_ATTRIBUTE, 0);
+ M_ASN1_I2D_put_IMP_SET_opt_type (X509_ATTRIBUTE, a->attributes,
+ i2d_X509_ATTRIBUTE, 0);
M_ASN1_I2D_finish();
}
M_ASN1_D2I_get (ret->version, d2i_ASN1_INTEGER);
M_ASN1_D2I_get (ret->pkeyalg, d2i_X509_ALGOR);
M_ASN1_D2I_get (ret->pkey, d2i_ASN1_TYPE);
- M_ASN1_D2I_get_IMP_set_opt(ret->attributes, d2i_X509_ATTRIBUTE,
- X509_ATTRIBUTE_free, 0);
+ M_ASN1_D2I_get_IMP_set_opt_type(X509_ATTRIBUTE, ret->attributes,
+ d2i_X509_ATTRIBUTE,
+ X509_ATTRIBUTE_free, 0);
if (ASN1_TYPE_get(ret->pkey) == V_ASN1_SEQUENCE)
ret->broken = PKCS8_NO_OCTET;
M_ASN1_D2I_Finish(a, PKCS8_PRIV_KEY_INFO_free, ASN1_F_D2I_PKCS8_PRIV_KEY_INFO);
memset (a->pkey->value.octet_string->data,
0, a->pkey->value.octet_string->length);
ASN1_TYPE_free (a->pkey);
- sk_pop_free (a->attributes, X509_ATTRIBUTE_free);
- Free ((char *)a);
+ sk_X509_ATTRIBUTE_pop_free (a->attributes, X509_ATTRIBUTE_free);
+ Free (a);
}
}
sk_ASN1_TYPE_push (attrib->value.set,keyid);
attrib->set = 1;
- if (!p8->attributes && !(p8->attributes = sk_new (NULL))) {
+ if (!p8->attributes
+ && !(p8->attributes = sk_X509_ATTRIBUTE_new (NULL))) {
PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE);
return 0;
}
- sk_push (p8->attributes, (char *)attrib);
+ sk_X509_ATTRIBUTE_push (p8->attributes, attrib);
return 1;
}