diff options
author | Ben Laurie <ben@openssl.org> | 1999-01-07 00:10:32 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 1999-01-07 00:10:32 +0000 |
commit | bc4deee07a53228db7a8962519f05e904eb4b670 (patch) | |
tree | d2813aeeafe79030ce2f69b2f64d437b89effe22 /apps/req.c | |
parent | 5b00115ab0d1e19f374a8feb20e003514e03a7cb (diff) |
Fix numeric -newkey args.
Contributed by: Bodo Moeller <3moeller@informatik.uni-hamburg.de>
Diffstat (limited to 'apps/req.c')
-rw-r--r-- | apps/req.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/req.c b/apps/req.c index 1c07c3cdc0..f37616feff 100644 --- a/apps/req.c +++ b/apps/req.c @@ -221,13 +221,16 @@ char **argv; } else if (strcmp(*argv,"-newkey") == 0) { + int is_numeric; + if (--argc < 1) goto bad; p= *(++argv); - if ((strncmp("rsa:",p,4) == 0) || - ((p[0] >= '0') && (p[0] <= '9'))) + is_numeric = p[0] >= '0' && p[0] <= '9'; + if (strncmp("rsa:",p,4) == 0 || is_numeric) { pkey_type=TYPE_RSA; - p+=4; + if(!is_numeric) + p+=4; newkey= atoi(p); } else |