From 6fba28ee0d5f31f8087500cfe9aa54150f7cb272 Mon Sep 17 00:00:00 2001 From: joss17 Date: Fri, 30 Oct 2009 00:46:58 +0000 Subject: [PATCH] Solve windows gpg bug and modify windows .pro project files qtcreator git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1787 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/libretroshare.pro | 17 ++++++++++++----- libretroshare/src/pqi/authgpg.cc | 4 ++-- libretroshare/src/rsserver/rsinit.cc | 10 +++++----- retroshare-gui/src/RetroShare.pro | 9 +++------ 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index 1368557c9..1330b0863 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -67,7 +67,11 @@ win32-x-g++ { QMAKE_AR = i586-mingw32msvc-ar DEFINES *= STATICLIB WIN32 - SSL_DIR=../../../../openssl + #miniupnp implementation files + HEADERS += upnp/upnputil.h + SOURCES += upnp/upnputil.c + + SSL_DIR=../../../../openssl UPNPC_DIR = ../../../../miniupnpc-1.3 GPG_ERROR_DIR = ../../../../libgpg-error-1.7 GPGME_DIR = ../../../../gpgme-1.1.8 @@ -81,11 +85,15 @@ win32 { OBJECTS_DIR = temp/obj MOC_DIR = temp/moc DEFINES = WINDOWS_SYS WIN32 STATICLIB MINGW - DEFINES *= MINIUPNPC_VERSION=13 + DEFINES *= MINIUPNPC_VERSION=13 DESTDIR = lib + #miniupnp implementation files + HEADERS += upnp/upnputil.h + SOURCES += upnp/upnputil.c - UPNPC_DIR = ../../../../miniupnpc-1.3 + + UPNPC_DIR = ../../../../miniupnpc-1.3 GPG_ERROR_DIR = ../../../../libgpg-error-1.7 GPGME_DIR = ../../../../gpgme-1.1.8 @@ -249,7 +257,6 @@ HEADERS += dbase/cachestrapper.h \ tcponudp/udplayer.h \ tcponudp/udpsorter.h \ upnp/upnphandler.h \ - upnp/UPnPBase.h \ util/rsdebug.h \ util/rsdir.h \ util/rsnet.h \ @@ -258,7 +265,7 @@ HEADERS += dbase/cachestrapper.h \ util/rswin.h \ util/rsversion.h -SOURCES = \ +SOURCES += \ dht/dht_check_peers.cc \ dht/dht_bootstrap.cc \ rsserver/p3face-msgs.cc \ diff --git a/libretroshare/src/pqi/authgpg.cc b/libretroshare/src/pqi/authgpg.cc index 32314a822..d7b2aeaf7 100644 --- a/libretroshare/src/pqi/authgpg.cc +++ b/libretroshare/src/pqi/authgpg.cc @@ -1411,7 +1411,7 @@ bool GPGAuthMgr::getPGPAllList(std::list &ids) bool GPGAuthMgr::decryptText(gpgme_data_t CIPHER, gpgme_data_t PLAIN) { RsStackMutex stack(pgpMtx); /******* LOCKED ******/ - + gpgme_set_armor (CTX, 1); gpg_error_t ERR; if (GPG_ERR_NO_ERROR != (ERR = gpgme_op_decrypt (CTX, CIPHER, PLAIN))) { @@ -1429,7 +1429,7 @@ bool GPGAuthMgr::encryptText(gpgme_data_t PLAIN, gpgme_data_t CIPHER) { gpgme_encrypt_flags_t* flags = new gpgme_encrypt_flags_t(); gpgme_key_t keys[2] = {mOwnGpgCert.key, NULL}; - + gpgme_set_armor (CTX, 1); gpg_error_t ERR; if (GPG_ERR_NO_ERROR != (ERR = gpgme_op_encrypt(CTX, keys, *flags, PLAIN, CIPHER))) { diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 11985df9a..18e15856f 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -1258,11 +1258,11 @@ int RsInit::LoadCertificates(bool autoLoginNT) std::cerr << "let's store the ssl Password into a pgp ecrypted file" << std::endl; FILE *sslPassphraseFile = fopen(RsInitConfig::ssl_passphrase_file.c_str(), "w"); - std::cerr << "opening sslPassphraseFile. : " << RsInitConfig::ssl_passphrase_file.c_str() << std::endl; + std::cerr << "opening sslPassphraseFile : " << RsInitConfig::ssl_passphrase_file.c_str() << std::endl; gpgme_data_t cipher; gpgme_data_t plain; - gpgme_data_new_from_mem(&plain, sslPassword, strlen(sslPassword), 0); - gpgme_error_t error_reading_file = gpgme_data_new_from_stream (&cipher, sslPassphraseFile); + gpgme_data_new_from_mem(&plain, sslPassword, strlen(sslPassword), 1); + gpgme_data_new_from_stream (&cipher, sslPassphraseFile); if (0 < authMgr->encryptText(plain, cipher)) { std::cerr << "Encrypting went ok !" << std::endl; } @@ -1276,10 +1276,10 @@ int RsInit::LoadCertificates(bool autoLoginNT) FILE *sslPassphraseFile = fopen(RsInitConfig::ssl_passphrase_file.c_str(), "r"); if (sslPassphraseFile == NULL) { - std::cerr << "No password povided, and no sslPassphraseFile." << std::endl; + std::cerr << "No password povided, and no sslPassphraseFile : " << RsInitConfig::ssl_passphrase_file.c_str() << std::endl; return 0; } else { - std::cerr << "opening sslPassphraseFile." << std::endl; + std::cerr << "opening sslPassphraseFile : " << RsInitConfig::ssl_passphrase_file.c_str() << std::endl; gpgme_data_t cipher; gpgme_data_t plain; gpgme_data_new (&plain); diff --git a/retroshare-gui/src/RetroShare.pro b/retroshare-gui/src/RetroShare.pro index 374d562c9..45594e5b4 100644 --- a/retroshare-gui/src/RetroShare.pro +++ b/retroshare-gui/src/RetroShare.pro @@ -1,4 +1,4 @@ -CONFIG += qt gui uic qrc resources uitools debug pluginmgr newsettings #release +CONFIG += qt gui uic qrc resources uitools pluginmgr newsettings release QT += network xml script TEMPLATE = app TARGET = RetroShare @@ -63,14 +63,11 @@ win32 { #LIBS += -L"D/Qt/2009.03/qt/plugins/imageformats" #QTPLUGIN += qjpeg + LIBS += ../../libretroshare/src/lib/libretroshare.a LIBS += -L"../../../../lib" - LIBS += -lretroshare -lssl -lcrypto -lgpgme -lpthreadGC2d -lminiupnpc -lz + LIBS += -lssl -lcrypto -lgpgme -lpthreadGC2d -lminiupnpc -lz LIBS += -lws2_32 -luuid -lole32 -liphlpapi -lcrypt32-cygwin -lgdi32 LIBS += -lole32 -lwinmm - - INCLUDEPATH += ../../../../gpgme-1.1.8/src/ - INCLUDEPATH += ../../../../libgpg-error-1.7/src/ - RC_FILE = gui/images/retroshare_win.rc }