projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Always return a value.
[oweals/openssl.git]
/
apps
/
dgst.c
diff --git
a/apps/dgst.c
b/apps/dgst.c
index 5d5ab94aea01ee5a1b7005d7be28ba0976ba27cb..0e93c97ca507659450d1d3e89def60ebec675738 100644
(file)
--- a/
apps/dgst.c
+++ b/
apps/dgst.c
@@
-74,7
+74,7
@@
#define PROG dgst_main
void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, char binout,
#define PROG dgst_main
void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, char binout,
- EVP_PKEY *key, unsigned char *sigin,
unsigned
int siglen);
+ EVP_PKEY *key, unsigned char *sigin, int siglen);
int MAIN(int, char **);
int MAIN(int, char **);
@@
-96,7
+96,7
@@
int MAIN(int argc, char **argv)
char out_bin = -1, want_pub = 0, do_verify = 0;
EVP_PKEY *sigkey = NULL;
unsigned char *sigbuf = NULL;
char out_bin = -1, want_pub = 0, do_verify = 0;
EVP_PKEY *sigkey = NULL;
unsigned char *sigbuf = NULL;
-
unsigned
int siglen = 0;
+ int siglen = 0;
apps_startup();
apps_startup();
@@
-236,7
+236,15
@@
int MAIN(int argc, char **argv)
if(out_bin)
out = BIO_new_file(outfile, "wb");
else out = BIO_new_file(outfile, "w");
if(out_bin)
out = BIO_new_file(outfile, "wb");
else out = BIO_new_file(outfile, "w");
- } else out = BIO_new_fp(stdout, BIO_NOCLOSE);
+ } else {
+ out = BIO_new_fp(stdout, BIO_NOCLOSE);
+#ifdef VMS
+ {
+ BIO *tmpbio = BIO_new(BIO_f_linebuffer());
+ out = BIO_push(tmpbio, out);
+ }
+#endif
+ }
if(!out) {
BIO_printf(bio_err, "Error opening output file %s\n",
if(!out) {
BIO_printf(bio_err, "Error opening output file %s\n",
@@
-280,7
+288,7
@@
int MAIN(int argc, char **argv)
}
siglen = BIO_read(sigbio, sigbuf, siglen);
BIO_free(sigbio);
}
siglen = BIO_read(sigbio, sigbuf, siglen);
BIO_free(sigbio);
- if(siglen
=
= 0) {
+ if(siglen
<
= 0) {
BIO_printf(bio_err, "Error reading signature file %s\n",
sigfile);
ERR_print_errors(bio_err);
BIO_printf(bio_err, "Error reading signature file %s\n",
sigfile);
ERR_print_errors(bio_err);
@@
-323,7
+331,7
@@
end:
OPENSSL_free(buf);
}
if (in != NULL) BIO_free(in);
OPENSSL_free(buf);
}
if (in != NULL) BIO_free(in);
- BIO_free(out);
+ BIO_free
_all
(out);
EVP_PKEY_free(sigkey);
if(sigbuf) OPENSSL_free(sigbuf);
if (bmd != NULL) BIO_free(bmd);
EVP_PKEY_free(sigkey);
if(sigbuf) OPENSSL_free(sigbuf);
if (bmd != NULL) BIO_free(bmd);
@@
-331,7
+339,7
@@
end:
}
void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, char binout,
}
void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, char binout,
- EVP_PKEY *key, unsigned char *sigin,
unsigned
int siglen)
+ EVP_PKEY *key, unsigned char *sigin, int siglen)
{
int len;
int i;
{
int len;
int i;
@@
-345,7
+353,7
@@
void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, char binout,
{
EVP_MD_CTX *ctx;
BIO_get_md_ctx(bp, &ctx);
{
EVP_MD_CTX *ctx;
BIO_get_md_ctx(bp, &ctx);
- i = EVP_VerifyFinal(ctx, sigin, siglen, key);
+ i = EVP_VerifyFinal(ctx, sigin,
(unsigned int)
siglen, key);
if(i > 0) BIO_printf(out, "Verified OK\n");
else if(i == 0) BIO_printf(out, "Verification Failure\n");
else
if(i > 0) BIO_printf(out, "Verified OK\n");
else if(i == 0) BIO_printf(out, "Verification Failure\n");
else