int filesize, unsigned char *sig, int siglen,
unsigned char **out, size_t *poutlen);
-static int only_rawin(const EVP_PKEY *pkey)
+static int is_EdDSA(const EVP_PKEY *pkey)
{
if (pkey == NULL)
return 0;
|| EVP_PKEY_is_a(pkey, "ED448");
}
+static int only_rawin(const EVP_PKEY *pkey)
+{
+ return is_EdDSA(pkey);
+}
+
typedef enum OPTION_choice {
OPT_COMMON,
OPT_ENGINE, OPT_ENGINE_IMPL, OPT_IN, OPT_OUT,
}
pkey = get_pkey(kdfalg, inkey, keyform, key_type, passinarg, pkey_op, e);
+
+ if (pkey_op == EVP_PKEY_OP_VERIFYRECOVER && !EVP_PKEY_is_a(pkey, "RSA")) {
+ BIO_printf(bio_err, "%s: -verifyrecover can be used only with RSA\n", prog);
+ goto end;
+ }
+
if (pkey_op == EVP_PKEY_OP_SIGN || pkey_op == EVP_PKEY_OP_VERIFY) {
if (only_rawin(pkey)) {
- if ((EVP_PKEY_is_a(pkey, "ED25519") || EVP_PKEY_is_a(pkey, "ED448"))
- && digestname != NULL) {
+ if (is_EdDSA(pkey) && digestname != NULL) {
BIO_printf(bio_err,
"%s: -digest (prehash) is not supported with EdDSA\n", prog);
EVP_PKEY_free(pkey);
setup("test_pkeyutl");
-plan tests => 24;
+plan tests => 25;
# For the tests below we use the cert itself as the TBS file
}
SKIP: {
- skip "Skipping tests that require ECX", 6
+ skip "Skipping tests that require ECX", 7
if disabled("ecx");
# Ed25519
'-inkey', srctop_file('test', 'certs', 'server-ed25519-cert.pem'),
'-sigfile', 'Ed25519.sig']))),
"Verify an Ed25519 signature against a piece of data");
+ ok(!run(app(([ 'openssl', 'pkeyutl', '-verifyrecover', '-in', 'Ed25519.sig',
+ '-inkey', srctop_file('test', 'certs', 'server-ed25519-key.pem')]))),
+ "Cannot use -verifyrecover with EdDSA");
# Ed448
ok(run(app(([ 'openssl', 'pkeyutl', '-sign', '-in',