summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/rsa/rsa_crpt.c
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2017-01-21 11:00:46 +0000
committerbeck <beck@openbsd.org>2017-01-21 11:00:46 +0000
commitb0f5cbc3c22568232a5f0f45fea89dd1cbb6063b (patch)
tree8f91fe3f7e40e41306d3e708618d467422c540af /lib/libcrypto/rsa/rsa_crpt.c
parentMove virtio config from files.pci to files.pci (diff)
downloadwireguard-openbsd-b0f5cbc3c22568232a5f0f45fea89dd1cbb6063b.tar.xz
wireguard-openbsd-b0f5cbc3c22568232a5f0f45fea89dd1cbb6063b.zip
Add ct and nonct versions of BN_mod_inverse for internal use
ok jsing@
Diffstat (limited to 'lib/libcrypto/rsa/rsa_crpt.c')
-rw-r--r--lib/libcrypto/rsa/rsa_crpt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libcrypto/rsa/rsa_crpt.c b/lib/libcrypto/rsa/rsa_crpt.c
index ccb677c12b0..8063a832632 100644
--- a/lib/libcrypto/rsa/rsa_crpt.c
+++ b/lib/libcrypto/rsa/rsa_crpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa_crpt.c,v 1.16 2016/07/07 11:53:12 bcook Exp $ */
+/* $OpenBSD: rsa_crpt.c,v 1.17 2017/01/21 11:00:47 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -66,6 +66,8 @@
#include <openssl/lhash.h>
#include <openssl/rsa.h>
+#include "bn_lcl.h"
+
#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
#endif
@@ -160,7 +162,7 @@ rsa_get_public_exp(const BIGNUM *d, const BIGNUM *p, const BIGNUM *q,
if (!BN_mul(r0, r1, r2, ctx))
goto err;
- ret = BN_mod_inverse(NULL, d, r0, ctx);
+ ret = BN_mod_inverse_ct(NULL, d, r0, ctx);
err:
BN_CTX_end(ctx);
return ret;