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 /oox/source | |
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>
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/crypto/CryptTools.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
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); |