|
@@ -7883,6 +7883,10 @@ UnicodeString __fastcall TTerminal::EncryptFileName(const UnicodeString & Path,
|
|
|
TEncryption Encryption(FEncryptKey);
|
|
|
FileName = Encryption.EncryptFileName(FileName);
|
|
|
FEncryptedFileNames.insert(std::make_pair(Path, FileName));
|
|
|
+ if (Configuration->ActualLogProtocol >= 2)
|
|
|
+ {
|
|
|
+ LogEvent(FORMAT(L"Name of file '%s' encrypted as '%s'", (Path, FileName)));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -7911,8 +7915,15 @@ UnicodeString __fastcall TTerminal::DecryptFileName(const UnicodeString & Path)
|
|
|
Result = UnixCombinePaths(FileDir, FileName);
|
|
|
}
|
|
|
|
|
|
- if (Encrypted || (FEncryptedFileNames.find(Result) == FEncryptedFileNames.end()))
|
|
|
+ TEncryptedFileNames::iterator Iter = FEncryptedFileNames.find(Result);
|
|
|
+ bool NotCached = (Iter == FEncryptedFileNames.end());
|
|
|
+ if (Encrypted || NotCached)
|
|
|
{
|
|
|
+ if ((Configuration->ActualLogProtocol >= 2) && Encrypted &&
|
|
|
+ (NotCached || (Iter->second != FileNameEncrypted)))
|
|
|
+ {
|
|
|
+ LogEvent(FORMAT(L"Name of file '%s' decrypted from '%s'", (Result, FileNameEncrypted)));
|
|
|
+ }
|
|
|
// This may overwrite another variant of encryption
|
|
|
FEncryptedFileNames[Result] = FileNameEncrypted;
|
|
|
}
|