diff options
author | Dmitry Belyavsky <beldmit@gmail.com> | 2016-09-19 15:53:35 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-09-22 09:28:07 +0100 |
commit | d3c9d6e99f075e6fbdab94db00b220cfa08b5c4b (patch) | |
tree | 6266d94b62d7d63a4f7e8cd61e47c813d941f4cf /ssl | |
parent | 63658103d4441924f8dbfc517b99bb54758a98b9 (diff) |
Avoid KCI attack for GOST
Russian GOST ciphersuites are vulnerable to the KCI attack because they use
long-term keys to establish the connection when ssl client authorization is
on. This change brings the GOST implementation into line with the latest
specs in order to avoid the attack. It should not break backwards
compatibility.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/statem/statem_clnt.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c index ff42858ff3..692544b32c 100644 --- a/ssl/statem/statem_clnt.c +++ b/ssl/statem/statem_clnt.c @@ -2379,18 +2379,6 @@ static int tls_construct_cke_gost(SSL *s, unsigned char **p, int *len, int *al) goto err; }; /* - * If we have client certificate, use its secret as peer key - */ - if (s->s3->tmp.cert_req && s->cert->key->privatekey) { - if (EVP_PKEY_derive_set_peer(pkey_ctx, s->cert->key->privatekey) <= 0) { - /* - * If there was an error - just ignore it. Ephemeral key - * * would be used - */ - ERR_clear_error(); - } - } - /* * Compute shared IV and store it in algorithm-specific context * data */ @@ -2434,12 +2422,7 @@ static int tls_construct_cke_gost(SSL *s, unsigned char **p, int *len, int *al) *len = msglen + 2; } memcpy(*p, tmp, msglen); - /* Check if pubkey from client certificate was used */ - if (EVP_PKEY_CTX_ctrl(pkey_ctx, -1, -1, EVP_PKEY_CTRL_PEER_KEY, 2, - NULL) > 0) { - /* Set flag "skip certificate verify" */ - s->s3->flags |= TLS1_FLAGS_SKIP_CERT_VERIFY; - } + EVP_PKEY_CTX_free(pkey_ctx); s->s3->tmp.pms = pms; s->s3->tmp.pmslen = pmslen; |