register the engine as default engine in ENGINE_set_default()
[openssl.git] / apps / asn1pars.c
index 305db1590359068f9e7360cbcd43a21faf5d94b6..b1a7c8e5dbf8b592c2efbee1940f178616edf523 100644 (file)
@@ -196,7 +196,7 @@ int MAIN(int argc, char **argv)
 bad:
                BIO_printf(bio_err,"%s [options] <infile\n",prog);
                BIO_printf(bio_err,"where options are\n");
-               BIO_printf(bio_err," -inform arg   input format - one of DER TXT PEM\n");
+               BIO_printf(bio_err," -inform arg   input format - one of DER PEM\n");
                BIO_printf(bio_err," -in arg       input file\n");
                BIO_printf(bio_err," -out arg      output file (output format is always DER\n");
                BIO_printf(bio_err," -noout arg    don't produce any output\n");
@@ -309,6 +309,7 @@ bad:
                for (i=0; i<sk_num(osk); i++)
                        {
                        ASN1_TYPE *atmp;
+                       int typ;
                        j=atoi(sk_value(osk,i));
                        if (j == 0)
                                {
@@ -327,6 +328,15 @@ bad:
                                ERR_print_errors(bio_err);
                                goto end;
                                }
+                       typ = ASN1_TYPE_get(at);
+                       if ((typ == V_ASN1_OBJECT)
+                               || (typ == V_ASN1_NULL))
+                               {
+                               BIO_printf(bio_err, "Can't parse %s type\n",
+                                       typ == V_ASN1_NULL ? "NULL" : "OBJECT");
+                               ERR_print_errors(bio_err);
+                               goto end;
+                               }
                        /* hmm... this is a little evil but it works */
                        tmpbuf=at->value.asn1_string->data;
                        tmplen=at->value.asn1_string->length;