case OPT_QUERY:
case OPT_REPLY:
case OPT_VERIFY:
- if (mode != OPT_ERR)
+ if (mode != OPT_ERR) {
+ BIO_printf(bio_err, "%s: Must give only one of -query, -reply, or -verify\n", prog);
goto opthelp;
+ }
mode = o;
break;
case OPT_DATA:
}
/* No extra arguments. */
- argc = opt_num_rest();
- if (argc != 0 || mode == OPT_ERR)
+ if (!opt_check_rest_arg(NULL))
+ goto opthelp;
+ if (mode == OPT_ERR) {
+ BIO_printf(bio_err, "%s: Must give one of -query, -reply, or -verify\n", prog);
goto opthelp;
+ }
if (!app_RAND_load())
goto end;
- if (digestname != NULL) {
- if (!opt_md(digestname, &md))
- goto opthelp;
- }
+ if (!opt_md(digestname, &md))
+ goto opthelp;
if (mode == OPT_REPLY && passin &&
!app_passwd(passin, NULL, &password, NULL)) {
BIO_printf(bio_err, "Error getting password.\n");
goto err;
if ((algo = X509_ALGOR_new()) == NULL)
goto err;
- if ((algo->algorithm = OBJ_nid2obj(EVP_MD_type(md))) == NULL)
+ if ((algo->algorithm = OBJ_nid2obj(EVP_MD_get_type(md))) == NULL)
goto err;
if ((algo->parameter = ASN1_TYPE_new()) == NULL)
goto err;
int rv = 0;
EVP_MD_CTX *md_ctx = NULL;
- md_value_len = EVP_MD_size(md);
+ md_value_len = EVP_MD_get_size(md);
if (md_value_len < 0)
return 0;
}
if (!EVP_DigestFinal(md_ctx, *md_value, NULL))
goto err;
- md_value_len = EVP_MD_size(md);
+ md_value_len = EVP_MD_get_size(md);
} else {
long digest_len;