Declaration error during sqlcipher build on Windows 7


#1

I’m trying to build sqlcipher in Windows 7, 64 bit using MinGW. I did things a bit differently than the instructions I saw earlier in order to get things to work so far. To compile OpenSSL, I ran the commands from the INSTALL file in OpenSSL:

perl Configure VC-WIN32 --prefix=C:\opensslbuild32
nmake
nmake test
nmake install

I then copied the lib/libcrypto.lib and bin/libcrypto.dll files into the sqlcipher directory. Then, to build sqlcipher, I ran the following commands in msys.bat:

./configure CFLAGS="-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I/c/opensslbuild32/include /c/sqlcipher/libcrypto.dll -L/c/sqlcipher -static-libgcc" LDFLAGS="-lcrypto"
make clean
make sqlite3.c
make

After make, here’s the error I’m getting:

In function 'sqlcipher_openssl_hmac':
sqlite3.c:18401:12: error: storage size of 'hctx' isn't known
   HMAC_CTX hctx;
            ^
sqlite3.c:18403:3: warning: implicit declaration of function 'HMAC_CTX_init' [-Wimplicit-function-declaration]
   HMAC_CTX_init(&hctx);
   ^
sqlite3.c:18408:3: warning: implicit declaration of function 'HMAC_CTX_cleanup' [-Wimplicit-function-declaration]
   HMAC_CTX_cleanup(&hctx);
   ^
sqlite3.c: In function 'sqlcipher_openssl_cipher':
sqlite3.c:18418:18: error: storage size of 'ectx' isn't known
   EVP_CIPHER_CTX ectx;
                  ^
make: *** [sqlite3.lo] Error 1

Any thoughts? Thanks for the help!


#2

Hi @natez,

What version of OpenSSL are you compiling on Windows 7?


#3

I’m using OpenSSL 1.1.0c (https://www.openssl.org/source/).


#4

Hi @natez

The OpenSSL crypto provider available in SQLCipher 3.4.0 does not support some changes that were made to OpenSSL in their 1.1.0 release. Our next release of SQLCipher will include support for using OpenSSL 1.1.0. For the time being, you should use another, non 1.1.0 release of OpenSSL.