Adapt method retrieval to the engine variant.
authorRichard Levitte <levitte@openssl.org>
Tue, 8 Apr 2003 06:32:48 +0000 (06:32 +0000)
committerRichard Levitte <levitte@openssl.org>
Tue, 8 Apr 2003 06:32:48 +0000 (06:32 +0000)
crypto/rsa/rsa_eay.c

index dbabd07c9f880c3d6ee7447b5326cbfc5a6c2bb3..0ba50b8e87383ca5bcd6345cd9667a96a65228ad 100644 (file)
@@ -214,6 +214,7 @@ static int rsa_eay_blinding(RSA *rsa, BN_CTX *ctx)
 
 static BN_BLINDING *setup_blinding(RSA *rsa, BN_CTX *ctx)
        {
+       const RSA_METHOD *meth;
        BIGNUM *A, *Ai;
        BN_BLINDING *ret = NULL;
 
@@ -223,6 +224,7 @@ static BN_BLINDING *setup_blinding(RSA *rsa, BN_CTX *ctx)
         * this should be placed in a new function of its own, but for reasons
         * of binary compatibility can't */
 
+       meth = ENGINE_get_RSA(rsa->engine);
        BN_CTX_start(ctx);
        A = BN_CTX_get(ctx);
        if ((RAND_status() == 0) && rsa->d != NULL && rsa->d->d != NULL)
@@ -237,7 +239,7 @@ static BN_BLINDING *setup_blinding(RSA *rsa, BN_CTX *ctx)
                }
        if ((Ai=BN_mod_inverse(NULL,A,rsa->n,ctx)) == NULL) goto err;
 
-       if (!rsa->meth->bn_mod_exp(A,A,rsa->e,rsa->n,ctx,rsa->_method_mod_n))
+       if (!meth->bn_mod_exp(A,A,rsa->e,rsa->n,ctx,rsa->_method_mod_n))
                goto err;
        ret = BN_BLINDING_new(A,Ai,rsa->n);
        BN_free(Ai);