[Libreoffice-commits] core.git: bin/lo-all-static-libs comphelper/source oox/source

jan Iversen jani at libreoffice.org
Sun Jun 11 09:23:50 UTC 2017


 bin/lo-all-static-libs           |    4 +++-
 comphelper/source/misc/hash.cxx  |    5 +++++
 oox/source/crypto/CryptTools.cxx |   24 ++++++++++++++++++++++++
 3 files changed, 32 insertions(+), 1 deletion(-)

New commits:
commit 2a48fd3fbb649218f66a58e70ad904411883c63d
Author: jan Iversen <jani at libreoffice.org>
Date:   Fri Jun 9 12:59:19 2017 +0200

    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 at libreoffice.org>
    Reviewed-by: jan iversen <jani at libreoffice.org>

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);


More information about the Libreoffice-commits mailing list