Skip to content

Commit

Permalink
Allow config of dh_min_bits < 2048
Browse files Browse the repository at this point in the history
Allow configuration to override the default dh_min_bits of 2048 to
1024.  Disallow configuration of dh_min_bits < 1024, but continue to
default to 2048.

(cherry picked from commit cae44d2)

ticket: 7602
version_fixed: 1.11.3
status: resolved
  • Loading branch information
tlyu committed Apr 25, 2013
1 parent 5d2c49d commit dfaaf09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/plugins/preauth/pkinit/pkinit.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ extern int longhorn; /* XXX Talking to a Longhorn server? */
#define PKINIT_REQ_CTX_MAGIC 0xdeadbeef

#define PKINIT_DEFAULT_DH_MIN_BITS 2048
#define PKINIT_DH_MIN_CONFIG_BITS 1024

#define KRB5_CONF_KDCDEFAULTS "kdcdefaults"
#define KRB5_CONF_LIBDEFAULTS "libdefaults"
Expand Down
7 changes: 4 additions & 3 deletions src/plugins/preauth/pkinit/pkinit_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,10 +1184,11 @@ pkinit_init_kdc_profile(krb5_context context, pkinit_kdc_context plgctx)
KRB5_CONF_PKINIT_DH_MIN_BITS,
PKINIT_DEFAULT_DH_MIN_BITS,
&plgctx->opts->dh_min_bits);
if (plgctx->opts->dh_min_bits < PKINIT_DEFAULT_DH_MIN_BITS) {
pkiDebug("%s: invalid value (%d) for pkinit_dh_min_bits, "
if (plgctx->opts->dh_min_bits < PKINIT_DH_MIN_CONFIG_BITS) {
pkiDebug("%s: invalid value (%d < %d) for pkinit_dh_min_bits, "
"using default value (%d) instead\n", __FUNCTION__,
plgctx->opts->dh_min_bits, PKINIT_DEFAULT_DH_MIN_BITS);
plgctx->opts->dh_min_bits, PKINIT_DH_MIN_CONFIG_BITS,
PKINIT_DEFAULT_DH_MIN_BITS);
plgctx->opts->dh_min_bits = PKINIT_DEFAULT_DH_MIN_BITS;
}

Expand Down

0 comments on commit dfaaf09

Please sign in to comment.