Commit 44c734e9 authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

embed support for CHOICE type



Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
parent 71a64af3
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -125,8 +125,10 @@ static void asn1_item_embed_free(ASN1_VALUE **pval, const ASN1_ITEM *it,
        }
        if (asn1_cb)
            asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL);
        if (embed == 0) {
            OPENSSL_free(*pval);
            *pval = NULL;
        }
        break;

    case ASN1_ITYPE_EXTERN:
+7 −3
Original line number Diff line number Diff line
@@ -142,9 +142,13 @@ int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed)
                return 1;
            }
        }
        if (embed) {
            memset(*pval, 0, it->size);
        } else {
            *pval = OPENSSL_zalloc(it->size);
            if (!*pval)
                goto memerr;
        }
        asn1_set_choice_selector(pval, -1, it);
        if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
            goto auxerr;