oox/source/crypto/CryptTools.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+)
New commits: commit 71d4abc51b556e147ab53a9a52b15be36fc710a3 Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Thu Jan 18 13:16:56 2024 +0100 Commit: Stephan Bergmann <stephan.bergm...@allotropia.de> CommitDate: Thu Jan 18 21:09:30 2024 +0100 -Werror,-Wdeprecated-declarations (Emscripten) > oox/source/crypto/CryptTools.cxx:57:40: error: 'HMAC_CTX_free' is deprecated [-Werror,-Wdeprecated-declarations] > void operator()(HMAC_CTX* p) { HMAC_CTX_free(p); } > ^ > workdir/UnpackedTarball/openssl/include/openssl/hmac.h:35:1: note: 'HMAC_CTX_free' has been explicitly marked deprecated here > OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_free(HMAC_CTX *ctx); > ^ > workdir/UnpackedTarball/openssl/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0' > # define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0) > ^ > workdir/UnpackedTarball/openssl/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED' > # define OSSL_DEPRECATED(since) __attribute__((deprecated)) > ^ > oox/source/crypto/CryptTools.cxx:112:29: error: 'HMAC_CTX_new' is deprecated [-Werror,-Wdeprecated-declarations] > mpHmacContext.reset(HMAC_CTX_new()); > ^ > workdir/UnpackedTarball/openssl/include/openssl/hmac.h:33:1: note: 'HMAC_CTX_new' has been explicitly marked deprecated here > OSSL_DEPRECATEDIN_3_0 HMAC_CTX *HMAC_CTX_new(void); > ^ > workdir/UnpackedTarball/openssl/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0' > # define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0) > ^ > workdir/UnpackedTarball/openssl/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED' > # define OSSL_DEPRECATED(since) __attribute__((deprecated)) > ^ > oox/source/crypto/CryptTools.cxx:125:9: error: 'HMAC_Init_ex' is deprecated [-Werror,-Wdeprecated-declarations] > HMAC_Init_ex(mpHmacContext.get(), rKey.data(), rKey.size(), aEvpMd, nullptr); > ^ > workdir/UnpackedTarball/openssl/include/openssl/hmac.h:43:1: note: 'HMAC_Init_ex' has been explicitly marked deprecated here > OSSL_DEPRECATEDIN_3_0 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, > ^ > workdir/UnpackedTarball/openssl/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0' > # define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0) > ^ > workdir/UnpackedTarball/openssl/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED' > # define OSSL_DEPRECATED(since) __attribute__((deprecated)) > ^ > oox/source/crypto/CryptTools.cxx:499:12: error: 'HMAC_Update' is deprecated [-Werror,-Wdeprecated-declarations] > return HMAC_Update(mpImpl->mpHmacContext.get(), rInput.data(), nActualInputLength) != 0; > ^ > workdir/UnpackedTarball/openssl/include/openssl/hmac.h:45:1: note: 'HMAC_Update' has been explicitly marked deprecated here > OSSL_DEPRECATEDIN_3_0 int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, > ^ > workdir/UnpackedTarball/openssl/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0' > # define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0) > ^ > workdir/UnpackedTarball/openssl/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED' > # define OSSL_DEPRECATED(since) __attribute__((deprecated)) > ^ > oox/source/crypto/CryptTools.cxx:512:12: error: 'HMAC_Final' is deprecated [-Werror,-Wdeprecated-declarations] > (void) HMAC_Final(mpImpl->mpHmacContext.get(), aHash.data(), &nSizeWritten); > ^ > workdir/UnpackedTarball/openssl/include/openssl/hmac.h:47:1: note: 'HMAC_Final' has been explicitly marked deprecated here > OSSL_DEPRECATEDIN_3_0 int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, > ^ > workdir/UnpackedTarball/openssl/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0' > # define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0) > ^ > workdir/UnpackedTarball/openssl/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED' > # define OSSL_DEPRECATED(since) __attribute__((deprecated)) > ^ Change-Id: Ia9edc299b7cd4728fe32adbca8e1212170c328ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162248 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> diff --git a/oox/source/crypto/CryptTools.cxx b/oox/source/crypto/CryptTools.cxx index 86d8ab270d19..17729828ac42 100644 --- a/oox/source/crypto/CryptTools.cxx +++ b/oox/source/crypto/CryptTools.cxx @@ -10,6 +10,7 @@ #include <oox/crypto/CryptTools.hxx> #include <com/sun/star/uno/RuntimeException.hpp> +#include <sal/types.h> #include <config_oox.h> @@ -54,7 +55,9 @@ namespace struct hmac_delete { +SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'HMAC_CTX_free' is deprecated void operator()(HMAC_CTX* p) { HMAC_CTX_free(p); } +SAL_WNODEPRECATED_DECLARATIONS_POP }; } @@ -109,7 +112,9 @@ struct CryptoImpl void setupCryptoHashContext(std::vector<sal_uInt8>& rKey, CryptoHashType eType) { +SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'HMAC_CTX_new' is deprecated mpHmacContext.reset(HMAC_CTX_new()); +SAL_WNODEPRECATED_DECLARATIONS_POP const EVP_MD* aEvpMd = nullptr; switch (eType) { @@ -122,7 +127,9 @@ struct CryptoImpl case CryptoHashType::SHA512: aEvpMd = EVP_sha512(); break; } +SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'HMAC_Init_ex' is deprecated HMAC_Init_ex(mpHmacContext.get(), rKey.data(), rKey.size(), aEvpMd, nullptr); +SAL_WNODEPRECATED_DECLARATIONS_POP } ~CryptoImpl() @@ -496,7 +503,9 @@ bool CryptoHash::update(std::vector<sal_uInt8>& rInput, sal_uInt32 nInputLength) #endif #if USE_TLS_OPENSSL +SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'HMAC_Update' is deprecated return HMAC_Update(mpImpl->mpHmacContext.get(), rInput.data(), nActualInputLength) != 0; +SAL_WNODEPRECATED_DECLARATIONS_POP #elif USE_TLS_NSS return PK11_DigestOp(mpImpl->mContext, rInput.data(), nActualInputLength) == SECSuccess; #else @@ -509,7 +518,9 @@ std::vector<sal_uInt8> CryptoHash::finalize() std::vector<sal_uInt8> aHash(mnHashSize, 0); unsigned int nSizeWritten; #if USE_TLS_OPENSSL +SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'HMAC_Final' is deprecated (void) HMAC_Final(mpImpl->mpHmacContext.get(), aHash.data(), &nSizeWritten); +SAL_WNODEPRECATED_DECLARATIONS_POP #elif USE_TLS_NSS PK11_DigestFinal(mpImpl->mContext, aHash.data(), &nSizeWritten, aHash.size()); #endif