Print out UTF8 and NumericString types in ASN1 parsing utility.
[openssl.git] / crypto / asn1 / tasn_dec.c
index 61632a9dd2e2d1cb1c60e2455ed7a16b7c990cc9..6bab6d4a6f9e120072a993703492768a2e2c6b9e 100644 (file)
@@ -1,5 +1,5 @@
 /* tasn_dec.c */
-/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
+/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
  * project 2000.
  */
 /* ====================================================================
@@ -93,7 +93,7 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval,
                                int tag, int aclass, char opt, ASN1_TLC *ctx);
 
 /* Table to convert tags to bit values, used for MSTRING type */
-static unsigned long tag2bit[32] = {
+static const unsigned long tag2bit[32] = {
 0,     0,      0,      B_ASN1_BIT_STRING,      /* tags  0 -  3 */
 B_ASN1_OCTET_STRING,   0,      0,              B_ASN1_UNKNOWN,/* tags  4- 7 */
 B_ASN1_UNKNOWN,        B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, B_ASN1_UNKNOWN,/* tags  8-11 */
@@ -668,11 +668,12 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
                else
                        {
                        /* We've got a valid STACK: free up any items present */
-                       STACK *sktmp = (STACK *)*val;
+                       STACK_OF(ASN1_VALUE) *sktmp
+                           = (STACK_OF(ASN1_VALUE) *)*val;
                        ASN1_VALUE *vtmp;
-                       while(sk_num(sktmp) > 0)
+                       while(sk_ASN1_VALUE_num(sktmp) > 0)
                                {
-                               vtmp = (ASN1_VALUE *)sk_pop(sktmp);
+                               vtmp = sk_ASN1_VALUE_pop(sktmp);
                                ASN1_item_ex_free(&vtmp,
                                                ASN1_ITEM_ptr(tt->item));
                                }
@@ -713,7 +714,8 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
                                goto err;
                                }
                        len -= p - q;
-                       if (!sk_push((STACK *)*val, (char *)skfield))
+                       if (!sk_ASN1_VALUE_push((STACK_OF(ASN1_VALUE) *)*val,
+                                               skfield))
                                {
                                ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I,
                                                ERR_R_MALLOC_FAILURE);