Skip to content

Commit

Permalink
Bug 1314604 - Extra checking when validating DH shares, r=rrelyea
Browse files Browse the repository at this point in the history
  • Loading branch information
martinthomson committed Nov 8, 2016
1 parent 8419a5d commit a218035
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ssl/sslsock.c
Expand Up @@ -1668,6 +1668,9 @@ ssl_IsValidDHEShare(const SECItem *dh_p, const SECItem *dh_Ys)
unsigned int commonPart;
int cmp;

if (dh_p->len == 0 || dh_Ys->len == 0) {
return PR_FALSE;
}
/* Check that the prime is at least odd. */
if ((dh_p->data[dh_p->len - 1] & 0x01) == 0) {
return PR_FALSE;
Expand Down

0 comments on commit a218035

Please sign in to comment.