summaryrefslogtreecommitdiffstats
path: root/client/windows
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2009-12-30 16:07:14 +0200
committerYaniv Kamay <ykamay@redhat.com>2010-01-06 16:06:46 +0200
commite38a61900711169d66b1fa7e117b04d49106a1da (patch)
tree15765c0bb0bcf7b8133203340350c09902cec541 /client/windows
parent54a8e5027093baa1c847b43f2fb08bea93e0ed67 (diff)
downloadspice-e38a61900711169d66b1fa7e117b04d49106a1da.tar.gz
spice-e38a61900711169d66b1fa7e117b04d49106a1da.tar.xz
spice-e38a61900711169d66b1fa7e117b04d49106a1da.zip
server,client: server authentication for secured channels. #527411 #549673.
3 available mechanisms: by public key, by host name, and by certificate subject name. In the former method, chain of trust verification is not performed. The CA certificate files are looked for under <spice-config-dir>/spice_truststore.pem windows <spice-config-dir>=%APPDATA%\spicec\ linux <spice-config-dir>=$HOME/.spicec
Diffstat (limited to 'client/windows')
-rw-r--r--client/windows/platform.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/client/windows/platform.cpp b/client/windows/platform.cpp
index 2988827d..8aba5d11 100644
--- a/client/windows/platform.cpp
+++ b/client/windows/platform.cpp
@@ -17,6 +17,8 @@
#include "common.h"
+#include <shlobj.h>
+
#include "platform.h"
#include "win_platform.h"
#include "utils.h"
@@ -28,6 +30,8 @@
#include "cursor.h"
#include "named_pipe.h"
+#define SPICE_CONFIG_DIR "spicec\\"
+
int gdi_handlers = 0;
extern HINSTANCE instance;
@@ -427,6 +431,21 @@ bool Platform::is_monitors_pos_valid()
return true;
}
+void Platform::get_spice_config_dir(std::string& path)
+{
+ char app_data_path[MAX_PATH];
+ HRESULT res = SHGetFolderPathA(NULL, CSIDL_APPDATA, NULL, 0, app_data_path);
+ if (res != S_OK) {
+ throw Exception("get user app data dir failed");
+ }
+
+ path = app_data_path;
+ if (strcmp((app_data_path + strlen(app_data_path) - 2), "\\") != 0) {
+ path += "\\";
+ }
+ path += SPICE_CONFIG_DIR;
+}
+
void Platform::init()
{
create_message_wind();