eng_aesni.c: win32 fix.
[openssl.git] / crypto / engine / eng_cryptodev.c
index 65f20726b87b579c3599bb0c88e71e2dfa2357df..ab38cd52f09708d979b91a9182e1ef6d34f7bfd9 100644 (file)
@@ -29,6 +29,7 @@
 #include <openssl/objects.h>
 #include <openssl/engine.h>
 #include <openssl/evp.h>
+#include <openssl/bn.h>
 
 #if (defined(__unix__) || defined(unix)) && !defined(USG) && \
        (defined(OpenBSD) || defined(__FreeBSD_version))
@@ -100,7 +101,7 @@ static int cryptodev_bn_mod_exp(BIGNUM *r, const BIGNUM *a,
     const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
 static int cryptodev_rsa_nocrt_mod_exp(BIGNUM *r0, const BIGNUM *I,
     RSA *rsa);
-static int cryptodev_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa);
+static int cryptodev_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx);
 static int cryptodev_dsa_bn_mod_exp(DSA *dsa, BIGNUM *r, BIGNUM *a,
     const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
 static int cryptodev_dsa_dsa_mod_exp(DSA *dsa, BIGNUM *t1, BIGNUM *g,
@@ -259,7 +260,7 @@ get_cryptodev_ciphers(const int **cnids)
        int fd, i, count = 0;
 
        if ((fd = get_dev_crypto()) < 0) {
-               *nids = NULL;
+               *cnids = NULL;
                return (0);
        }
        memset(&sess, 0, sizeof(sess));
@@ -298,7 +299,7 @@ get_cryptodev_digests(const int **cnids)
        int fd, i, count = 0;
 
        if ((fd = get_dev_crypto()) < 0) {
-               *nids = NULL;
+               *cnids = NULL;
                return (0);
        }
        memset(&sess, 0, sizeof(sess));
@@ -767,7 +768,7 @@ cryptodev_rsa_nocrt_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa)
 }
 
 static int
-cryptodev_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa)
+cryptodev_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
 {
        struct crypt_kop kop;
        int ret = 1;
@@ -796,7 +797,7 @@ cryptodev_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa)
 
        if (cryptodev_asym(&kop, BN_num_bytes(rsa->n), r0, 0, NULL) == -1) {
                const RSA_METHOD *meth = RSA_PKCS1_SSLeay();
-               ret = (*meth->rsa_mod_exp)(r0, I, rsa);
+               ret = (*meth->rsa_mod_exp)(r0, I, rsa, ctx);
        }
 err:
        zapparams(&kop);