Chromium Code Reviews| Index: nss/lib/freebl/ec.c |
| diff --git a/nss/lib/freebl/ec.c b/nss/lib/freebl/ec.c |
| index 6af242dc108337804da3073c9aa35cf29c9ad18a..4435f91eaa3b257697f5afa8b5630f9804cab88b 100644 |
| --- a/nss/lib/freebl/ec.c |
| +++ b/nss/lib/freebl/ec.c |
| @@ -543,6 +543,15 @@ ECDH_Derive(SECItem *publicValue, |
| return SECFailure; |
| } |
| + /* |
| + * We fail if the public value is the point at infinity, since |
| + * this produces predictable results. |
| + */ |
| + if (ec_point_at_infinity(publicValue)) { |
|
Ryan Sleevi
2015/12/11 01:26:14
Of interest
davidben
2015/12/11 22:10:58
Pretty sure this was a no-op since then pointQ wou
|
| + PORT_SetError(SEC_ERROR_BAD_KEY); |
| + return SECFailure; |
| + } |
| + |
| MP_DIGITS(&k) = 0; |
| memset(derivedSecret, 0, sizeof *derivedSecret); |
| len = (ecParams->fieldID.size + 7) >> 3; |