From eaa93660fa7be62891e2623769b71e381fdff5ff Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 17 Nov 2018 18:55:41 +0000 Subject: Implement coordinate blinding for EC_POINT as an additional mitigation for the portsmash vulnerability. OpenBSD 6.4 errata 003 --- src/lib/libcrypto/ec/ec_lib.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/lib/libcrypto/ec/ec_lib.c') diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c index 7e0ea017f9..d81beb722f 100644 --- a/src/lib/libcrypto/ec/ec_lib.c +++ b/src/lib/libcrypto/ec/ec_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_lib.c,v 1.29 2018/07/16 17:32:39 tb Exp $ */ +/* $OpenBSD: ec_lib.c,v 1.29.2.1 2018/11/17 18:55:41 tb Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -533,6 +533,23 @@ EC_GROUP_cmp(const EC_GROUP * a, const EC_GROUP * b, BN_CTX * ctx) return -1; } +/* + * Coordinate blinding for EC_POINT. + * + * The underlying EC_METHOD can optionally implement this function: + * underlying implementations should return 0 on errors, or 1 on success. + * + * This wrapper returns 1 in case the underlying EC_METHOD does not support + * coordinate blinding. + */ +int +ec_point_blind_coordinates(const EC_GROUP *group, EC_POINT *p, BN_CTX *ctx) +{ + if (group->meth->blind_coordinates == NULL) + return 1; + + return group->meth->blind_coordinates(group, p, ctx); +} /* this has 'package' visibility */ int -- cgit v1.2.3-55-g6feb