From 1385f2adfdeee36db41b61c1294f507d64a60fd1 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 13 Jun 2018 15:05:04 +0000 Subject: Avoid a timing side-channel leak when generating DSA and ECDSA signatures. This is caused by an attempt to do fast modular arithmetic, which introduces branches that leak information regarding secret values. Issue identified and reported by Keegan Ryan of NCC Group. ok beck@ tb@ --- src/lib/libcrypto/ecdsa/ecs_ossl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/libcrypto/ecdsa/ecs_ossl.c') diff --git a/src/lib/libcrypto/ecdsa/ecs_ossl.c b/src/lib/libcrypto/ecdsa/ecs_ossl.c index 4ac140a020..0f594aa86e 100644 --- a/src/lib/libcrypto/ecdsa/ecs_ossl.c +++ b/src/lib/libcrypto/ecdsa/ecs_ossl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecs_ossl.c,v 1.10 2018/04/28 14:17:56 tb Exp $ */ +/* $OpenBSD: ecs_ossl.c,v 1.11 2018/06/13 15:05:04 jsing Exp $ */ /* * Written by Nils Larsch for the OpenSSL project */ @@ -290,7 +290,7 @@ ecdsa_do_sign(const unsigned char *dgst, int dgst_len, ECDSAerror(ERR_R_BN_LIB); goto err; } - if (!BN_mod_add_quick(s, tmp, m, order)) { + if (!BN_mod_add(s, tmp, m, order, ctx)) { ECDSAerror(ERR_R_BN_LIB); goto err; } -- cgit v1.2.3-55-g6feb