Merge branch 'sct-viewer-master' of https://github.com/robstradling/openssl into...
[openssl.git] / crypto / asn1 / tasn_prn.c
index d2830a5eaddeb3368414ff78329f18f94167b5f7..542a091a66767e303425a90d19cb8ce06502a0c8 100644 (file)
@@ -1,5 +1,5 @@
 /* tasn_prn.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.
  */
 /* ====================================================================
@@ -354,6 +354,8 @@ int asn1_template_print_ctx(BIO *out, ASN1_VALUE **fld, int indent,
                {
                char *tname;
                ASN1_VALUE *skitem;
+               STACK_OF(ASN1_VALUE) *stack;
+
                /* SET OF, SEQUENCE OF */
                if (fname)
                        {
@@ -371,12 +373,13 @@ int asn1_template_print_ctx(BIO *out, ASN1_VALUE **fld, int indent,
                                        fname) <= 0)
                                return 0;
                        }
-               for(i = 0; i < sk_num((STACK *)*fld); i++)
+               stack = (STACK_OF(ASN1_VALUE) *)*fld;
+               for(i = 0; i < sk_ASN1_VALUE_num(stack); i++)
                        {
                        if ((i > 0) && (BIO_puts(out, "\n") <= 0))
                                return 0;
 
-                       skitem = (ASN1_VALUE *)sk_value((STACK *)*fld, i);
+                       skitem = sk_ASN1_VALUE_value(stack, i);
                        if (!asn1_item_print_ctx(out, &skitem, indent + 2,
                                ASN1_ITEM_ptr(tt->item), NULL, NULL, 1, pctx))
                                return 0;
@@ -443,11 +446,11 @@ static int asn1_print_fsname(BIO *out, int indent,
        return 1;
        }
 
-static int asn1_print_boolean_ctx(BIO *out, const int bool,
+static int asn1_print_boolean_ctx(BIO *out, int boolval,
                                                        const ASN1_PCTX *pctx)
        {
        const char *str;
-       switch (bool)
+       switch (boolval)
                {
                case -1:
                str = "BOOL ABSENT";
@@ -571,10 +574,10 @@ static int asn1_primitive_print(BIO *out, ASN1_VALUE **fld,
                {
                case V_ASN1_BOOLEAN:
                        {
-                       int bool = *(int *)fld;
-                       if (bool == -1)
-                               bool = it->size;
-                       ret = asn1_print_boolean_ctx(out, bool, pctx);
+                       int boolval = *(int *)fld;
+                       if (boolval == -1)
+                               boolval = it->size;
+                       ret = asn1_print_boolean_ctx(out, boolval, pctx);
                        }
                break;