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>
This commit is contained in:
@@ -43,9 +43,11 @@ ANDROID)
|
|||||||
oslibs="$oslibs $WORKDIR/UnpackedTarball/cairo/src/.libs/libcairo.a"
|
oslibs="$oslibs $WORKDIR/UnpackedTarball/cairo/src/.libs/libcairo.a"
|
||||||
# Only liblo-bootstrap.a ends up here:
|
# Only liblo-bootstrap.a ends up here:
|
||||||
oslibs="$oslibs $WORKDIR/LinkTarget/Library/lib*.a"
|
oslibs="$oslibs $WORKDIR/LinkTarget/Library/lib*.a"
|
||||||
|
osssl="$WORKDIR/UnpackedTarball/HEJ($TLS)(${DISABLE-OPENSSL})openssl/*.a"
|
||||||
;;
|
;;
|
||||||
IOS)
|
IOS)
|
||||||
oslibs="$WORKDIR/UnpackedTarball/icu/source/stubdata/*.a"
|
oslibs="$WORKDIR/UnpackedTarball/icu/source/stubdata/*.a"
|
||||||
|
osssl=""
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
oslibs=
|
oslibs=
|
||||||
@@ -75,7 +77,7 @@ echo $INSTDIR/$LIBO_LIB_FOLDER/lib*.a \
|
|||||||
$WORKDIR/UnpackedTarball/liborcus/src/*/.libs/*.a \
|
$WORKDIR/UnpackedTarball/liborcus/src/*/.libs/*.a \
|
||||||
$WORKDIR/UnpackedTarball/libvisio/src/lib/.libs/*.a \
|
$WORKDIR/UnpackedTarball/libvisio/src/lib/.libs/*.a \
|
||||||
$WORKDIR/UnpackedTarball/libwp?/src/lib/.libs/*.a \
|
$WORKDIR/UnpackedTarball/libwp?/src/lib/.libs/*.a \
|
||||||
$WORKDIR/UnpackedTarball/openssl/*.a \
|
$osssl \
|
||||||
$WORKDIR/UnpackedTarball/raptor/src/.libs/*.a \
|
$WORKDIR/UnpackedTarball/raptor/src/.libs/*.a \
|
||||||
$WORKDIR/UnpackedTarball/rasqal/src/.libs/*.a \
|
$WORKDIR/UnpackedTarball/rasqal/src/.libs/*.a \
|
||||||
$WORKDIR/UnpackedTarball/redland/src/.libs/*.a \
|
$WORKDIR/UnpackedTarball/redland/src/.libs/*.a \
|
||||||
|
@@ -105,6 +105,9 @@ void Hash::update(const unsigned char* pInput, size_t length)
|
|||||||
HASH_Update(mpImpl->mpContext, pInput, length);
|
HASH_Update(mpImpl->mpContext, pInput, length);
|
||||||
#elif USE_TLS_OPENSSL
|
#elif USE_TLS_OPENSSL
|
||||||
EVP_DigestUpdate(mpImpl->mpContext, pInput, length);
|
EVP_DigestUpdate(mpImpl->mpContext, pInput, length);
|
||||||
|
#else
|
||||||
|
(void)pInput;
|
||||||
|
(void)length;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,6 +119,8 @@ std::vector<unsigned char> Hash::finalize()
|
|||||||
HASH_End(mpImpl->mpContext, hash.data(), &digestWrittenLength, getLength());
|
HASH_End(mpImpl->mpContext, hash.data(), &digestWrittenLength, getLength());
|
||||||
#elif USE_TLS_OPENSSL
|
#elif USE_TLS_OPENSSL
|
||||||
EVP_DigestFinal_ex(mpImpl->mpContext, hash.data(), &digestWrittenLength);
|
EVP_DigestFinal_ex(mpImpl->mpContext, hash.data(), &digestWrittenLength);
|
||||||
|
#else
|
||||||
|
(void)digestWrittenLength;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return hash;
|
return hash;
|
||||||
|
@@ -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)
|
Decrypt::Decrypt(std::vector<sal_uInt8>& key, std::vector<sal_uInt8>& iv, CryptoType type)
|
||||||
: Crypto()
|
: Crypto()
|
||||||
{
|
{
|
||||||
|
#if USE_TLS_OPENSSL + USE_TLS_NSS == 0
|
||||||
|
(void)key;
|
||||||
|
(void)iv;
|
||||||
|
(void)type;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if USE_TLS_OPENSSL
|
#if USE_TLS_OPENSSL
|
||||||
EVP_CIPHER_CTX_init(&mContext);
|
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;
|
int outputLength = 0;
|
||||||
|
|
||||||
|
#if USE_TLS_OPENSSL + USE_TLS_NSS > 0
|
||||||
sal_uInt32 actualInputLength = inputLength == 0 || inputLength > input.size() ? input.size() : inputLength;
|
sal_uInt32 actualInputLength = inputLength == 0 || inputLength > input.size() ? input.size() : inputLength;
|
||||||
|
#else
|
||||||
|
(void)output;
|
||||||
|
(void)input;
|
||||||
|
(void)inputLength;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if USE_TLS_OPENSSL
|
#if USE_TLS_OPENSSL
|
||||||
(void)EVP_DecryptUpdate(&mContext, output.data(), &outputLength, input.data(), actualInputLength);
|
(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)
|
Encrypt::Encrypt(std::vector<sal_uInt8>& key, std::vector<sal_uInt8>& iv, CryptoType type)
|
||||||
: Crypto()
|
: Crypto()
|
||||||
{
|
{
|
||||||
|
#if USE_TLS_OPENSSL + USE_TLS_NSS == 0
|
||||||
|
(void)key;
|
||||||
|
(void)iv;
|
||||||
|
(void)type;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if USE_TLS_OPENSSL
|
#if USE_TLS_OPENSSL
|
||||||
EVP_CIPHER_CTX_init(&mContext);
|
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;
|
int outputLength = 0;
|
||||||
|
|
||||||
|
#if USE_TLS_OPENSSL + USE_TLS_NSS > 0
|
||||||
sal_uInt32 actualInputLength = inputLength == 0 || inputLength > input.size() ? input.size() : inputLength;
|
sal_uInt32 actualInputLength = inputLength == 0 || inputLength > input.size() ? input.size() : inputLength;
|
||||||
|
#else
|
||||||
|
(void)output;
|
||||||
|
(void)input;
|
||||||
|
(void)inputLength;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if USE_TLS_OPENSSL
|
#if USE_TLS_OPENSSL
|
||||||
(void)EVP_EncryptUpdate(&mContext, output.data(), &outputLength, input.data(), actualInputLength);
|
(void)EVP_EncryptUpdate(&mContext, output.data(), &outputLength, input.data(), actualInputLength);
|
||||||
|
Reference in New Issue
Block a user