summaryrefslogtreecommitdiffstats
path: root/apps/genpkey.c
diff options
context:
space:
mode:
authorDavid von Oheimb <David.von.Oheimb@siemens.com>2018-05-10 21:14:12 +0200
committerMatt Caswell <matt@openssl.org>2018-06-18 11:45:35 +0200
commit49c9c1b3d05782fe76bef2eef8c5224baf843240 (patch)
treeb46b18ca01a027ae1960e6986c408134394538aa /apps/genpkey.c
parentremove needless and misleading malloc failure error messages of PKCS12_SAFEBA... (diff)
downloadopenssl-49c9c1b3d05782fe76bef2eef8c5224baf843240.tar.xz
openssl-49c9c1b3d05782fe76bef2eef8c5224baf843240.zip
add 'unsupported cipher mode' diagnostics to evp_lib.c and genpkey.c
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6217)
Diffstat (limited to 'apps/genpkey.c')
-rw-r--r--apps/genpkey.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/genpkey.c b/apps/genpkey.c
index ce6de94ff2..39fa73c91c 100644
--- a/apps/genpkey.c
+++ b/apps/genpkey.c
@@ -120,6 +120,13 @@ int genpkey_main(int argc, char **argv)
if (!opt_cipher(opt_unknown(), &cipher)
|| do_param == 1)
goto opthelp;
+ if (EVP_CIPHER_mode(cipher) == EVP_CIPH_GCM_MODE ||
+ EVP_CIPHER_mode(cipher) == EVP_CIPH_CCM_MODE ||
+ EVP_CIPHER_mode(cipher) == EVP_CIPH_XTS_MODE ||
+ EVP_CIPHER_mode(cipher) == EVP_CIPH_OCB_MODE) {
+ BIO_printf(bio_err, "%s: cipher mode not supported\n", prog);
+ goto end;
+ }
}
}
argc = opt_num_rest();