#include <stddef.h>
+#include <string.h>
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
#include <openssl/objects.h>
skcontlen = 0;
for(i = 0; i < sk_ASN1_VALUE_num(sk); i++) {
skitem = sk_ASN1_VALUE_value(sk, i);
- skcontlen += ASN1_item_ex_i2d(&skitem, NULL, tt->item, -1, 0);
+ skcontlen += ASN1_item_ex_i2d(&skitem, NULL, ASN1_ITEM_ptr(tt->item), -1, 0);
}
sklen = ASN1_object_size(1, skcontlen, sktag);
/* If EXPLICIT need length of surrounding tag */
/* SET or SEQUENCE and IMPLICIT tag */
ASN1_put_object(out, 1, skcontlen, sktag, skaclass);
/* And finally the stuff itself */
- asn1_set_seq_out(sk, out, skcontlen, tt->item, isset);
+ asn1_set_seq_out(sk, out, skcontlen, ASN1_ITEM_ptr(tt->item), isset);
return ret;
}
if(flags & ASN1_TFLG_EXPTAG) {
/* EXPLICIT tagging */
/* Find length of tagged item */
- i = ASN1_item_ex_i2d(pval, NULL, tt->item, -1, 0);
+ i = ASN1_item_ex_i2d(pval, NULL, ASN1_ITEM_ptr(tt->item), -1, 0);
if(!i) return 0;
/* Find length of EXPLICIT tag */
ret = ASN1_object_size(1, i, tt->tag);
if(out) {
/* Output tag and item */
ASN1_put_object(out, 1, i, tt->tag, aclass);
- ASN1_item_ex_i2d(pval, out, tt->item, -1, 0);
+ ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1, 0);
}
return ret;
}
if(flags & ASN1_TFLG_IMPTAG) {
/* IMPLICIT tagging */
- return ASN1_item_ex_i2d(pval, out, tt->item, tt->tag, aclass);
+ return ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), tt->tag, aclass);
}
/* Nothing special: treat as normal */
- return ASN1_item_ex_i2d(pval, out, tt->item, -1, 0);
+ return ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1, 0);
}
/* Temporary structure used to hold DER encoding of items for SET OF */
{
int i;
ASN1_VALUE *skitem;
- unsigned char *tmpdat, *p;
- DER_ENC *derlst, *tder;
+ unsigned char *tmpdat = NULL, *p = NULL;
+ DER_ENC *derlst = NULL, *tder;
if(do_sort) {
/* Don't need to sort less than 2 items */
if(sk_ASN1_VALUE_num(sk) < 2) do_sort = 0;