cosmetics sync
authorVolker Birk <vb@pep.foundation>
Sun, 21 Oct 2018 13:44:55 +0200
branchsync
changeset 2993f5f25280e32
parent 298 06734cf5b96a
child 300 c56d273d3694
cosmetics
GateKeeper.cpp
pEpCOMServerAdapter.vcxproj
     1.1 --- a/GateKeeper.cpp	Sat Oct 20 23:07:43 2018 +0200
     1.2 +++ b/GateKeeper.cpp	Sun Oct 21 13:44:55 2018 +0200
     1.3 @@ -271,19 +271,19 @@
     1.4      {
     1.5          string result;
     1.6  
     1.7 -        BCRYPT_KEY_HANDLE hUpdateKey;
     1.8 +        BCRYPT_KEY_HANDLE hUpdateKey = NULL;
     1.9          string _update_key = update_key();
    1.10  
    1.11 -        PCERT_PUBLIC_KEY_INFO uk;
    1.12 -        DWORD uk_size;
    1.13 +        PCERT_PUBLIC_KEY_INFO uk = NULL;
    1.14 +        DWORD uk_size = 0;
    1.15  
    1.16          BOOL bResult = CryptDecodeObjectEx(X509_ASN_ENCODING, X509_PUBLIC_KEY_INFO,
    1.17              (const BYTE *)_update_key.data(), _update_key.size(), CRYPT_DECODE_ALLOC_FLAG, NULL, &uk, &uk_size);
    1.18          if (!bResult)
    1.19              throw runtime_error("CryptDecodeObjectEx: X509_PUBLIC_KEY_INFO");
    1.20  
    1.21 -        PUBLIC_KEY_VALUES *_uk;
    1.22 -        DWORD _uk_size;
    1.23 +        PUBLIC_KEY_VALUES *_uk = NULL;
    1.24 +        DWORD _uk_size = 0;
    1.25  
    1.26          bResult = CryptDecodeObjectEx(X509_ASN_ENCODING, RSA_CSP_PUBLICKEYBLOB,
    1.27              uk->PublicKey.pbData, uk->PublicKey.cbData, CRYPT_DECODE_ALLOC_FLAG, NULL, &_uk, &_uk_size);
    1.28 @@ -293,14 +293,14 @@
    1.29  
    1.30          HRESULT hResult = ImportRsaPublicKey(hRSA, _uk, &hUpdateKey);
    1.31          LocalFree(_uk);
    1.32 -        if (hResult)
    1.33 +        if (!SUCCEEDED(hResult))
    1.34              throw runtime_error("ImportRsaPublicKey");
    1.35  
    1.36          ULONG psize;
    1.37          NTSTATUS status = BCryptGetProperty(hUpdateKey, BCRYPT_ALGORITHM_NAME, NULL, 0, &psize, 0);
    1.38          char *prop = new char[psize];
    1.39          TCHAR *_prop = (TCHAR *)prop;
    1.40 -        BCryptGetProperty(hUpdateKey, BCRYPT_ALGORITHM_NAME, (PUCHAR)prop, psize, &psize, 0);
    1.41 +        status = BCryptGetProperty(hUpdateKey, BCRYPT_ALGORITHM_NAME, (PUCHAR)prop, psize, &psize, 0);
    1.42  
    1.43          ULONG export_size;
    1.44          status = BCryptExportKey(hDeliveryKey, NULL, BCRYPT_KEY_DATA_BLOB, NULL, NULL,
     2.1 --- a/pEpCOMServerAdapter.vcxproj	Sat Oct 20 23:07:43 2018 +0200
     2.2 +++ b/pEpCOMServerAdapter.vcxproj	Sun Oct 21 13:44:55 2018 +0200
     2.3 @@ -42,11 +42,15 @@
     2.4      <IgnoreImportLibrary>true</IgnoreImportLibrary>
     2.5      <LinkIncremental>true</LinkIncremental>
     2.6      <IncludePath>C:\Users\vb\Documents\Visual Studio 2015\Projects\pEp_for_Outlook_Solution;C:\Users\vb\Documents\Visual Studio 2015\Projects\pEp_for_Outlook_Solution\pEpEngine\src;$(IncludePath)</IncludePath>
     2.7 +    <CodeAnalysisRuleSet>C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets\NativeRecommendedRules.ruleset</CodeAnalysisRuleSet>
     2.8 +    <RunCodeAnalysis>true</RunCodeAnalysis>
     2.9    </PropertyGroup>
    2.10    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    2.11      <IgnoreImportLibrary>true</IgnoreImportLibrary>
    2.12      <LinkIncremental>false</LinkIncremental>
    2.13      <IncludePath>C:\Users\vb\Documents\Visual Studio 2015\Projects\pEp_for_Outlook_Solution;C:\Users\vb\Documents\Visual Studio 2015\Projects\pEp_for_Outlook_Solution\pEpEngine\src;$(IncludePath)</IncludePath>
    2.14 +    <CodeAnalysisRuleSet>C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets\NativeRecommendedRules.ruleset</CodeAnalysisRuleSet>
    2.15 +    <RunCodeAnalysis>true</RunCodeAnalysis>
    2.16    </PropertyGroup>
    2.17    <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
    2.18      <PostBuildEvent>
    2.19 @@ -68,6 +72,7 @@
    2.20        <Optimization>Disabled</Optimization>
    2.21        <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    2.22        <SDLCheck>true</SDLCheck>
    2.23 +      <EnablePREfast>true</EnablePREfast>
    2.24      </ClCompile>
    2.25      <Midl>
    2.26        <MkTypLibCompatible>false</MkTypLibCompatible>
    2.27 @@ -101,6 +106,7 @@
    2.28        <Optimization>MaxSpeed</Optimization>
    2.29        <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    2.30        <SDLCheck>true</SDLCheck>
    2.31 +      <EnablePREfast>true</EnablePREfast>
    2.32      </ClCompile>
    2.33      <Midl>
    2.34        <MkTypLibCompatible>false</MkTypLibCompatible>