Fix: Different qm files in different paths, no overruling (Bug #2657158)

Fix: Unable to open kdb from read-only location (Bug #2657228)

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@279 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
sniperbeamer
2009-03-03 17:45:13 +00:00
parent df17d76ce7
commit 139078801c
9 changed files with 133 additions and 95 deletions

View File

@@ -92,13 +92,15 @@ void SecString::overwrite(QString& str){
void SecString::generateSessionKey(){
sessionkey = new quint8[32];
lockPage(sessionkey, 32);
if (!lockPage(sessionkey, 32))
qDebug("Failed to lock session key page");
randomize(sessionkey, 32);
RC4.setKey(sessionkey, 32);
}
void SecString::deleteSessionKey() {
overwrite(sessionkey, 32);
unlockPage(sessionkey, 32);
delete[] sessionkey;
}