- Enabled compile on Windows (bzip2 library needed).

- Fixed crash after the second call to RsInit::InitRetroShare when keyring does not exist.
The instance of AuthSSL was created twice and AuthGPG was deleted without stopping the thread. Stopped the AuthGPG thread on exit of RetroShare.
- Added the correct path to the keyring for Windows in RsInit::copyGnuPGKeyrings.
- Changed the detection of the portable version on Windows from the file "gpg.exe" to the file "portable".

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-OpenPGP@5211 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-06-10 00:29:46 +00:00
parent a91e859b66
commit 1885fb66c4
14 changed files with 92 additions and 15 deletions

View file

@ -193,5 +193,5 @@ void RsServer::rsGlobalShutDown()
#endif
#endif // MINIMAL_LIBRS
// AuthGPGExit();
AuthGPG::exit();
}

View file

@ -254,7 +254,7 @@ void RsInit::InitRsConfig()
#ifdef WINDOWS_SYS
// test for portable version
if (GetFileAttributes (L"gpg.exe") != (DWORD) -1 && GetFileAttributes (L"gpgme-w32spawn.exe") != (DWORD) -1) {
if (GetFileAttributes(L"portable") != (DWORD) -1) {
// use portable version
RsInitConfig::portable = true;
}
@ -718,14 +718,22 @@ bool RsInit::copyGnuPGKeyrings()
if(!RsDirUtil::checkCreateDirectory(pgp_dir))
throw std::runtime_error("Cannot create pgp directory " + pgp_dir) ;
std::string source_public_keyring;
std::string source_secret_keyring;
#ifdef WINDOWS_SYS
std::cerr << "CRITICAL: UNIMPLEMENTED SECTION FOR WINDOWS - Press ^C to abort" << std::endl;
while(true)
Sleep(10000) ;
if (RsInit::isPortable())
{
source_public_keyring = RsInit::RsConfigDirectory() + "/gnupg/pubring.gpg";
source_secret_keyring = RsInit::RsConfigDirectory() + "/gnupg/secring.gpg" ;
} else {
source_public_keyring = RsInitConfig::basedir + "/../gnupg/pubring.gpg" ;
source_secret_keyring = RsInitConfig::basedir + "/../gnupg/secring.gpg" ;
}
#else
// We need a specific part for MacOS and Linux as well
std::string source_public_keyring = RsInitConfig::basedir + "/../.gnupg/pubring.gpg" ;
std::string source_secret_keyring = RsInitConfig::basedir + "/../.gnupg/secring.gpg" ;
source_public_keyring = RsInitConfig::basedir + "/../.gnupg/pubring.gpg" ;
source_secret_keyring = RsInitConfig::basedir + "/../.gnupg/secring.gpg" ;
#endif
if(!RsDirUtil::copyFile(source_public_keyring,pgp_dir + "/retroshare_public_keyring.gpg"))