Windows batch file to rebuild error codes for CryptoAPI ENGINE.
[openssl.git] / engines / e_ubsec.c
index 802de40be6d5d8755edd52e8c745956b0af573c1..e8389de6a1f85ed8b5ca1d65a5a75049e3bc0fd1 100644 (file)
 #include <openssl/buffer.h>
 #include <openssl/dso.h>
 #include <openssl/engine.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
+#endif
+#ifndef OPENSSL_NO_DSA
 #include <openssl/dsa.h>
+#endif
+#ifndef OPENSSL_NO_DH
 #include <openssl/dh.h>
+#endif
 #include <openssl/bn.h>
 
 #ifndef OPENSSL_NO_HW
@@ -463,6 +469,7 @@ static int ubsec_init(ENGINE *e)
 err:
        if(ubsec_dso)
                DSO_free(ubsec_dso);
+       ubsec_dso = NULL;
        p_UBSEC_ubsec_bytes_to_bits = NULL;
        p_UBSEC_ubsec_bits_to_bytes = NULL;
        p_UBSEC_ubsec_open = NULL;
@@ -815,11 +822,11 @@ static int ubsec_dsa_verify(const unsigned char *dgst, int dgst_len,
        int v_len, d_len;
        int to_return = 0;
        int fd;
-       BIGNUM v;
+       BIGNUM v, *pv = &v;
 
        BN_init(&v);
 
-       if(!bn_wexpand(&v, dsa->p->top)) {
+       if(!bn_wexpand(pv, dsa->p->top)) {
                UBSECerr(UBSEC_F_UBSEC_DSA_VERIFY, UBSEC_R_BN_EXPAND_FAIL);
                goto err;
        }