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

(manually cherry picked from commit b139a95)
  • Loading branch information
romen committed Mar 1, 2022
1 parent e5ba1a5 commit d77c002
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

Changes between 1.1.1m and 1.1.1n [xx XXX xxxx]

*)
*) Add ciphersuites based on DHE_PSK (RFC 4279) and ECDHE_PSK (RFC 5489)
to the list of ciphersuites providing Perfect Forward Secrecy as
required by SECLEVEL >= 3.

[Dmitry Belyavskiy, Nicola Tuveri]

Changes between 1.1.1l and 1.1.1m [14 Dec 2021]

Expand Down
5 changes: 3 additions & 2 deletions ssl/ssl_cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,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 @@ -936,8 +936,9 @@ static int ssl_security_default_callback(const SSL *s, const SSL_CTX *ctx,
if (level >= 2 && c->algorithm_enc == SSL_RC4)
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 d77c002

Please sign in to comment.