-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
184 changed files
with
59,888 additions
and
83,579 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.29613.14 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tests", "Tests\Tests.vcxproj", "{C5D01CCB-1BD0-4C88-869E-2DC9334B1A97}" | ||
ProjectSection(ProjectDependencies) = postProject | ||
{6DB4CA8D-7529-4310-A4CF-F3DED2D143CC} = {6DB4CA8D-7529-4310-A4CF-F3DED2D143CC} | ||
EndProjectSection | ||
EndProject | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CppClientCore", "CppClientCore\CppClientCore.vcxproj", "{6DB4CA8D-7529-4310-A4CF-F3DED2D143CC}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{C5D01CCB-1BD0-4C88-869E-2DC9334B1A97}.Debug|x64.ActiveCfg = Debug|x64 | ||
{C5D01CCB-1BD0-4C88-869E-2DC9334B1A97}.Debug|x64.Build.0 = Debug|x64 | ||
{C5D01CCB-1BD0-4C88-869E-2DC9334B1A97}.Debug|x86.ActiveCfg = Debug|Win32 | ||
{C5D01CCB-1BD0-4C88-869E-2DC9334B1A97}.Debug|x86.Build.0 = Debug|Win32 | ||
{C5D01CCB-1BD0-4C88-869E-2DC9334B1A97}.Release|x64.ActiveCfg = Release|x64 | ||
{C5D01CCB-1BD0-4C88-869E-2DC9334B1A97}.Release|x64.Build.0 = Release|x64 | ||
{C5D01CCB-1BD0-4C88-869E-2DC9334B1A97}.Release|x86.ActiveCfg = Release|Win32 | ||
{C5D01CCB-1BD0-4C88-869E-2DC9334B1A97}.Release|x86.Build.0 = Release|Win32 | ||
{6DB4CA8D-7529-4310-A4CF-F3DED2D143CC}.Debug|x64.ActiveCfg = Debug|x64 | ||
{6DB4CA8D-7529-4310-A4CF-F3DED2D143CC}.Debug|x64.Build.0 = Debug|x64 | ||
{6DB4CA8D-7529-4310-A4CF-F3DED2D143CC}.Debug|x86.ActiveCfg = Debug|Win32 | ||
{6DB4CA8D-7529-4310-A4CF-F3DED2D143CC}.Debug|x86.Build.0 = Debug|Win32 | ||
{6DB4CA8D-7529-4310-A4CF-F3DED2D143CC}.Release|x64.ActiveCfg = Release|x64 | ||
{6DB4CA8D-7529-4310-A4CF-F3DED2D143CC}.Release|x64.Build.0 = Release|x64 | ||
{6DB4CA8D-7529-4310-A4CF-F3DED2D143CC}.Release|x86.ActiveCfg = Release|Win32 | ||
{6DB4CA8D-7529-4310-A4CF-F3DED2D143CC}.Release|x86.Build.0 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {4CC99074-7674-465D-A290-F234FF84590E} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* * * * * * * * * * * * * * * * * * * * * | ||
** | ||
** Copyright 2019 NetKnights GmbH | ||
** Author: Nils Behlen | ||
** | ||
** Licensed under the Apache License, Version 2.0 (the "License"); | ||
** you may not use this file except in compliance with the License. | ||
** You may obtain a copy of the License at | ||
** | ||
** http://www.apache.org/licenses/LICENSE-2.0 | ||
** | ||
** Unless required by applicable law or agreed to in writing, software | ||
** distributed under the License is distributed on an "AS IS" BASIS, | ||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
** See the License for the specific language governing permissions and | ||
** limitations under the License. | ||
** | ||
** * * * * * * * * * * * * * * * * * * */ | ||
#include "Challenge.h" | ||
#include "PrivacyIDEA.h" | ||
|
||
std::string Challenge::toString() | ||
{ | ||
return "Challenge: serial=" + serial + ", transaction_id=" + transaction_id + ", tta=" + ttaToString(tta) | ||
+ ", message=" + PrivacyIDEA::ws2s(message); | ||
} | ||
|
||
std::string Challenge::ttaToString(TTA in) | ||
{ | ||
switch (in) | ||
{ | ||
case TTA::NOT_SET: return "NOT_SET"; | ||
case TTA::OTP: return "OTP"; | ||
case TTA::PUSH: return "PUSH"; | ||
case TTA::BOTH: return "BOTH"; | ||
} | ||
return std::string(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* * * * * * * * * * * * * * * * * * * * * | ||
** | ||
** Copyright 2019 NetKnights GmbH | ||
** Author: Nils Behlen | ||
** | ||
** Licensed under the Apache License, Version 2.0 (the "License"); | ||
** you may not use this file except in compliance with the License. | ||
** You may obtain a copy of the License at | ||
** | ||
** http://www.apache.org/licenses/LICENSE-2.0 | ||
** | ||
** Unless required by applicable law or agreed to in writing, software | ||
** distributed under the License is distributed on an "AS IS" BASIS, | ||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
** See the License for the specific language governing permissions and | ||
** limitations under the License. | ||
** | ||
** * * * * * * * * * * * * * * * * * * */ | ||
#pragma once | ||
#include <string> | ||
#include <vector> | ||
|
||
// Token Type Available | ||
enum class TTA | ||
{ | ||
NOT_SET, | ||
OTP, | ||
PUSH, | ||
BOTH | ||
}; | ||
|
||
class Challenge | ||
{ | ||
public: | ||
std::string toString(); | ||
|
||
std::wstring message = L""; | ||
|
||
std::string transaction_id = ""; | ||
|
||
std::string serial = ""; | ||
|
||
TTA tta = TTA::NOT_SET; | ||
|
||
private: | ||
std::string ttaToString(TTA tta); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* * * * * * * * * * * * * * * * * * * * * | ||
** | ||
** Copyright 2019 NetKnights GmbH | ||
** Author: Nils Behlen | ||
** | ||
** Licensed under the Apache License, Version 2.0 (the "License"); | ||
** you may not use this file except in compliance with the License. | ||
** You may obtain a copy of the License at | ||
** | ||
** http://www.apache.org/licenses/LICENSE-2.0 | ||
** | ||
** Unless required by applicable law or agreed to in writing, software | ||
** distributed under the License is distributed on an "AS IS" BASIS, | ||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
** See the License for the specific language governing permissions and | ||
** limitations under the License. | ||
** | ||
** * * * * * * * * * * * * * * * * * * */ | ||
#pragma once | ||
|
||
// 7880900-0X PRIVACYIDEA CODES | ||
#define PI_TRANSACTION_SUCCESS ((HRESULT)0x78809004) | ||
#define PI_TRANSACTION_FAILURE ((HRESULT)0x78809005) | ||
#define PI_OFFLINE_OTP_SUCCESS ((HRESULT)0x78809006) | ||
#define PI_OFFLINE_OTP_FAILURE ((HRESULT)0x78809007) | ||
#define PI_NO_CHALLENGES ((HRESULT)0x78809009) | ||
|
||
#define PI_ERROR_EMPTY_RESPONSE ((HRESULT)0x7880900E) | ||
#define PI_STATUS_NOT_SET ((HRESULT)0x7880900F) | ||
|
||
// 888090-1X VALIDATE CHECK RETURN CODES | ||
#define PI_AUTH_SUCCESS ((HRESULT)0x88809010) | ||
#define PI_AUTH_FAILURE ((HRESULT)0x88809011) | ||
|
||
// This means there was an error specified in the response from Privacyidea | ||
// The error can be retrieved by calling getLastError and getLastErrorMessage | ||
#define PI_AUTH_ERROR ((HRESULT)0x88809012) | ||
#define PI_TRIGGERED_CHALLENGE ((HRESULT)0x88809013) | ||
|
||
// This means either the server is really unavailable while the user thought it would be available | ||
// OR | ||
// The user meant to authenticate offline (and expects the server to be unavailable) but the entered OTP didn't match the offlineData | ||
// NOTE this implies there was offlineData available for the user | ||
#define PI_WRONG_OFFLINE_SERVER_UNAVAILABLE ((HRESULT)0x88809014) | ||
#define PI_ENDPOINT_SETUP_ERROR ((HRESULT)0x88809015) | ||
|
||
|
||
// 888090-2X OFFLINE CODES | ||
#define PI_OFFLINE_DATA_NO_OTPS_LEFT ((HRESULT)0x88809020) | ||
#define PI_OFFLINE_DATA_USER_NOT_FOUND ((HRESULT)0x88809021) | ||
#define PI_OFFLINE_NO_OFFLINE_DATA ((HRESULT)0x88809022) | ||
#define PI_OFFLINE_FILE_DOES_NOT_EXIST ((HRESULT)0x88809023) | ||
#define PI_OFFLINE_FILE_EMPTY ((HRESULT)0x88809024) | ||
#define PI_OFFLINE_WRONG_OTP ((HRESULT)0x88809025) | ||
|
||
// 888090-3X JSON ERRORS | ||
#define PI_JSON_FORMAT_ERROR ((HRESULT)0x88809030) | ||
#define PI_JSON_PARSE_ERROR ((HRESULT)0x88809031) | ||
#define PI_JSON_ERROR_CONTAINED ((HRESULT)0x88809032) | ||
|
||
// 888090-4X ENDPOINT ERRORS | ||
// Use only those for now, since there is no need for the code to differentiate the error further | ||
// The "real" cause is logged right after the error occurs in the endpoint | ||
#define PI_ENDPOINT_SERVER_UNAVAILABLE ((HRESULT)0x88809041) |
63 changes: 63 additions & 0 deletions
63
CppClientCore/CppClientCore/Cpp Client Core.vcxproj.filters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<Filter Include="Source Files"> | ||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> | ||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> | ||
</Filter> | ||
<Filter Include="Header Files"> | ||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> | ||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions> | ||
</Filter> | ||
<Filter Include="Resource Files"> | ||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> | ||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> | ||
</Filter> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="Challenge.cpp"> | ||
<Filter>Source Files</Filter> | ||
</ClCompile> | ||
<ClCompile Include="Endpoint.cpp"> | ||
<Filter>Source Files</Filter> | ||
</ClCompile> | ||
<ClCompile Include="Logger.cpp"> | ||
<Filter>Source Files</Filter> | ||
</ClCompile> | ||
<ClCompile Include="OfflineData.cpp"> | ||
<Filter>Source Files</Filter> | ||
</ClCompile> | ||
<ClCompile Include="OfflineHandler.cpp"> | ||
<Filter>Source Files</Filter> | ||
</ClCompile> | ||
<ClCompile Include="PrivacyIDEA.cpp"> | ||
<Filter>Source Files</Filter> | ||
</ClCompile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="Challenge.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
<ClInclude Include="Endpoint.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
<ClInclude Include="Logger.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
<ClInclude Include="OfflineData.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
<ClInclude Include="OfflineHandler.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
<ClInclude Include="PIConf.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
<ClInclude Include="PrivacyIDEA.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
<ClInclude Include="..\nlohmann\json.hpp"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.
dfe7333
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The read-me file is updated.