projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid a warning.
[oweals/openssl.git]
/
apps
/
dgst.c
diff --git
a/apps/dgst.c
b/apps/dgst.c
index 6d7a1787f4a12aec1e6f7b4f01397aa23d64bf4a..9107a5230d1917064ca65d8abbce7e8ba6bfe7aa 100644
(file)
--- a/
apps/dgst.c
+++ b/
apps/dgst.c
@@
-1,5
+1,5
@@
/* apps/dgst.c */
/* apps/dgst.c */
-/* Copyright (C) 1995-199
7
Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-199
8
Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* All rights reserved.
*
* This package is an SSL implementation written
@@
-60,12
+60,12
@@
#include <string.h>
#include <stdlib.h>
#include "apps.h"
#include <string.h>
#include <stdlib.h>
#include "apps.h"
-#include
"bio.h"
-#include
"err.h"
-#include
"evp.h"
-#include
"objects.h"
-#include
"x509.h"
-#include
"pem.h"
+#include
<openssl/bio.h>
+#include
<openssl/err.h>
+#include
<openssl/evp.h>
+#include
<openssl/objects.h>
+#include
<openssl/x509.h>
+#include
<openssl/pem.h>
#undef BUFSIZE
#define BUFSIZE 1024*8
#undef BUFSIZE
#define BUFSIZE 1024*8
@@
-73,22
+73,15
@@
#undef PROG
#define PROG dgst_main
#undef PROG
#define PROG dgst_main
-#ifndef NOPROTO
void do_fp(unsigned char *buf,BIO *f,int sep);
void do_fp(unsigned char *buf,BIO *f,int sep);
-#else
-void do_fp();
-#endif
-
-int MAIN(argc,argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
unsigned char *buf=NULL;
int i,err=0;
{
unsigned char *buf=NULL;
int i,err=0;
- EVP_MD *md=NULL,*m;
+
const
EVP_MD *md=NULL,*m;
BIO *in=NULL,*inp;
BIO *bmd=NULL;
BIO *in=NULL,*inp;
BIO *bmd=NULL;
- char *name;
+ c
onst c
har *name;
#define PROG_NAME_SIZE 16
char pname[PROG_NAME_SIZE];
int separator=0;
#define PROG_NAME_SIZE 16
char pname[PROG_NAME_SIZE];
int separator=0;
@@
-103,7
+96,7
@@
char **argv;
}
if (bio_err == NULL)
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
}
if (bio_err == NULL)
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
- BIO_set_fp(bio_err,stderr,BIO_NOCLOSE);
+ BIO_set_fp(bio_err,stderr,BIO_NOCLOSE
|BIO_FP_TEXT
);
/* first check the program name */
program_name(argv[0],pname,PROG_NAME_SIZE);
/* first check the program name */
program_name(argv[0],pname,PROG_NAME_SIZE);
@@
-112,7
+105,7
@@
char **argv;
argc--;
argv++;
argc--;
argv++;
-
for (i=0; i<argc; i++
)
+
while (argc > 0
)
{
if ((*argv)[0] != '-') break;
if (strcmp(*argv,"-c") == 0)
{
if ((*argv)[0] != '-') break;
if (strcmp(*argv,"-c") == 0)
@@
-135,17
+128,19
@@
char **argv;
BIO_printf(bio_err,"unknown option '%s'\n",*argv);
BIO_printf(bio_err,"options are\n");
BIO_printf(bio_err,"-c to output the digest with separating colons\n");
BIO_printf(bio_err,"unknown option '%s'\n",*argv);
BIO_printf(bio_err,"options are\n");
BIO_printf(bio_err,"-c to output the digest with separating colons\n");
- BIO_printf(bio_err,"-
c
to output debug info\n");
- BIO_printf(bio_err,"-%3s to use the %s message digest al
o
gorithm (default)\n",
+ BIO_printf(bio_err,"-
d
to output debug info\n");
+ BIO_printf(bio_err,"-%3s to use the %s message digest algorithm (default)\n",
LN_md5,LN_md5);
LN_md5,LN_md5);
- BIO_printf(bio_err,"-%3s to use the %s message digest al
o
gorithm\n",
+ BIO_printf(bio_err,"-%3s to use the %s message digest algorithm\n",
LN_md2,LN_md2);
LN_md2,LN_md2);
- BIO_printf(bio_err,"-%3s to use the %s message digest al
o
gorithm\n",
+ BIO_printf(bio_err,"-%3s to use the %s message digest algorithm\n",
LN_sha1,LN_sha1);
LN_sha1,LN_sha1);
- BIO_printf(bio_err,"-%3s to use the %s message digest al
o
gorithm\n",
+ BIO_printf(bio_err,"-%3s to use the %s message digest algorithm\n",
LN_sha,LN_sha);
LN_sha,LN_sha);
- BIO_printf(bio_err,"-%3s to use the %s message digest al
o
gorithm\n",
+ BIO_printf(bio_err,"-%3s to use the %s message digest algorithm\n",
LN_mdc2,LN_mdc2);
LN_mdc2,LN_mdc2);
+ BIO_printf(bio_err,"-%3s to use the %s message digest algorithm\n",
+ LN_ripemd160,LN_ripemd160);
err=1;
goto end;
}
err=1;
goto end;
}
@@
-201,10
+196,7
@@
end:
EXIT(err);
}
EXIT(err);
}
-void do_fp(buf,bp,sep)
-unsigned char *buf;
-BIO *bp;
-int sep;
+void do_fp(unsigned char *buf, BIO *bp, int sep)
{
int len;
int i;
{
int len;
int i;