- ricompilate versioni a 32bit con v141_xp (VisualStudio 2017 C++ per XP)
- eliminate le correzioni introdotte per compilare con VS2013.
This commit is contained in:
SaraP
2022-05-02 09:54:14 +02:00
parent 29ef15276e
commit 522c48f27e
18 changed files with 40 additions and 170 deletions
+3 -3
View File
@@ -102,15 +102,15 @@ namespace NMR {
void * m_pUserData;
};
inline nfUint64 fnGetAlgorithmInitVectorSize(eKeyStoreEncryptAlgorithm ea) {
constexpr nfUint64 fnGetAlgorithmInitVectorSize(eKeyStoreEncryptAlgorithm ea) {
return 12;
}
inline nfUint64 fnGetAlgorithmKeySize(eKeyStoreEncryptAlgorithm ea) {
constexpr nfUint64 fnGetAlgorithmKeySize(eKeyStoreEncryptAlgorithm ea) {
return 32;
}
inline nfUint64 fnGetAlgorithmAuthTagSize(eKeyStoreEncryptAlgorithm ea) {
constexpr nfUint64 fnGetAlgorithmAuthTagSize(eKeyStoreEncryptAlgorithm ea) {
return 16;
}
}
@@ -30,10 +30,31 @@ NMR_ModelReaderNode_KeyStoreKeyValue.h defines the Model Reader Node class that
--*/
#pragma once
#if defined( _WIN64)
#include "NMR_ModelReaderNode_StringValue_x64.h"
#else
#include "NMR_ModelReaderNode_StringValue_x32.h"
#endif
#ifndef __NMR_MODELREADERNODE_KEYSTOREKEYVALUE
#define __NMR_MODELREADERNODE_KEYSTOREKEYVALUE
#include "Model/Reader/NMR_ModelReaderNode_KeyStoreBase.h"
#include "Model/Reader/NMR_ModelReaderNode.h"
#include "Model/Classes/NMR_KeyStore.h"
#include "Common/NMR_Local.h"
namespace NMR {
class CModelReaderNode_StringValue: public CModelReaderNode {
private:
std::string m_sKeyValue;
protected:
void OnText(_In_z_ const nfChar * pText, _In_ CXmlReader * pXMLReader);
public:
CModelReaderNode_StringValue() = delete;
using CModelReaderNode::CModelReaderNode;
std::string const & getValue() const;
virtual void parseXML(_In_ CXmlReader * pXMLReader);
};
typedef std::shared_ptr <CModelReaderNode_StringValue> PModelReaderNode_StringValue;
}
#endif // __NMR_MODELREADERNODE_KEYSTOREKEYVALUE
@@ -1,62 +0,0 @@
/*++
Copyright (C) 2019 3MF Consortium
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Abstract:
NMR_ModelReaderNode_KeyStoreKeyValue.h defines the Model Reader Node class that is related to <keyvalue>.
--*/
#ifndef __NMR_MODELREADERNODE_KEYSTOREKEYVALUE
#define __NMR_MODELREADERNODE_KEYSTOREKEYVALUE
#include "Model/Reader/NMR_ModelReaderNode_KeyStoreBase.h"
#include "Model/Reader/NMR_ModelReaderNode.h"
#include "Model/Classes/NMR_KeyStore.h"
#include "Common/NMR_Local.h"
namespace NMR {
class CModelReaderNode_StringValue: public CModelReaderNode {
private:
std::string m_sKeyValue;
protected:
void OnText(_In_z_ const nfChar * pText, _In_ CXmlReader * pXMLReader);
public:
CModelReaderNode_StringValue() = delete;
using CModelReaderNode::CModelReaderNode;
CModelReaderNode_StringValue(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor = nullptr):
CModelReaderNode( pWarnings, pProgressMonitor){};
std::string const & getValue() const;
virtual void parseXML(_In_ CXmlReader * pXMLReader);
};
typedef std::shared_ptr <CModelReaderNode_StringValue> PModelReaderNode_StringValue;
}
#endif // __NMR_MODELREADERNODE_KEYSTOREKEYVALUE
@@ -1,59 +0,0 @@
/*++
Copyright (C) 2019 3MF Consortium
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Abstract:
NMR_ModelReaderNode_KeyStoreKeyValue.h defines the Model Reader Node class that is related to <keyvalue>.
--*/
#ifndef __NMR_MODELREADERNODE_KEYSTOREKEYVALUE
#define __NMR_MODELREADERNODE_KEYSTOREKEYVALUE
#include "Model/Reader/NMR_ModelReaderNode_KeyStoreBase.h"
#include "Model/Reader/NMR_ModelReaderNode.h"
#include "Model/Classes/NMR_KeyStore.h"
#include "Common/NMR_Local.h"
namespace NMR {
class CModelReaderNode_StringValue: public CModelReaderNode {
private:
std::string m_sKeyValue;
protected:
void OnText(_In_z_ const nfChar * pText, _In_ CXmlReader * pXMLReader);
public:
CModelReaderNode_StringValue() = delete;
using CModelReaderNode::CModelReaderNode;
std::string const & getValue() const;
virtual void parseXML(_In_ CXmlReader * pXMLReader);
};
typedef std::shared_ptr <CModelReaderNode_StringValue> PModelReaderNode_StringValue;
}
#endif // __NMR_MODELREADERNODE_KEYSTOREKEYVALUE
@@ -49,9 +49,6 @@ namespace NMR {
CModelReaderNode_KeyStore() = delete;
using CModelReaderNode_KeyStoreBase::CModelReaderNode_KeyStoreBase;
CModelReaderNode_KeyStore(_In_ CModel * const pModel, _In_ CKeyStore * const pKeyStore, _In_ PModelWarnings pWarnings):
CModelReaderNode_KeyStoreBase( pModel,pKeyStore, pWarnings){};
virtual void parseXML(_In_ CXmlReader * pXMLReader);
};
@@ -56,9 +56,6 @@ namespace NMR {
CModelReaderNode_KeyStoreAccessRight() = delete;
using CModelReaderNode_KeyStoreBase::CModelReaderNode_KeyStoreBase;
CModelReaderNode_KeyStoreAccessRight(_In_ CModel * const pModel, _In_ CKeyStore * const pKeyStore, _In_ PModelWarnings pWarnings):
CModelReaderNode_KeyStoreBase( pModel, pKeyStore, pWarnings){};
PKeyStoreAccessRight getAccessRight();
virtual void parseXML(_In_ CXmlReader * pXMLReader);
@@ -57,9 +57,6 @@ namespace NMR {
CModelReaderNode_KeyStoreCEKParams() = delete;
using CModelReaderNode_KeyStoreBase::CModelReaderNode_KeyStoreBase;
CModelReaderNode_KeyStoreCEKParams(_In_ CModel * const pModel, _In_ CKeyStore * const pKeyStore, _In_ PModelWarnings pWarnings):
CModelReaderNode_KeyStoreBase( pModel, pKeyStore, pWarnings){};
PKeyStoreCEKParams getCEKParams();
virtual void parseXML(_In_ CXmlReader * pXMLReader);
@@ -49,10 +49,6 @@ namespace NMR {
CModelReaderNode_KeyStoreCipherValue() = delete;
using CModelReaderNode_KeyStoreBase::CModelReaderNode_KeyStoreBase;
CModelReaderNode_KeyStoreCipherValue(_In_ CModel * const pModel, _In_ CKeyStore * const pKeyStore, _In_ PModelWarnings pWarnings) :
CModelReaderNode_KeyStoreBase( pModel, pKeyStore, pWarnings) {};
std::vector<nfByte> const & getCipherValue() const;
virtual void parseXML(_In_ CXmlReader * pXMLReader);
@@ -51,9 +51,6 @@ namespace NMR {
CModelReaderNode_KeyStoreConsumer() = delete;
using CModelReaderNode_KeyStoreBase::CModelReaderNode_KeyStoreBase;
CModelReaderNode_KeyStoreConsumer(_In_ CModel * const pModel, _In_ CKeyStore * const pKeyStore, _In_ PModelWarnings pWarnings) :
CModelReaderNode_KeyStoreBase( pModel, pKeyStore, pWarnings){};
virtual void parseXML(_In_ CXmlReader * pXMLReader);
};
@@ -54,7 +54,7 @@ namespace NMR {
class CModelReaderNode_KeyStoreKEKParams: public CModelReaderNode_KeyStoreBase {
private:
KEKPARAMS m_sKekParams = KEKPARAMS{ eKeyStoreWrapAlgorithm::RSA_OAEP, eKeyStoreMaskGenerationFunction::MGF1_SHA1, eKeyStoreMessageDigest::SHA1 };
KEKPARAMS m_sKekParams = { eKeyStoreWrapAlgorithm::RSA_OAEP, eKeyStoreMaskGenerationFunction::MGF1_SHA1, eKeyStoreMessageDigest::SHA1 };
nfBool m_bAlgHasMgf = false;
nfBool m_bHasAlgorithm = false;
protected:
@@ -63,9 +63,6 @@ namespace NMR {
CModelReaderNode_KeyStoreKEKParams() = delete;
using CModelReaderNode_KeyStoreBase::CModelReaderNode_KeyStoreBase;
CModelReaderNode_KeyStoreKEKParams(_In_ CModel * const pModel, _In_ CKeyStore * const pKeyStore, _In_ PModelWarnings pWarnings):
CModelReaderNode_KeyStoreBase( pModel, pKeyStore, pWarnings) {};
KEKPARAMS getKekParams();
virtual void parseXML(_In_ CXmlReader * pXMLReader);
@@ -55,9 +55,6 @@ namespace NMR {
CModelReaderNode_KeyStoreResourceData() = delete;
using CModelReaderNode_KeyStoreBase::CModelReaderNode_KeyStoreBase;
CModelReaderNode_KeyStoreResourceData(_In_ CModel * const pModel, _In_ CKeyStore * const pKeyStore, _In_ PModelWarnings pWarnings):
CModelReaderNode_KeyStoreBase( pModel, pKeyStore, pWarnings) {};
PKeyStoreResourceData getResourceData(PKeyStoreResourceDataGroup const & rdg);
virtual void parseXML(_In_ CXmlReader * pXMLReader);
};
@@ -56,9 +56,6 @@ namespace NMR {
CModelReaderNode_KeyStoreResourceDataGroup() = delete;
using CModelReaderNode_KeyStoreBase::CModelReaderNode_KeyStoreBase;
CModelReaderNode_KeyStoreResourceDataGroup(_In_ CModel * const pModel, _In_ CKeyStore * const pKeyStore, _In_ PModelWarnings pWarnings) :
CModelReaderNode_KeyStoreBase( pModel, pKeyStore, pWarnings) {};
virtual void parseXML(_In_ CXmlReader * pXMLReader);
};
@@ -54,10 +54,6 @@ namespace NMR {
public:
using CModelWriterNode_KeyStoreBase::CModelWriterNode_KeyStoreBase;
CModelWriterNode_KeyStore() = delete;
CModelWriterNode_KeyStore(_In_ CXmlWriter * pXMLWriter, _In_ PProgressMonitor pProgressMonitor, _In_ PKeyStore pKeyStore):
CModelWriterNode_KeyStoreBase( pXMLWriter, pProgressMonitor, pKeyStore){};
virtual void writeToXML();
};
+1 -1
View File
@@ -74,7 +74,7 @@ public:
/**
* Returns error message
*/
const char* what() const override;
const char* what() const noexcept override;
};
#endif // __LIB3MF_INTERFACEEXCEPTION_HEADER
+4 -4
View File
@@ -29,13 +29,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v141_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v141_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
@@ -99,7 +99,7 @@
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>__LIB3MF_EXPORTS ; NOMINMAX ; WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<ConformanceMode>false</ConformanceMode>
<AdditionalIncludeDirectories>/Lib3MF/Include ; /Lib3MF/Include/API ; /Lib3MF/Include/Libraries/zlib ; /Lib3MF/Include/Libraries/libzip</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
@@ -123,7 +123,7 @@ copy $(TargetPath) \EgtProg\DllD32</Command>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>__LIB3MF_EXPORTS; NOMINMAX ; WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<ConformanceMode>false</ConformanceMode>
<AdditionalIncludeDirectories>/Lib3MF/Include ; /Lib3MF/Include/API ; /Lib3MF/Include/Libraries/zlib ; /Lib3MF/Include/Libraries/libzip</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
@@ -22,12 +22,12 @@ namespace NMR {
if (isBigEndian()) {
header.Header.Length.length = swapBytes(header.Header.Length.length);
}
size_t sigSize = sizeof(header.Header.Signature.bytes);
constexpr size_t sigSize = sizeof(header.Header.Signature.bytes);
if (strncmp((char *)header.Header.Signature.bytes, "%3McF", sigSize) != 0)
throw CNMRException(NMR_ERROR_COULDNOTREADENCRYPTEDSTREAM);
if (header.Header.majorVersion != 0 || header.Header.minorVersion != 0)
throw CNMRException(NMR_ERROR_ENCRYPTEDCONTENTVERSIONUNSUPPORTED);
size_t headerSize = sizeof(header);
constexpr size_t headerSize = sizeof(header);
nfUint32 remainingBytes = header.Header.Length.length - headerSize;
if (remainingBytes > 0) {
m_rgAdditionalData.resize(remainingBytes, 0);
@@ -38,7 +38,7 @@ namespace NMR {
}
size_t CEncryptionHeader::writeTo(PExportStream to) {
uEncryptedFileHeader header = { { '%', '3', 'M', 'c', 'F', 0, 0, 0, 0, 0, 0, 0 } };
size_t headerSize = sizeof(header);
constexpr size_t headerSize = sizeof(header);
m_nfHeaderSize = (nfUint32)(headerSize + m_rgAdditionalData.size());
header.Header.Length.length = (nfUint32)m_nfHeaderSize;
if (isBigEndian()) {
@@ -39,7 +39,6 @@
#define _ZIP_COMPILING_DEPRECATED
#include "zipint.h"
#define snprintf _snprintf
ZIP_EXTERN int
zip_error_to_str(char *buf, zip_uint64_t len, int ze, int se) {
+1 -1
View File
@@ -58,7 +58,7 @@ Lib3MFResult ELib3MFInterfaceException::getErrorCode ()
return m_errorCode;
}
const char * ELib3MFInterfaceException::what () const
const char * ELib3MFInterfaceException::what () const noexcept
{
return m_errorMessage.c_str();
}