Fix typos in apps/apps.c
[openssl.git] / apps / x509.c
index 294fc69573fe00b4325c278a4c3f37748d8000f1..393d0d1f47c3235b1b3f9c15e54f716cc3d26f6f 100644 (file)
@@ -83,7 +83,7 @@
 #define        POSTFIX ".srl"
 #define DEF_DAYS       30
 
-static char *x509_usage[]={
+static const char *x509_usage[]={
 "usage: x509 args\n",
 " -inform arg     - input format - default PEM (one of DER, NET or PEM)\n",
 " -outform arg    - output format - default PEM (one of DER, NET or PEM)\n",
@@ -179,12 +179,12 @@ int MAIN(int argc, char **argv)
        int C=0;
        int x509req=0,days=DEF_DAYS,modulus=0,pubkey=0;
        int pprint = 0;
-       char **pp;
+       const char **pp;
        X509_STORE *ctx=NULL;
        X509_REQ *rq=NULL;
        int fingerprint=0;
        char buf[256];
-       const EVP_MD *md_alg,*digest=EVP_md5();
+       const EVP_MD *md_alg,*digest=EVP_sha1();
        CONF *extconf = NULL;
        char *extsect = NULL, *extfile = NULL, *passin = NULL, *passargin = NULL;
        int need_rand = 0;
@@ -1038,8 +1038,7 @@ bad:
                ah.data=(char *)x;
                ah.meth=X509_asn1_meth();
 
-               /* no macro for this one yet */
-               i=ASN1_i2d_bio(i2d_ASN1_HEADER,out,(unsigned char *)&ah);
+               i=ASN1_i2d_bio_of(ASN1_HEADER,i2d_ASN1_HEADER,out,&ah);
                }
        else    {
                BIO_printf(bio_err,"bad output format specified for outfile\n");