diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index c9fbf0f5..e88948b5 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -65,15 +65,17 @@ file(GLOB WORKSHEET_HEADERS ${XLNT_INCLUDE_DIR}/xlnt/worksheet/*.hpp) file(GLOB WORKSHEET_SOURCES ${XLNT_SOURCE_DIR}/worksheet/*.cpp) file(GLOB DETAIL_HEADERS ${XLNT_SOURCE_DIR}/detail/*.hpp) file(GLOB DETAIL_SOURCES ${XLNT_SOURCE_DIR}/detail/*.cpp) +file(GLOB DETAIL_CRYPTO_HEADERS ${XLNT_SOURCE_DIR}/detail/crypto/*.hpp) +file(GLOB DETAIL_CRYPTO_SOURCES ${XLNT_SOURCE_DIR}/detail/crypto/*.cpp) set(XLNT_HEADERS ${ROOT_HEADERS} ${CELL_HEADERS} ${CHARTS_HEADERS} ${CHARTSHEET_HEADERS} ${DRAWING_HEADERS} ${FORMULA_HEADERS} ${PACKAGING_HEADERS} ${STYLES_HEADERS} ${UTILS_HEADERS} - ${WORKBOOK_HEADERS} ${WORKSHEET_HEADERS} ${DETAIL_HEADERS}) + ${WORKBOOK_HEADERS} ${WORKSHEET_HEADERS} ${DETAIL_HEADERS} ${DETAIL_CRYPTO_HEADERS}) set(XLNT_SOURCES ${CELL_SOURCES} ${CHARTS_SOURCES} ${CHARTSHEET_SOURCES} ${DRAWING_SOURCES} ${FORMULA_SOURCES} ${PACKAGING_SOURCES} ${STYLES_SOURCES} ${UTILS_SOURCES} ${WORKBOOK_SOURCES} - ${WORKSHEET_SOURCES} ${DETAIL_SOURCES}) + ${WORKSHEET_SOURCES} ${DETAIL_SOURCES} ${DETAIL_CRYPTO_SOURCES}) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/installed" @@ -135,6 +137,7 @@ endif() source_group(xlnt FILES ${ROOT_HEADERS}) source_group(detail FILES ${DETAIL_HEADERS} ${DETAIL_SOURCES}) +source_group(detail\\crypto FILES ${DETAIL_CRYPTO_HEADERS} ${DETAIL_CRYPTO_SOURCES}) source_group(cell FILES ${CELL_HEADERS} ${CELL_SOURCES}) source_group(charts FILES ${CHARTS_HEADERS} ${CHARTS_SOURCES}) source_group(chartsheet FILES ${CHARTSHEET_HEADERS} ${CHARTSHEET_SOURCES}) diff --git a/source/detail/aes_tab.c b/source/detail/aes_tab.c deleted file mode 100755 index 0aa48335..00000000 --- a/source/detail/aes_tab.c +++ /dev/null @@ -1,33 +0,0 @@ -/* LibTomCrypt, modular cryptographic library -- Tom St Denis - * - * LibTomCrypt is a library that provides various cryptographic - * algorithms in a highly modular and flexible manner. - * - * The library is free for all purposes without any express - * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org - */ -/* The precomputed tables for AES */ -/* -Te0[x] = S [x].[02, 01, 01, 03]; -Te1[x] = S [x].[03, 02, 01, 01]; -Te2[x] = S [x].[01, 03, 02, 01]; -Te3[x] = S [x].[01, 01, 03, 02]; -Te4[x] = S [x].[01, 01, 01, 01]; - -Td0[x] = Si[x].[0e, 09, 0d, 0b]; -Td1[x] = Si[x].[0b, 0e, 09, 0d]; -Td2[x] = Si[x].[0d, 0b, 0e, 09]; -Td3[x] = Si[x].[09, 0d, 0b, 0e]; -Td4[x] = Si[x].[01, 01, 01, 01]; -*/ - -/** - @file aes_tab.c - AES tables -*/ - -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ diff --git a/source/detail/aes.cpp b/source/detail/crypto/aes.cpp similarity index 99% rename from source/detail/aes.cpp rename to source/detail/crypto/aes.cpp index d292de59..a78dec1b 100755 --- a/source/detail/aes.cpp +++ b/source/detail/crypto/aes.cpp @@ -32,12 +32,14 @@ #include "aes.hpp" -namespace { - #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wold-style-cast" #pragma clang diagnostic ignored "-Wdocumentation" #pragma clang diagnostic ignored "-Wwritable-strings" +#pragma clang diagnostic ignored "-Wsign-conversion" +#pragma clang diagnostic ignored "-Wshorten-64-to-32" + +namespace { #define LTC_NO_ROLC #include "tomcrypt.h" @@ -1736,8 +1738,6 @@ int ecb_start(int cipher, const unsigned char *key, int keylen, int num_rounds, return cipher_descriptor[cipher].setup(key, keylen, num_rounds, &ecb->key); } -#pragma clang diagnostic pop - } // namespace namespace xlnt { @@ -1818,3 +1818,4 @@ std::vector xaes_cbc_decrypt( } // namespace xlnt +#pragma clang diagnostic pop diff --git a/source/detail/aes.hpp b/source/detail/crypto/aes.hpp similarity index 100% rename from source/detail/aes.hpp rename to source/detail/crypto/aes.hpp diff --git a/source/detail/base64.hpp b/source/detail/crypto/base64.hpp similarity index 100% rename from source/detail/base64.hpp rename to source/detail/crypto/base64.hpp diff --git a/source/detail/sha.cpp b/source/detail/crypto/sha.cpp similarity index 98% rename from source/detail/sha.cpp rename to source/detail/crypto/sha.cpp index a2022ca5..bfb3904d 100755 --- a/source/detail/sha.cpp +++ b/source/detail/crypto/sha.cpp @@ -6,6 +6,10 @@ #include "sha.hpp" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wsign-conversion" +#pragma clang diagnostic ignored "-Wshorten-64-to-32" + namespace SHA1 { class SHA1 @@ -519,3 +523,5 @@ std::vector SHA::sha512(const std::vector &data) { return SHA512::digest(data); } + +#pragma clang diagnostic pop diff --git a/source/detail/sha.hpp b/source/detail/crypto/sha.hpp similarity index 100% rename from source/detail/sha.hpp rename to source/detail/crypto/sha.hpp diff --git a/source/detail/tomcrypt.h b/source/detail/crypto/tomcrypt.h similarity index 100% rename from source/detail/tomcrypt.h rename to source/detail/crypto/tomcrypt.h diff --git a/source/detail/tomcrypt_argchk.h b/source/detail/crypto/tomcrypt_argchk.h similarity index 100% rename from source/detail/tomcrypt_argchk.h rename to source/detail/crypto/tomcrypt_argchk.h diff --git a/source/detail/tomcrypt_cfg.h b/source/detail/crypto/tomcrypt_cfg.h similarity index 100% rename from source/detail/tomcrypt_cfg.h rename to source/detail/crypto/tomcrypt_cfg.h diff --git a/source/detail/tomcrypt_cipher.h b/source/detail/crypto/tomcrypt_cipher.h similarity index 100% rename from source/detail/tomcrypt_cipher.h rename to source/detail/crypto/tomcrypt_cipher.h diff --git a/source/detail/tomcrypt_custom.h b/source/detail/crypto/tomcrypt_custom.h similarity index 100% rename from source/detail/tomcrypt_custom.h rename to source/detail/crypto/tomcrypt_custom.h diff --git a/source/detail/tomcrypt_hash.h b/source/detail/crypto/tomcrypt_hash.h similarity index 100% rename from source/detail/tomcrypt_hash.h rename to source/detail/crypto/tomcrypt_hash.h diff --git a/source/detail/tomcrypt_mac.h b/source/detail/crypto/tomcrypt_mac.h similarity index 100% rename from source/detail/tomcrypt_mac.h rename to source/detail/crypto/tomcrypt_mac.h diff --git a/source/detail/tomcrypt_macros.h b/source/detail/crypto/tomcrypt_macros.h similarity index 100% rename from source/detail/tomcrypt_macros.h rename to source/detail/crypto/tomcrypt_macros.h diff --git a/source/detail/tomcrypt_math.h b/source/detail/crypto/tomcrypt_math.h similarity index 100% rename from source/detail/tomcrypt_math.h rename to source/detail/crypto/tomcrypt_math.h diff --git a/source/detail/tomcrypt_misc.h b/source/detail/crypto/tomcrypt_misc.h similarity index 100% rename from source/detail/tomcrypt_misc.h rename to source/detail/crypto/tomcrypt_misc.h diff --git a/source/detail/tomcrypt_pk.h b/source/detail/crypto/tomcrypt_pk.h similarity index 100% rename from source/detail/tomcrypt_pk.h rename to source/detail/crypto/tomcrypt_pk.h diff --git a/source/detail/tomcrypt_pkcs.h b/source/detail/crypto/tomcrypt_pkcs.h similarity index 100% rename from source/detail/tomcrypt_pkcs.h rename to source/detail/crypto/tomcrypt_pkcs.h diff --git a/source/detail/tomcrypt_prng.h b/source/detail/crypto/tomcrypt_prng.h similarity index 100% rename from source/detail/tomcrypt_prng.h rename to source/detail/crypto/tomcrypt_prng.h diff --git a/source/detail/xlsx_crypto.cpp b/source/detail/crypto/xlsx_crypto.cpp similarity index 99% rename from source/detail/xlsx_crypto.cpp rename to source/detail/crypto/xlsx_crypto.cpp index 75b6a8cd..f502fe2e 100644 --- a/source/detail/xlsx_crypto.cpp +++ b/source/detail/crypto/xlsx_crypto.cpp @@ -21,11 +21,11 @@ // @license: http://www.opensource.org/licenses/mit-license.php // @author: see AUTHORS file -#include -#include -#include +#include +#include +#include #include -#include +#include namespace { diff --git a/source/detail/xlsx_crypto.hpp b/source/detail/crypto/xlsx_crypto.hpp similarity index 100% rename from source/detail/xlsx_crypto.hpp rename to source/detail/crypto/xlsx_crypto.hpp diff --git a/source/detail/xml/details/config.h b/source/detail/xml/details/config.h deleted file mode 100644 index da254f6e..00000000 --- a/source/detail/xml/details/config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* file : xml/details/config.h.in - * copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC - * license : MIT; see accompanying LICENSE file - */ - -/* This file is automatically processed by configure. */ - -#ifndef XML_DETAILS_CONFIG_H -#define XML_DETAILS_CONFIG_H - -#undef LIBSTUDXML_STATIC_LIB -#define LIBSTUDXML_STATIC_LIB -#undef LIBSTUDXML_EXTERNAL_EXPAT -#undef LIBSTUDXML_BYTEORDER - -#endif /* XML_DETAILS_CONFIG_H */ diff --git a/source/workbook/tests/test_round_trip.hpp b/source/workbook/tests/test_round_trip.hpp index 0c9086ed..281b3198 100644 --- a/source/workbook/tests/test_round_trip.hpp +++ b/source/workbook/tests/test_round_trip.hpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/third-party/libstudxml/CMakeLists.txt b/third-party/libstudxml/CMakeLists.txt index 427d4397..60bd283d 100644 --- a/third-party/libstudxml/CMakeLists.txt +++ b/third-party/libstudxml/CMakeLists.txt @@ -28,8 +28,6 @@ set(GENX set(EXPAT ${LIBSTUDXML_ROOT_DIR}/xml/details/expat/xmlparse.c ${LIBSTUDXML_ROOT_DIR}/xml/details/expat/xmlrole.c - ${LIBSTUDXML_ROOT_DIR}/xml/details/expat/xmltok_impl.c - ${LIBSTUDXML_ROOT_DIR}/xml/details/expat/xmltok_ns.c ${LIBSTUDXML_ROOT_DIR}/xml/details/expat/xmltok.c ${LIBSTUDXML_ROOT_DIR}/xml/details/expat/ascii.h ${LIBSTUDXML_ROOT_DIR}/xml/details/expat/asciitab.h