summaryrefslogtreecommitdiffstats
path: root/ssl/s3_srvr.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2014-08-01 14:56:56 +0100
committerMatt Caswell <matt@openssl.org>2014-08-06 20:41:53 +0100
commitbb4c9ffd02a74057f7f6fd807c5be5d1f807b831 (patch)
treea324268665752ea2f2126649ff502777b592520e /ssl/s3_srvr.c
parent53348780e9936f49b4ced7459e32d0bebbf9e8fa (diff)
Check SRP parameters early.
Check SRP parameters when they are received so we can send back an appropriate alert. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Diffstat (limited to 'ssl/s3_srvr.c')
-rw-r--r--ssl/s3_srvr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c
index ce14fb6f69..0c998a1fde 100644
--- a/ssl/s3_srvr.c
+++ b/ssl/s3_srvr.c
@@ -2847,6 +2847,13 @@ int ssl3_get_client_key_exchange(SSL *s)
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,ERR_R_BN_LIB);
goto err;
}
+ if (BN_ucmp(s->srp_ctx.A, s->srp_ctx.N) >= 0
+ || BN_is_zero(s->srp_ctx.A))
+ {
+ al=SSL_AD_ILLEGAL_PARAMETER;
+ SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BAD_SRP_PARAMETERS);
+ goto f_err;
+ }
if (s->session->srp_username != NULL)
OPENSSL_free(s->session->srp_username);
s->session->srp_username = BUF_strdup(s->srp_ctx.login);