summaryrefslogtreecommitdiffstats
path: root/apps/rsa.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2020-10-20 13:32:26 +1000
committerRichard Levitte <levitte@openssl.org>2020-12-17 21:09:54 +0100
commit47422549da431cf9546a148d916d162e196fcd44 (patch)
treea09cdee887b43d97878a2c1382b6df8b48fddc5e /apps/rsa.c
parent575b36ecefca4eff181210ff1eeb3a3dcfbf5456 (diff)
dsa: apps deprecation changes
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13638)
Diffstat (limited to 'apps/rsa.c')
-rw-r--r--apps/rsa.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/rsa.c b/apps/rsa.c
index bdfbcf07b8..b65c8fc793 100644
--- a/apps/rsa.c
+++ b/apps/rsa.c
@@ -30,6 +30,12 @@
*/
#include <openssl/core_dispatch.h>
+#ifndef OPENSSL_NO_RC4
+# define DEFAULT_PVK_ENCR_STRENGTH 2
+#else
+# define DEFAULT_PVK_ENCR_STRENGTH 0
+#endif
+
typedef enum OPTION_choice {
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
OPT_INFORM, OPT_OUTFORM, OPT_ENGINE, OPT_IN, OPT_OUT,
@@ -69,10 +75,12 @@ const OPTIONS rsa_options[] = {
{"traditional", OPT_TRADITIONAL, '-',
"Use traditional format for private keys"},
+#ifndef OPENSSL_NO_RC4
OPT_SECTION("PVK"),
{"pvk-strong", OPT_PVK_STRONG, '-', "Enable 'Strong' PVK encoding level (default)"},
{"pvk-weak", OPT_PVK_WEAK, '-', "Enable 'Weak' PVK encoding level"},
{"pvk-none", OPT_PVK_NONE, '-', "Don't enforce PVK encoding"},
+#endif
OPT_PROV_OPTIONS,
{NULL}
@@ -90,7 +98,7 @@ int rsa_main(int argc, char **argv)
int private = 0;
int informat = FORMAT_PEM, outformat = FORMAT_PEM, text = 0, check = 0;
int noout = 0, modulus = 0, pubin = 0, pubout = 0, ret = 1;
- int pvk_encr = 2;
+ int pvk_encr = DEFAULT_PVK_ENCR_STRENGTH;
OPTION_CHOICE o;
int traditional = 0;
const char *output_type = NULL;