From b4b2622d7d0ecdda2ef0ffa1e0f93196b88bca4e Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 16 May 2016 20:36:07 +0200 Subject: [PATCH] Credential importing utility stub added --- CredImport/.gitignore | 2 + CredImport/CredImport.props | 14 ++++ CredImport/CredImport.rc | Bin 0 -> 4874 bytes CredImport/CredImport.vcxproj | 108 ++++++++++++++++++++++++++ CredImport/CredImport.vcxproj.filters | 35 +++++++++ CredImport/Main.cpp | 55 +++++++++++++ CredImport/StdAfx.cpp | 21 +++++ CredImport/StdAfx.h | 28 +++++++ VS10Solution.sln | 13 ++++ 9 files changed, 276 insertions(+) create mode 100644 CredImport/.gitignore create mode 100644 CredImport/CredImport.props create mode 100644 CredImport/CredImport.rc create mode 100644 CredImport/CredImport.vcxproj create mode 100644 CredImport/CredImport.vcxproj.filters create mode 100644 CredImport/Main.cpp create mode 100644 CredImport/StdAfx.cpp create mode 100644 CredImport/StdAfx.h diff --git a/CredImport/.gitignore b/CredImport/.gitignore new file mode 100644 index 0000000..9c8716a --- /dev/null +++ b/CredImport/.gitignore @@ -0,0 +1,2 @@ +/temp +/*.user diff --git a/CredImport/CredImport.props b/CredImport/CredImport.props new file mode 100644 index 0000000..3a8bb73 --- /dev/null +++ b/CredImport/CredImport.props @@ -0,0 +1,14 @@ + + + + + + ..\output\$(Platform).$(Configuration)\ + + + + ..\include;..\lib\WinStd\include;%(AdditionalIncludeDirectories) + + + + \ No newline at end of file diff --git a/CredImport/CredImport.rc b/CredImport/CredImport.rc new file mode 100644 index 0000000000000000000000000000000000000000..c978e7897bee57ac003dea04fdf4a48b22776861 GIT binary patch literal 4874 zcmdUy>uwuG6vxkJB;H{$5^5`O+)^q55mGL;6YAQL*GY+l6y;(kR$V8u9okBLAs&U7 z0)GE9JKbG-Ax-Fqpp`wlGw1R@*O~e2&oz5wpWA1aWY3me+LgVtnT_q-E^NX46KmLG z`_8_}-kveHVXtjyCs55ll3!eH`vcCd4V65ptw&QS!{S(+-_-fwi(wvS#qf?qFS9Y2&4RX4_Cqo$45`B(?{F6W+#P zOiUg)b&5Iv!XrsnA86*T=Zv`%FctkB^|a6*{E<3>+#iXxmdbf1CYy~!T*w~EQ~rI@-0uxs}rZJ(tMjNsEVn)q)&Z z93g{S{@sN(Y~-ET-DAw zl4ESE`&fc^)#IknFFcc!S3!w`iRDx5oxm$!CRT&0Zol%BS2S|~#SCAD4p0Y4?O!CVX)d&)zPhU&M= z?y}FQ-BNo=mZQOX}y_F*>ms_ zbekX&;%&D-T2V&v|F$JYq~+P%Ca&^zYR`#Th9G~J z>PIzLrrIF3+Hspmt6J~l>jSh8pvXPHN|}-eO(g9?+bK{g)6~gFS?wn!+*Ns)TV2MQ zTN`8!>1x_}Zj#ZU&o{snxpW#9o+>__5TsS(5m~Fe*QuzBcY3^~oE)E2at=5t$phkU zIo}4~dzG}IQ{@~*gqz4{yT&3u^|c<}RR+{R5l;H*>@953O=OpDtTRa1^dDJRCplBArc3SV4}qcWyLX38Hma9{daFr1IO>^HiX)x2xhpv-S+I(MJ3 zAM11z|26mAd9-i6a;_AcFS8Tpn6Kb3m$ntJ*MDFXp+oxIrK1IEJ|4!^HX7aoBZT!{q7@ZS^sap~wsIOus z#h4YNRLB0e{BEOf4}H2NUy~gRYQLyu*$Z9l*1aWKUaZ;}kvNtkQ`Yinb3v!5^8UCw zQ|>7TSULMo-K1>Y0BNfCITe!M%tOYh--TYI+J5YL)+pt4jy8W=?%&a?IyHT&bME~< G7yb<`1faA4 literal 0 HcmV?d00001 diff --git a/CredImport/CredImport.vcxproj b/CredImport/CredImport.vcxproj new file mode 100644 index 0000000..ca8eed0 --- /dev/null +++ b/CredImport/CredImport.vcxproj @@ -0,0 +1,108 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {2D3CE079-7EB1-4F47-B79E-F0310671ECCB} + Win32Proj + CredImport + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + {47399d91-7eb9-41de-b521-514ba5db0c43} + + + + + + \ No newline at end of file diff --git a/CredImport/CredImport.vcxproj.filters b/CredImport/CredImport.vcxproj.filters new file mode 100644 index 0000000..27fee2b --- /dev/null +++ b/CredImport/CredImport.vcxproj.filters @@ -0,0 +1,35 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + + + Source Files + + + Source Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/CredImport/Main.cpp b/CredImport/Main.cpp new file mode 100644 index 0000000..f652c1e --- /dev/null +++ b/CredImport/Main.cpp @@ -0,0 +1,55 @@ +/* + Copyright 2015-2016 Amebis + Copyright 2016 GÉANT + + This file is part of GEANTLink. + + GEANTLink is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GEANTLink is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GEANTLink. If not, see . +*/ + +#include "StdAfx.h" + +using namespace std; +using namespace winstd; + + +int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow) +{ + UNREFERENCED_PARAMETER(hInstance); + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + UNREFERENCED_PARAMETER(nCmdShow); + + int nArgs; + unique_ptr > pwcArglist(CommandLineToArgvW(GetCommandLineW(), &nArgs)); + if (pwcArglist == NULL) { + OutputDebugStr(_T("CommandLineToArgvW failed (error %i).\n"), GetLastError()); + return 1; + } + + if (nArgs < 3) { + OutputDebugStr(_T("Not enough parameters.\n")); + return -1; + } + + // Decode password. + vector password; + { + base64_dec dec; + bool is_last; + dec.decode(password, is_last, pwcArglist[2], (size_t)-1); + } + + return 0; +} diff --git a/CredImport/StdAfx.cpp b/CredImport/StdAfx.cpp new file mode 100644 index 0000000..d51397c --- /dev/null +++ b/CredImport/StdAfx.cpp @@ -0,0 +1,21 @@ +/* + Copyright 2015-2016 Amebis + Copyright 2016 GÉANT + + This file is part of GEANTLink. + + GEANTLink is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GEANTLink is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GEANTLink. If not, see . +*/ + +#include "StdAfx.h" diff --git a/CredImport/StdAfx.h b/CredImport/StdAfx.h new file mode 100644 index 0000000..bbb3545 --- /dev/null +++ b/CredImport/StdAfx.h @@ -0,0 +1,28 @@ +/* + Copyright 2015-2016 Amebis + Copyright 2016 GÉANT + + This file is part of GEANTLink. + + GEANTLink is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GEANTLink is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GEANTLink. If not, see . +*/ + +#pragma once + +#include + +#include +#include + +#include diff --git a/VS10Solution.sln b/VS10Solution.sln index 11e9557..6eb7bdf 100644 --- a/VS10Solution.sln +++ b/VS10Solution.sln @@ -14,6 +14,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinStd", "lib\WinStd\build\WinStd.vcxproj", "{47399D91-7EB9-41DE-B521-514BA5DB0C43}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{7B5EC9B7-208C-426A-941D-DAF9271BD4A4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CredImport", "CredImport\CredImport.vcxproj", "{2D3CE079-7EB1-4F47-B79E-F0310671ECCB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -38,6 +42,14 @@ Global {47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|Win32.Build.0 = Release|Win32 {47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|x64.ActiveCfg = Release|x64 {47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|x64.Build.0 = Release|x64 + {2D3CE079-7EB1-4F47-B79E-F0310671ECCB}.Debug|Win32.ActiveCfg = Debug|Win32 + {2D3CE079-7EB1-4F47-B79E-F0310671ECCB}.Debug|Win32.Build.0 = Debug|Win32 + {2D3CE079-7EB1-4F47-B79E-F0310671ECCB}.Debug|x64.ActiveCfg = Debug|x64 + {2D3CE079-7EB1-4F47-B79E-F0310671ECCB}.Debug|x64.Build.0 = Debug|x64 + {2D3CE079-7EB1-4F47-B79E-F0310671ECCB}.Release|Win32.ActiveCfg = Release|Win32 + {2D3CE079-7EB1-4F47-B79E-F0310671ECCB}.Release|Win32.Build.0 = Release|Win32 + {2D3CE079-7EB1-4F47-B79E-F0310671ECCB}.Release|x64.ActiveCfg = Release|x64 + {2D3CE079-7EB1-4F47-B79E-F0310671ECCB}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -45,5 +57,6 @@ Global GlobalSection(NestedProjects) = preSolution {331B6077-E3E2-4867-B93E-9D3F57280DE7} = {60BAAC3D-DC98-4C19-BC40-1A86963DE86C} {47399D91-7EB9-41DE-B521-514BA5DB0C43} = {E66A3FE1-4EE4-401F-8EAD-BE518B230393} + {2D3CE079-7EB1-4F47-B79E-F0310671ECCB} = {7B5EC9B7-208C-426A-941D-DAF9271BD4A4} EndGlobalSection EndGlobal