Ejemplo n.º 1
0
void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value)
	{
	if (a->value.ptr != NULL)
		{
		ASN1_TYPE **tmp_a = &a;
		ASN1_primitive_free((ASN1_VALUE **)tmp_a, NULL);
		}
	a->type=type;
	a->value.ptr=value;
	}
Ejemplo n.º 2
0
void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value)
{
    if (a->value.ptr != NULL) {
        ASN1_TYPE **tmp_a = &a;
        ASN1_primitive_free((ASN1_VALUE **)tmp_a, NULL);
    }
    a->type = type;
    if (type == V_ASN1_BOOLEAN)
        a->value.boolean = value ? 0xff : 0;
    else
        a->value.ptr = value;
}
Ejemplo n.º 3
0
static void asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine)
{
    const ASN1_TEMPLATE *tt = NULL, *seqtt;
    const ASN1_EXTERN_FUNCS *ef;
    const ASN1_COMPAT_FUNCS *cf;
    const ASN1_AUX *aux = it->funcs;
    ASN1_AUX_cb *asn1_cb;
    int i;

    if ( !pval )
        return;
    if ( (it->itype != ASN1_ITYPE_PRIMITIVE) && !*pval )
        return;
    if ( aux && aux->asn1_cb )
        asn1_cb = aux->asn1_cb;
    else
        asn1_cb = 0;

    if ( it->templates )
        ASN1_template_free(pval, it->templates);
    else
        ASN1_primitive_free(pval, it);
}