Skip to content

Commit

Permalink
RT2626: Change default_bits from 1K to 2K
Browse files Browse the repository at this point in the history
This is a more comprehensive fix.  It changes all
keygen apps to use 2K keys. It also changes the
default to use SHA256 not SHA1.  This is from
Kurt's upstream Debian changes.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
  • Loading branch information
kroeckx authored and Rich Salz committed Sep 8, 2014
1 parent 5f85556 commit 44e0c2b
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions apps/dhparam.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
#undef PROG
#define PROG dhparam_main

#define DEFBITS 512
#define DEFBITS 2048

/* -inform arg - input format - default PEM (DER or PEM)
* -outform arg - output format - default PEM
Expand Down Expand Up @@ -253,7 +253,7 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err," -C Output C code\n");
BIO_printf(bio_err," -2 generate parameters using 2 as the generator value\n");
BIO_printf(bio_err," -5 generate parameters using 5 as the generator value\n");
BIO_printf(bio_err," numbits number of bits in to generate (default 512)\n");
BIO_printf(bio_err," numbits number of bits in to generate (default 2048)\n");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
#endif
Expand Down
2 changes: 1 addition & 1 deletion apps/gendh.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
#include <openssl/x509.h>
#include <openssl/pem.h>

#define DEFBITS 512
#define DEFBITS 2048
#undef PROG
#define PROG gendh_main

Expand Down
2 changes: 1 addition & 1 deletion apps/genrsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
#include <openssl/pem.h>
#include <openssl/rand.h>

#define DEFBITS 1024
#define DEFBITS 2048
#undef PROG
#define PROG genrsa_main

Expand Down
2 changes: 1 addition & 1 deletion apps/openssl.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ emailAddress = optional

####################################################################
[ req ]
default_bits = 1024
default_bits = 2048
default_keyfile = privkey.pem
distinguished_name = req_distinguished_name
attributes = req_attributes
Expand Down
2 changes: 1 addition & 1 deletion crypto/dsa/dsa_ameth.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ static int dsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
#endif

case ASN1_PKEY_CTRL_DEFAULT_MD_NID:
*(int *)arg2 = NID_sha1;
*(int *)arg2 = NID_sha256;
return 2;

default:
Expand Down
2 changes: 1 addition & 1 deletion crypto/ec/ec_ameth.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ static int ec_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
#endif

case ASN1_PKEY_CTRL_DEFAULT_MD_NID:
*(int *)arg2 = NID_sha1;
*(int *)arg2 = NID_sha256;
return 2;

default:
Expand Down
2 changes: 1 addition & 1 deletion crypto/hmac/hm_ameth.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static int hmac_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
switch (op)
{
case ASN1_PKEY_CTRL_DEFAULT_MD_NID:
*(int *)arg2 = NID_sha1;
*(int *)arg2 = NID_sha256;
return 1;

default:
Expand Down
2 changes: 1 addition & 1 deletion crypto/rsa/rsa_ameth.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ static int rsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
#endif

case ASN1_PKEY_CTRL_DEFAULT_MD_NID:
*(int *)arg2 = NID_sha1;
*(int *)arg2 = NID_sha256;
return 1;

default:
Expand Down

0 comments on commit 44e0c2b

Please sign in to comment.