Skip to content

Commit

Permalink
Revert "Fix Timing Oracle in RSA decryption"
Browse files Browse the repository at this point in the history
This reverts commit 43d8f88.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #20284)
  • Loading branch information
bernd-edlinger committed Mar 31, 2023
1 parent 0d16b7e commit 0372649
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 684 deletions.
14 changes: 14 additions & 0 deletions crypto/bn/bn_blind.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@

#define BN_BLINDING_COUNTER 32

struct bn_blinding_st {
BIGNUM *A;
BIGNUM *Ai;
BIGNUM *e;
BIGNUM *mod; /* just a reference */
CRYPTO_THREAD_ID tid;
int counter;
unsigned long flags;
BN_MONT_CTX *m_ctx;
int (*bn_mod_exp) (BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
CRYPTO_RWLOCK *lock;
};

BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod)
{
BN_BLINDING *ret = NULL;
Expand Down
2 changes: 0 additions & 2 deletions crypto/bn/bn_err.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ static const ERR_STRING_DATA BN_str_functs[] = {
{ERR_PACK(ERR_LIB_BN, BN_F_BN_SET_WORDS, 0), "bn_set_words"},
{ERR_PACK(ERR_LIB_BN, BN_F_BN_STACK_PUSH, 0), "BN_STACK_push"},
{ERR_PACK(ERR_LIB_BN, BN_F_BN_USUB, 0), "BN_usub"},
{ERR_PACK(ERR_LIB_BN, BN_F_OSSL_BN_RSA_DO_UNBLIND, 0),
"ossl_bn_rsa_do_unblind"},
{0, NULL}
};

Expand Down
14 changes: 0 additions & 14 deletions crypto/bn/bn_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,20 +283,6 @@ struct bn_gencb_st {
} cb;
};

struct bn_blinding_st {
BIGNUM *A;
BIGNUM *Ai;
BIGNUM *e;
BIGNUM *mod; /* just a reference */
CRYPTO_THREAD_ID tid;
int counter;
unsigned long flags;
BN_MONT_CTX *m_ctx;
int (*bn_mod_exp) (BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
CRYPTO_RWLOCK *lock;
};

/*-
* BN_window_bits_for_exponent_size -- macro for sliding window mod_exp functions
*
Expand Down
3 changes: 1 addition & 2 deletions crypto/bn/build.info
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ SOURCE[../../libcrypto]=\
bn_kron.c bn_sqrt.c bn_gcd.c bn_prime.c bn_err.c bn_sqr.c \
{- $target{bn_asm_src} -} \
bn_recp.c bn_mont.c bn_mpi.c bn_exp2.c bn_gf2m.c bn_nist.c \
bn_depr.c bn_const.c bn_x931p.c bn_intern.c bn_dh.c bn_srp.c \
rsa_sup_mul.c
bn_depr.c bn_const.c bn_x931p.c bn_intern.c bn_dh.c bn_srp.c

INCLUDE[bn_exp.o]=..

Expand Down

0 comments on commit 0372649

Please sign in to comment.