summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/rsa/rsa_chk.c
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2017-01-21 10:38:29 +0000
committerbeck <beck@openbsd.org>2017-01-21 10:38:29 +0000
commit44adc1eac90b19e731ed767b8523ee067b63713a (patch)
treead2d2fed1b8bb12b462bdabe3acea9519d5fff18 /lib/libcrypto/rsa/rsa_chk.c
parentHaving a 'case 256:' in a switch (<uchar>) {} is bad on principle (diff)
downloadwireguard-openbsd-44adc1eac90b19e731ed767b8523ee067b63713a.tar.xz
wireguard-openbsd-44adc1eac90b19e731ed767b8523ee067b63713a.zip
Split out BN_div and BN_mod into ct and nonct versions for Internal use.
ok jsing@
Diffstat (limited to 'lib/libcrypto/rsa/rsa_chk.c')
-rw-r--r--lib/libcrypto/rsa/rsa_chk.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libcrypto/rsa/rsa_chk.c b/lib/libcrypto/rsa/rsa_chk.c
index c247a8d80e8..efe9431f2dd 100644
--- a/lib/libcrypto/rsa/rsa_chk.c
+++ b/lib/libcrypto/rsa/rsa_chk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa_chk.c,v 1.9 2014/07/10 07:43:11 jsing Exp $ */
+/* $OpenBSD: rsa_chk.c,v 1.10 2017/01/21 10:38:29 beck Exp $ */
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
@@ -52,6 +52,8 @@
#include <openssl/err.h>
#include <openssl/rsa.h>
+#include "bn_lcl.h"
+
int
RSA_check_key(const RSA *key)
{
@@ -132,7 +134,7 @@ RSA_check_key(const RSA *key)
ret = -1;
goto err;
}
- r = BN_div(k, NULL, l, m, ctx); /* remainder is 0 */
+ r = BN_div_ct(k, NULL, l, m, ctx); /* remainder is 0 */
if (!r) {
ret = -1;
goto err;
@@ -157,7 +159,7 @@ RSA_check_key(const RSA *key)
goto err;
}
- r = BN_mod(j, key->d, i, ctx);
+ r = BN_mod_ct(j, key->d, i, ctx);
if (!r) {
ret = -1;
goto err;
@@ -176,7 +178,7 @@ RSA_check_key(const RSA *key)
goto err;
}
- r = BN_mod(j, key->d, i, ctx);
+ r = BN_mod_ct(j, key->d, i, ctx);
if (!r) {
ret = -1;
goto err;