summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f4364e0)
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.
#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);
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;
}
siglen = BIO_read(sigbio, sigbuf, siglen);
BIO_free(sigbio);
}
siglen = BIO_read(sigbio, sigbuf, siglen);
BIO_free(sigbio);
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);
}
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)
{
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
break;
case V_ASN1_OCTET_STRING:
break;
case V_ASN1_OCTET_STRING:
- hex_prin(out, av->value.bit_string->data,
- av->value.bit_string->length);
+ hex_prin(out, av->value.octet_string->data,
+ av->value.octet_string->length);
BIO_printf(out, "\n");
break;
case V_ASN1_BIT_STRING:
BIO_printf(out, "\n");
break;
case V_ASN1_BIT_STRING:
- hex_prin(out, av->value.octet_string->data,
- av->value.octet_string->length);
+ hex_prin(out, av->value.bit_string->data,
+ av->value.bit_string->length);
BIO_printf(out, "\n");
break;
BIO_printf(out, "\n");
break;