summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xPICA_client.c11
-rwxr-xr-xPICA_client.h47
-rwxr-xr-xPICA_node.c2
-rwxr-xr-xPICA_node.h1
-rwxr-xr-xPICA_nodeaddrlist.h6
-rw-r--r--iniparser/src/dictionary.c2
-rw-r--r--iniparser/src/dictionary.h2
-rw-r--r--pica-client/dialogs/viewcertdialog.cpp4
-rw-r--r--pica-client/main.cpp10
-rw-r--r--pica-client/openssltool.cpp3
10 files changed, 51 insertions, 37 deletions
diff --git a/PICA_client.c b/PICA_client.c
index 5abace3..fb2353e 100755
--- a/PICA_client.c
+++ b/PICA_client.c
@@ -573,6 +573,10 @@ void locking_cb(int mode, int type, char *file, int line)
int PICA_client_init(struct PICA_client_callbacks *clcbs)
{
struct sockaddr_in sd;
+#ifdef WIN32
+WSADATA wsd;
+WSAStartup(MAKEWORD(2,2),&wsd);
+#endif
if (!clcbs)
return 0;
@@ -582,10 +586,7 @@ callbacks=*clcbs;
SSL_load_error_strings();
SSL_library_init();
-#ifdef WIN32
-WSADATA wsd;
-WSAStartup(MAKEWORD(2,2),&wsd);
-#endif
+
#ifdef NO_RAND_DEV
PICA_rand_seed();
@@ -934,7 +935,7 @@ while(ipt)
ipt=ipt->next;
}
-#warning "make sockets non-blocking!!!!"
+//#warning "make sockets non-blocking!!!!"
ret=select(nfds+1,&fds,0,0,&tv);
diff --git a/PICA_client.h b/PICA_client.h
index 1c5d68b..8d9299a 100755
--- a/PICA_client.h
+++ b/PICA_client.h
@@ -1,31 +1,13 @@
#ifndef PICA_CLIENT_H
#define PICA_CLIENT_H
-#include <openssl/crypto.h>
-#include <openssl/x509.h>
-#include <openssl/pem.h>
-#include <openssl/ssl.h>
-#include <openssl/err.h>
-#include <openssl/bio.h>
-
-
-#ifdef PICA_MULTITHREADED
-
-#define OPENSSL_THREAD_DEFINES
-#include <openssl/opensslconf.h>
-#if defined(OPENSSL_THREADS)
- // thread support enabled
-#else
-#error "THREAD SUPPORT IS NOT ENABLED IN OPENSSL!"
-#endif
-
-#endif
-
-
#ifdef WIN32
-#include <windows.h>
#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <windows.h>
+
+typedef unsigned __int16 uint16_t;
#else
@@ -45,6 +27,25 @@
#endif
+#include <openssl/crypto.h>
+#include <openssl/x509.h>
+#include <openssl/pem.h>
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include <openssl/bio.h>
+
+#ifdef PICA_MULTITHREADED
+
+#define OPENSSL_THREAD_DEFINES
+#include <openssl/opensslconf.h>
+#if defined(OPENSSL_THREADS)
+ // thread support enabled
+#else
+#error "THREAD SUPPORT IS NOT ENABLED IN OPENSSL!"
+#endif
+
+#endif
+
//#define PICA_MSGOK 3
//#define PICA_MSGUTF8 2
#define PICA_NEWCHAN 1
@@ -79,7 +80,7 @@ struct PICA_chaninfo;
struct PICA_conninfo
{
-#warning "sockaddr!"
+//#warning "sockaddr!"
struct sockaddr_in srv_addr; // sockaddr !!
unsigned int id;
SSL_CTX* ctx;
diff --git a/PICA_node.c b/PICA_node.c
index 5f9d277..e8b72a5 100755
--- a/PICA_node.c
+++ b/PICA_node.c
@@ -5,8 +5,6 @@
#include <limits.h>
#include <string.h>
#include <time.h>
-#include <sys/time.h>
-#include <unistd.h>
#include <getopt.h>
#include "PICA_node.h"
diff --git a/PICA_node.h b/PICA_node.h
index d0eb04b..13de6b3 100755
--- a/PICA_node.h
+++ b/PICA_node.h
@@ -17,6 +17,7 @@
#include <sys/ioctl.h>
#include <unistd.h>
#include <sys/errno.h>
+#include <sys/time.h>
#define SOCKET int
#define SOCKET_ERROR -1
diff --git a/PICA_nodeaddrlist.h b/PICA_nodeaddrlist.h
index 88de822..c9242e4 100755
--- a/PICA_nodeaddrlist.h
+++ b/PICA_nodeaddrlist.h
@@ -3,7 +3,13 @@
#ifndef PICA_NODEADDRLIST_H
#define PICA_NODEADDRLIST_H
+#ifndef WIN32
#include <netinet/in.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
#include <time.h>
struct PICA_nodeaddr_ipv4
diff --git a/iniparser/src/dictionary.c b/iniparser/src/dictionary.c
index 3f0f5cf..91a4a71 100644
--- a/iniparser/src/dictionary.c
+++ b/iniparser/src/dictionary.c
@@ -18,7 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
+//#include <unistd.h>
/** Maximum value size for integers and doubles. */
#define MAXVALSZ 1024
diff --git a/iniparser/src/dictionary.h b/iniparser/src/dictionary.h
index 34c4b82..f142cbc 100644
--- a/iniparser/src/dictionary.h
+++ b/iniparser/src/dictionary.h
@@ -21,7 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
+//#include <unistd.h>
/*---------------------------------------------------------------------------
New types
diff --git a/pica-client/dialogs/viewcertdialog.cpp b/pica-client/dialogs/viewcertdialog.cpp
index 7a41401..f75e7f3 100644
--- a/pica-client/dialogs/viewcertdialog.cpp
+++ b/pica-client/dialogs/viewcertdialog.cpp
@@ -2,10 +2,6 @@
#include "../openssltool.h"
#include <QVBoxLayout>
#include <QMessageBox>
-
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/wait.h>
#include <QFile>
ViewCertDialog::ViewCertDialog(QWidget *parent) :
diff --git a/pica-client/main.cpp b/pica-client/main.cpp
index 184e73b..9a71a43 100644
--- a/pica-client/main.cpp
+++ b/pica-client/main.cpp
@@ -29,7 +29,11 @@ class PicaSysTray *systray;
// /usr/share/pica-client/pica-pica_CA.pem
//QString config_defaultCA("/home/root_jr/files/projects/picapica_wc/localhost/project_picapica/trunk/tests/trusted_CA.pem");
+#ifndef WIN32
QString config_defaultCA(PICA_INSTALLPREFIX"/share/pica-client/CA.pem");
+#else
+QString config_defaultCA("share\\CA.pem");
+#endif
static bool create_config_dir()
{
@@ -134,9 +138,13 @@ int main(int argc, char *argv[])
if (!create_config_dir())
return -1;
-
+#ifndef WIN32
picapica_ico_sit = QIcon(PICA_INSTALLPREFIX"/share/pica-client/picapica-icon-sit.png");
picapica_ico_fly = QIcon(PICA_INSTALLPREFIX"/share/pica-client/picapica-icon-fly.png");
+#else
+ picapica_ico_sit = QIcon("share\\picapica-icon-sit.png");
+ picapica_ico_fly = QIcon("share\\picapica-icon-fly.png");
+#endif
PicaActionCenter ac;
action_center = &ac;
diff --git a/pica-client/openssltool.cpp b/pica-client/openssltool.cpp
index 29cb3b7..2c19223 100644
--- a/pica-client/openssltool.cpp
+++ b/pica-client/openssltool.cpp
@@ -102,6 +102,9 @@ bool OpenSSLTool::GenCSRSignal(QString csr_file, QString keyfile, QString subjec
openssl_.start("openssl",
QStringList()
<<"req"
+#ifdef WIN32
+ <<"-config"<<"openssl.cnf"
+#endif
<<"-out"<<csr_file
<<"-key"<<keyfile
<<"-subj"<<"/CN=" + subject