From b257ada1fdd663a3db74f50f3d19921054ea1341 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 2 Aug 2012 19:42:53 +0000 Subject: [PATCH] removed small bugs in test program git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5375 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/tests/pgp/test_pgp_handler.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/tests/pgp/test_pgp_handler.cc b/libretroshare/src/tests/pgp/test_pgp_handler.cc index cecfa0461..b4e1b001e 100644 --- a/libretroshare/src/tests/pgp/test_pgp_handler.cc +++ b/libretroshare/src/tests/pgp/test_pgp_handler.cc @@ -7,7 +7,12 @@ static std::string passphrase_callback(void *data,const char *uid_info,const char *what,int prev_was_bad) { - return std::string(getpass(what)) ; + if(prev_was_bad) + std::cerr << "Bad passphrase." << std::endl; + + std::string wt = std::string("Please enter passphrase for key id ") + uid_info + " :"; + + return std::string(getpass(wt.c_str())) ; } static std::string stringFromBytes(unsigned char *bytes,size_t len) @@ -260,7 +265,7 @@ int main(int argc,char *argv[]) std::cerr << "Encryption success" << std::endl; std::string decrypted_text = "" ; - outfile = "crypted_toto2.pgp" ; + outfile = "crypted_toto.pgp" ; if(!pgph.decryptTextFromFile(key_id,decrypted_text,outfile)) std::cerr << "Decryption failed" << std::endl;