diff options
author | beck <> | 2017-01-21 09:38:59 +0000 |
---|---|---|
committer | beck <> | 2017-01-21 09:38:59 +0000 |
commit | ba7dab5b77b1e4dd797dbe7a4c31b5f4cbea0cd7 (patch) | |
tree | a68beae7892dad13fd8d76ba1fc45e6570e3360b /src/lib/libcrypto/dsa/dsa_ameth.c | |
parent | 0c45e4e4d42eacefe309063241d5a7f6de6674e7 (diff) | |
download | openbsd-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_ameth.c')
-rw-r--r-- | src/lib/libcrypto/dsa/dsa_ameth.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_ameth.c b/src/lib/libcrypto/dsa/dsa_ameth.c index 3e434701aa..92ad02e187 100644 --- a/src/lib/libcrypto/dsa/dsa_ameth.c +++ b/src/lib/libcrypto/dsa/dsa_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dsa_ameth.c,v 1.20 2016/10/19 16:49:11 jsing Exp $ */ | 1 | /* $OpenBSD: dsa_ameth.c,v 1.21 2017/01/21 09:38:59 beck Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -66,8 +66,8 @@ | |||
66 | #include <openssl/err.h> | 66 | #include <openssl/err.h> |
67 | #include <openssl/x509.h> | 67 | #include <openssl/x509.h> |
68 | 68 | ||
69 | |||
70 | #include "asn1_locl.h" | 69 | #include "asn1_locl.h" |
70 | #include "bn_lcl.h" | ||
71 | 71 | ||
72 | static int | 72 | static int |
73 | dsa_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey) | 73 | dsa_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey) |
@@ -224,7 +224,7 @@ dsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8) | |||
224 | goto dsaerr; | 224 | goto dsaerr; |
225 | } | 225 | } |
226 | 226 | ||
227 | if (!BN_mod_exp(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, ctx)) { | 227 | if (!BN_mod_exp_ct(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, ctx)) { |
228 | DSAerr(DSA_F_DSA_PRIV_DECODE,DSA_R_BN_ERROR); | 228 | DSAerr(DSA_F_DSA_PRIV_DECODE,DSA_R_BN_ERROR); |
229 | goto dsaerr; | 229 | goto dsaerr; |
230 | } | 230 | } |