diff options
author | jan Iversen <jani@libreoffice.org> | 2017-06-09 12:59:19 +0200 |
---|---|---|
committer | jan iversen <jani@libreoffice.org> | 2017-06-11 11:23:28 +0200 |
commit | 2a48fd3fbb649218f66a58e70ad904411883c63d (patch) | |
tree | 7deab6d8cc914445e8848a6ecd23bf43af380ddd | |
parent | 2a6894e05cb8b35376c47ad6301f4dc8deb56fc0 (diff) |
allow build without tls and ssl
support for using
--disable-openssl AND --without-tls
(needed if you want to avoid including crypto code).
Change-Id: I77650e9db679ddf1690560eda069d8645acacfc4
Reviewed-on: https://gerrit.libreoffice.org/38604
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@libreoffice.org>
-rwxr-xr-x | bin/lo-all-static-libs | 4 | ||||
-rw-r--r-- | comphelper/source/misc/hash.cxx | 5 | ||||
-rw-r--r-- | oox/source/crypto/CryptTools.cxx | 24 |
3 files changed, 32 insertions, 1 deletions
diff --git a/bin/lo-all-static-libs b/bin/lo-all-static-libs index 47640feaa392..c45723f938cd 100755 --- a/bin/lo-all-static-libs +++ b/bin/lo-all-static-libs @@ -43,9 +43,11 @@ ANDROID) oslibs="$oslibs $WORKDIR/UnpackedTarball/cairo/src/.libs/libcairo.a" # Only liblo-bootstrap.a ends up here: oslibs="$oslibs $WORKDIR/LinkTarget/Library/lib*.a" + osssl="$WORKDIR/UnpackedTarball/HEJ($TLS)(${DISABLE-OPENSSL})openssl/*.a" ;; IOS) oslibs="$WORKDIR/UnpackedTarball/icu/source/stubdata/*.a" + osssl="" ;; *) oslibs= @@ -75,7 +77,7 @@ echo $INSTDIR/$LIBO_LIB_FOLDER/lib*.a \ $WORKDIR/UnpackedTarball/liborcus/src/*/.libs/*.a \ $WORKDIR/UnpackedTarball/libvisio/src/lib/.libs/*.a \ $WORKDIR/UnpackedTarball/libwp?/src/lib/.libs/*.a \ - $WORKDIR/UnpackedTarball/openssl/*.a \ + $osssl \ $WORKDIR/UnpackedTarball/raptor/src/.libs/*.a \ $WORKDIR/UnpackedTarball/rasqal/src/.libs/*.a \ $WORKDIR/UnpackedTarball/redland/src/.libs/*.a \ diff --git a/comphelper/source/misc/hash.cxx b/comphelper/source/misc/hash.cxx index 5e250f1ed0d3..8da77a792e6a 100644 --- a/comphelper/source/misc/hash.cxx +++ b/comphelper/source/misc/hash.cxx @@ -105,6 +105,9 @@ void Hash::update(const unsigned char* pInput, size_t length) HASH_Update(mpImpl->mpContext, pInput, length); #elif USE_TLS_OPENSSL EVP_DigestUpdate(mpImpl->mpContext, pInput, length); +#else + (void)pInput; + (void)length; #endif } @@ -116,6 +119,8 @@ std::vector<unsigned char> Hash::finalize() HASH_End(mpImpl->mpContext, hash.data(), &digestWrittenLength, getLength()); #elif USE_TLS_OPENSSL EVP_DigestFinal_ex(mpImpl->mpContext, hash.data(), &digestWrittenLength); +#else + (void)digestWrittenLength; #endif return hash; diff --git a/oox/source/crypto/CryptTools.cxx b/oox/source/crypto/CryptTools.cxx index b23d3ebbf57b..d40b2d57ea6a 100644 --- a/oox/source/crypto/CryptTools.cxx +++ b/oox/source/crypto/CryptTools.cxx @@ -111,6 +111,12 @@ void Crypto::setupContext(std::vector<sal_uInt8>& key, std::vector<sal_uInt8>& i Decrypt::Decrypt(std::vector<sal_uInt8>& key, std::vector<sal_uInt8>& iv, CryptoType type) : Crypto() { +#if USE_TLS_OPENSSL + USE_TLS_NSS == 0 + (void)key; + (void)iv; + (void)type; +#endif + #if USE_TLS_OPENSSL EVP_CIPHER_CTX_init(&mContext); @@ -132,7 +138,13 @@ sal_uInt32 Decrypt::update(std::vector<sal_uInt8>& output, std::vector<sal_uInt8 { int outputLength = 0; +#if USE_TLS_OPENSSL + USE_TLS_NSS > 0 sal_uInt32 actualInputLength = inputLength == 0 || inputLength > input.size() ? input.size() : inputLength; +#else + (void)output; + (void)input; + (void)inputLength; +#endif #if USE_TLS_OPENSSL (void)EVP_DecryptUpdate(&mContext, output.data(), &outputLength, input.data(), actualInputLength); @@ -159,6 +171,12 @@ sal_uInt32 Decrypt::aes128ecb(std::vector<sal_uInt8>& output, std::vector<sal_uI Encrypt::Encrypt(std::vector<sal_uInt8>& key, std::vector<sal_uInt8>& iv, CryptoType type) : Crypto() { +#if USE_TLS_OPENSSL + USE_TLS_NSS == 0 + (void)key; + (void)iv; + (void)type; +#endif + #if USE_TLS_OPENSSL EVP_CIPHER_CTX_init(&mContext); @@ -180,7 +198,13 @@ sal_uInt32 Encrypt::update(std::vector<sal_uInt8>& output, std::vector<sal_uInt8 { int outputLength = 0; +#if USE_TLS_OPENSSL + USE_TLS_NSS > 0 sal_uInt32 actualInputLength = inputLength == 0 || inputLength > input.size() ? input.size() : inputLength; +#else + (void)output; + (void)input; + (void)inputLength; +#endif #if USE_TLS_OPENSSL (void)EVP_EncryptUpdate(&mContext, output.data(), &outputLength, input.data(), actualInputLength); |