Skip to content

Commit

Permalink
[ssl] Add SSL_kDHEPSK and SSL_kECDHEPSK as PFS ciphersuites for SECLE…
Browse files Browse the repository at this point in the history
…VEL >= 3

Fixes openssl#17743
  • Loading branch information
romen committed Feb 23, 2022
1 parent b22dc06 commit ecd3acc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ssl/ssl_cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ static int ssl_security_default_callback(const SSL *s, const SSL_CTX *ctx,
int op, int bits, int nid, void *other,
void *ex)
{
int level, minbits;
int level, minbits, pfs_mask;

minbits = ssl_get_security_level_bits(s, ctx, &level);

Expand Down Expand Up @@ -1033,8 +1033,9 @@ static int ssl_security_default_callback(const SSL *s, const SSL_CTX *ctx,
if (minbits > 160 && c->algorithm_mac & SSL_SHA1)
return 0;
/* Level 3: forward secure ciphersuites only */
pfs_mask = SSL_kDHE | SSL_kECDHE | SSL_kDHEPSK | SSL_kECDHEPSK;
if (level >= 3 && c->min_tls != TLS1_3_VERSION &&
!(c->algorithm_mkey & (SSL_kDHE | SSL_kECDHE)))
!(c->algorithm_mkey & pfs_mask))
return 0;
break;
}
Expand Down

0 comments on commit ecd3acc

Please sign in to comment.