diff options
-rw-r--r-- | apps/asn1pars.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/asn1pars.c b/apps/asn1pars.c index d3b1970def..64a2d850cb 100644 --- a/apps/asn1pars.c +++ b/apps/asn1pars.c @@ -61,7 +61,8 @@ int asn1parse_main(int argc, char **argv) BUF_MEM *buf = NULL; STACK_OF(OPENSSL_STRING) *osk = NULL; char *genstr = NULL, *genconf = NULL; - char *infile = NULL, *str = NULL, *oidfile = NULL, *derfile = NULL; + char *infile = NULL, *oidfile = NULL, *derfile = NULL; + unsigned char *str = NULL; char *name = NULL, *header = NULL, *prog; const unsigned char *ctmpbuf; int indent = 0, noout = 0, dump = 0, strictpem = 0, informat = FORMAT_PEM; @@ -154,7 +155,7 @@ int asn1parse_main(int argc, char **argv) goto end; if (strictpem) { - if (PEM_read_bio(in, &name, &header, (unsigned char **)&str, &num) != + if (PEM_read_bio(in, &name, &header, &str, &num) != 1) { BIO_printf(bio_err, "Error reading PEM file\n"); ERR_print_errors(bio_err); @@ -198,14 +199,14 @@ int asn1parse_main(int argc, char **argv) num += i; } } - str = buf->data; + str = (unsigned char *)buf->data; } /* If any structs to parse go through in sequence */ if (sk_OPENSSL_STRING_num(osk)) { - tmpbuf = (unsigned char *)str; + tmpbuf = str; tmplen = num; for (i = 0; i < sk_OPENSSL_STRING_num(osk); i++) { ASN1_TYPE *atmp; @@ -239,7 +240,7 @@ int asn1parse_main(int argc, char **argv) tmpbuf = at->value.asn1_string->data; tmplen = at->value.asn1_string->length; } - str = (char *)tmpbuf; + str = tmpbuf; num = tmplen; } @@ -260,7 +261,7 @@ int asn1parse_main(int argc, char **argv) } } if (!noout && - !ASN1_parse_dump(bio_out, (unsigned char *)&(str[offset]), length, + !ASN1_parse_dump(bio_out, &(str[offset]), length, indent, dump)) { ERR_print_errors(bio_err); goto end; |