1 diff -u -r1.28.2.3 rsa_eay.c
2 --- crypto/rsa/rsa_eay.c 30 Jan 2003 17:37:46 -0000 1.28.2.3
3 +++ crypto/rsa/rsa_eay.c 16 Mar 2003 10:34:13 -0000
8 +static int rsa_eay_blinding(RSA *rsa, BN_CTX *ctx)
11 + CRYPTO_w_lock(CRYPTO_LOCK_RSA);
12 + /* Check again inside the lock - the macro's check is racey */
13 + if(rsa->blinding == NULL)
14 + ret = RSA_blinding_on(rsa, ctx);
15 + CRYPTO_w_unlock(CRYPTO_LOCK_RSA);
19 +#define BLINDING_HELPER(rsa, ctx, err_instr) \
21 + if(((rsa)->flags & RSA_FLAG_BLINDING) && \
22 + ((rsa)->blinding == NULL) && \
23 + !rsa_eay_blinding(rsa, ctx)) \
28 static int RSA_eay_private_encrypt(int flen, const unsigned char *from,
29 unsigned char *to, RSA *rsa, int padding)
34 - if ((rsa->flags & RSA_FLAG_BLINDING) && (rsa->blinding == NULL))
35 - RSA_blinding_on(rsa,ctx);
36 + BLINDING_HELPER(rsa, ctx, goto err;);
38 if (rsa->flags & RSA_FLAG_BLINDING)
39 if (!BN_BLINDING_convert(&f,rsa->blinding,ctx)) goto err;
45 - if ((rsa->flags & RSA_FLAG_BLINDING) && (rsa->blinding == NULL))
46 - RSA_blinding_on(rsa,ctx);
47 + BLINDING_HELPER(rsa, ctx, goto err;);
49 if (rsa->flags & RSA_FLAG_BLINDING)
50 if (!BN_BLINDING_convert(&f,rsa->blinding,ctx)) goto err;
52 diff -u -r1.30.2.2 rsa_lib.c
53 --- crypto/rsa/rsa_lib.c 30 Jan 2003 17:37:46 -0000 1.30.2.2
54 +++ crypto/rsa/rsa_lib.c 16 Mar 2003 10:34:13 -0000
59 - return(RSA_new_method(NULL));
60 + RSA *r=RSA_new_method(NULL);
62 +#ifndef OPENSSL_NO_FORCE_RSA_BLINDING
63 + r->flags|=RSA_FLAG_BLINDING;
69 void RSA_set_default_method(const RSA_METHOD *meth)