Skip to content

Commit

Permalink
fixup! APPS/pkeyutl: improve -rawin usability (implied by Ed25519 and…
Browse files Browse the repository at this point in the history
… Ed448) and doc
  • Loading branch information
DDvO committed May 12, 2024
1 parent c7afe95 commit d6ecb4d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/pkeyutl.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,22 +293,26 @@ int pkeyutl_main(int argc, char **argv)
} else if (rawin) {
BIO_printf(bio_err,
"%s: -rawin can only be used with -sign or -verify\n", prog);
EVP_PKEY_free(pkey);
goto opthelp;
}
if (digestname != NULL && !rawin) {
BIO_printf(bio_err,
"%s: -digest can only be used with -rawin\n", prog);
EVP_PKEY_free(pkey);
goto opthelp;
}

if (rawin && rev) {
BIO_printf(bio_err, "%s: -rev cannot be used with raw input\n", prog);
EVP_PKEY_free(pkey);
goto opthelp;
}

if (rawin) {
if ((mctx = EVP_MD_CTX_new()) == NULL) {
BIO_printf(bio_err, "Error: out of memory\n");
EVP_PKEY_free(pkey);
goto end;
}
}
Expand Down Expand Up @@ -578,7 +582,7 @@ static EVP_PKEY *get_pkey(const char *kdfalg,
static EVP_PKEY_CTX *init_ctx(const char *kdfalg, int *pkeysize,
int pkey_op, ENGINE *e,
const int engine_impl, int rawin,
EVP_PKEY *pkey /* may get deallocated */,
EVP_PKEY *pkey /* ownership is passed to ctx */,
EVP_MD_CTX *mctx, const char *digestname,
OSSL_LIB_CTX *libctx, const char *propq)
{
Expand Down

0 comments on commit d6ecb4d

Please sign in to comment.