summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dsa/dsa_key.c
diff options
context:
space:
mode:
authorbeck <>2017-01-21 09:38:59 +0000
committerbeck <>2017-01-21 09:38:59 +0000
commitba7dab5b77b1e4dd797dbe7a4c31b5f4cbea0cd7 (patch)
treea68beae7892dad13fd8d76ba1fc45e6570e3360b /src/lib/libcrypto/dsa/dsa_key.c
parent0c45e4e4d42eacefe309063241d5a7f6de6674e7 (diff)
downloadopenbsd-ba7dab5b77b1e4dd797dbe7a4c31b5f4cbea0cd7.tar.gz
openbsd-ba7dab5b77b1e4dd797dbe7a4c31b5f4cbea0cd7.tar.bz2
openbsd-ba7dab5b77b1e4dd797dbe7a4c31b5f4cbea0cd7.zip
Make explicit _ct and _nonct versions of bn_mod_exp funcitons that
matter for constant time, and make the public interface only used external to the library. This moves us to a model where the important things are constant time versions unless you ask for them not to be, rather than the opposite. I'll continue with this method by method. Add regress tests for same. ok jsing@
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa_key.c')
-rw-r--r--src/lib/libcrypto/dsa/dsa_key.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_key.c b/src/lib/libcrypto/dsa/dsa_key.c
index fc4eb9c433..cb95e1369c 100644
--- a/src/lib/libcrypto/dsa/dsa_key.c
+++ b/src/lib/libcrypto/dsa/dsa_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_key.c,v 1.22 2016/06/30 02:02:06 bcook Exp $ */ 1/* $OpenBSD: dsa_key.c,v 1.23 2017/01/21 09:38:59 beck Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -65,6 +65,7 @@
65 65
66#include <openssl/bn.h> 66#include <openssl/bn.h>
67#include <openssl/dsa.h> 67#include <openssl/dsa.h>
68#include "bn_lcl.h"
68 69
69static int dsa_builtin_keygen(DSA *dsa); 70static int dsa_builtin_keygen(DSA *dsa);
70 71
@@ -108,7 +109,7 @@ dsa_builtin_keygen(DSA *dsa)
108 109
109 BN_with_flags(&prk, priv_key, BN_FLG_CONSTTIME); 110 BN_with_flags(&prk, priv_key, BN_FLG_CONSTTIME);
110 111
111 if (!BN_mod_exp(pub_key, dsa->g, &prk, dsa->p, ctx)) 112 if (!BN_mod_exp_ct(pub_key, dsa->g, &prk, dsa->p, ctx))
112 goto err; 113 goto err;
113 } 114 }
114 115