diff options
Diffstat (limited to 'plugins/Dbx_mmap_SA/src/security.cpp')
-rw-r--r-- | plugins/Dbx_mmap_SA/src/security.cpp | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/plugins/Dbx_mmap_SA/src/security.cpp b/plugins/Dbx_mmap_SA/src/security.cpp index 04d7c82b49..6d41787d24 100644 --- a/plugins/Dbx_mmap_SA/src/security.cpp +++ b/plugins/Dbx_mmap_SA/src/security.cpp @@ -69,37 +69,27 @@ void CDbxMmapSA::EncodeCopyMemory(void * dst, void * src, size_t size ) {
memcpy(dst, src, size);
- if (!m_bEncoding)
- return;
-
- CryptoEngine->EncryptMem((BYTE *)dst, (int)size, key);
+ if (m_bEncoding)
+ CryptoEngine->EncryptMem((BYTE *)dst, (int)size, key);
}
void CDbxMmapSA::DecodeCopyMemory(void * dst, void * src, size_t size )
{
memcpy(dst, src, size);
- if (!m_bEncoding)
- return;
-
- CryptoEngine->DecryptMem((BYTE *)dst, (int)size, key);
+ if (m_bEncoding)
+ CryptoEngine->DecryptMem((BYTE *)dst, (int)size, key);
}
void CDbxMmapSA::EncodeDBWrite(DWORD ofs, void *src, int size)
{
- if (m_bEncoding)
- {
- BYTE * buf;
-
- buf = (BYTE*)GlobalAlloc(GPTR, sizeof(BYTE)*size);
+ if (m_bEncoding) {
+ BYTE *buf = (BYTE*)GlobalAlloc(GPTR, sizeof(BYTE)*size);
EncodeCopyMemory(buf, src, size);
DBWrite(ofs, buf, (int)size);
GlobalFree(buf);
}
- else
- {
- DBWrite(ofs, src, (int)size);
- }
+ else DBWrite(ofs, src, (int)size);
}
void CDbxMmapSA::DecodeDBWrite(DWORD ofs, void *src, int size)
@@ -242,9 +232,8 @@ void CDbxMmapSA::EncryptDB() return;
}
- if (SelectEncoder()) {
+ if (SelectEncoder())
return;
- }
bEncProcess = 1;
@@ -366,4 +355,4 @@ void CDbxMmapSA::ChangePwd() zero_fill((BYTE *)newpass, sizeof newpass);
LeaveCriticalSection(&m_csDbAccess);
-}
\ No newline at end of file +}
|