summaryrefslogtreecommitdiffstats
path: root/apps/dgst.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2000-09-19 17:51:11 +0000
committerDr. Stephen Henson <steve@openssl.org>2000-09-19 17:51:11 +0000
commit688fbf547568f6440cadbbf31cc9da1576a57f67 (patch)
tree67aa5c19601d49367e54e6a7c8e2cb62e16da062 /apps/dgst.c
parentf4364e0730a9c3468cfd7212dd75374ea3b0ea4f (diff)
Fix a typo in apps/pkcs12.c which was using the wrong part of
ASN1_TYPE (though they are both ASN1_STRING so it didn't cause any problems). Make 'siglen' an int in apps/dgst.c so we can check the return value of BIO_read() etc.
Diffstat (limited to 'apps/dgst.c')
-rw-r--r--apps/dgst.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/dgst.c b/apps/dgst.c
index 5d5ab94aea..d7e524a883 100644
--- 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,
- EVP_PKEY *key, unsigned char *sigin, unsigned int siglen);
+ EVP_PKEY *key, unsigned char *sigin, int siglen);
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;
- unsigned int siglen = 0;
+ int siglen = 0;
apps_startup();
@@ -280,7 +280,7 @@ int MAIN(int argc, char **argv)
}
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);
@@ -331,7 +331,7 @@ end:
}
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;
@@ -345,7 +345,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);
- 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