mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-23 22:49:37 -05:00
fixed startup password handling, so that it wont ask for passwd again, hence preventing deadlocks when the gui is running
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2057 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
84447a6304
commit
02234325cc
@ -68,16 +68,21 @@ gpgcert::~gpgcert()
|
||||
|
||||
gpg_error_t pgp_pwd_callback(void *hook, const char *uid_hint, const char *passphrase_info, int prev_was_bad, int fd)
|
||||
{
|
||||
std::string text = rsicontrol->getNotify().askForPassword("GPG key passphrase","GPG key passphrase") ;
|
||||
static std::string sp = "" ;
|
||||
|
||||
// QString text = QInputDialog::getText(NULL, "GPG key passphrase",
|
||||
// "GPG key passphrase", QLineEdit::Password,
|
||||
// NULL, NULL);
|
||||
std::string text ;
|
||||
|
||||
if(sp == "" || prev_was_bad)
|
||||
{
|
||||
if(prev_was_bad)
|
||||
text = rsicontrol->getNotify().askForPassword("GPG key passphrase",std::string("Wrong password !\n\nPlease enter the password to unlock the following GPG key:\n\n ")+uid_hint+"\n") ;
|
||||
else
|
||||
text = rsicontrol->getNotify().askForPassword("GPG key passphrase",std::string("Please enter the password to unlock the following GPG key:\n\n")+uid_hint+"\n") ;
|
||||
sp = text ;
|
||||
}
|
||||
else
|
||||
text = sp ;
|
||||
|
||||
if (prev_was_bad)
|
||||
fprintf(stderr, "pgp_pwd_callback() Prev was bad!\n");
|
||||
//fprintf(stderr, "pgp_pwd_callback() Set Password to:\"%s\"\n", passwd);
|
||||
fprintf(stderr, "pgp_pwd_callback() Set Password\n");
|
||||
|
||||
#ifndef WINDOWS_SYS
|
||||
|
Loading…
Reference in New Issue
Block a user