| Index: openssl/crypto/asn1/tasn_new.c
|
| ===================================================================
|
| --- openssl/crypto/asn1/tasn_new.c (revision 105093)
|
| +++ openssl/crypto/asn1/tasn_new.c (working copy)
|
| @@ -68,7 +68,7 @@
|
| int combine);
|
| static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
| static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
|
| -void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
| +static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
|
|
| ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it)
|
| {
|
| @@ -146,7 +146,7 @@
|
| case ASN1_ITYPE_CHOICE:
|
| if (asn1_cb)
|
| {
|
| - i = asn1_cb(ASN1_OP_NEW_PRE, pval, it);
|
| + i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
|
| if (!i)
|
| goto auxerr;
|
| if (i==2)
|
| @@ -166,7 +166,7 @@
|
| memset(*pval, 0, it->size);
|
| }
|
| asn1_set_choice_selector(pval, -1, it);
|
| - if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it))
|
| + if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
|
| goto auxerr;
|
| break;
|
|
|
| @@ -174,7 +174,7 @@
|
| case ASN1_ITYPE_SEQUENCE:
|
| if (asn1_cb)
|
| {
|
| - i = asn1_cb(ASN1_OP_NEW_PRE, pval, it);
|
| + i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
|
| if (!i)
|
| goto auxerr;
|
| if (i==2)
|
| @@ -201,7 +201,7 @@
|
| if (!ASN1_template_new(pseqval, tt))
|
| goto memerr;
|
| }
|
| - if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it))
|
| + if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
|
| goto auxerr;
|
| break;
|
| }
|
| @@ -325,6 +325,7 @@
|
| int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
|
| {
|
| ASN1_TYPE *typ;
|
| + ASN1_STRING *str;
|
| int utype;
|
|
|
| if (it && it->funcs)
|
| @@ -345,10 +346,7 @@
|
| return 1;
|
|
|
| case V_ASN1_BOOLEAN:
|
| - if (it)
|
| - *(ASN1_BOOLEAN *)pval = it->size;
|
| - else
|
| - *(ASN1_BOOLEAN *)pval = -1;
|
| + *(ASN1_BOOLEAN *)pval = it->size;
|
| return 1;
|
|
|
| case V_ASN1_NULL:
|
| @@ -365,7 +363,10 @@
|
| break;
|
|
|
| default:
|
| - *pval = (ASN1_VALUE *)ASN1_STRING_type_new(utype);
|
| + str = ASN1_STRING_type_new(utype);
|
| + if (it->itype == ASN1_ITYPE_MSTRING && str)
|
| + str->flags |= ASN1_STRING_FLAG_MSTRING;
|
| + *pval = (ASN1_VALUE *)str;
|
| break;
|
| }
|
| if (*pval)
|
| @@ -373,7 +374,7 @@
|
| return 0;
|
| }
|
|
|
| -void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)
|
| +static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)
|
| {
|
| int utype;
|
| if (it && it->funcs)
|
|
|