Skip to content

Commit

Permalink
- fix CCryptoManager::DecryptSessionData() overwriting first data blo…
Browse files Browse the repository at this point in the history
…ck, if to be decrypted data is larger than a single block (#255)
  • Loading branch information
Luke1410 committed Sep 3, 2019
1 parent b5cdf28 commit e67c8fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/src/crypto/cryptomanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ namespace SLNet
}
RakAssert(static_cast<size_t>(bytesWritten1) <= inOutBufferSize);
int bytesWritten2;
if (EVP_DecryptFinal_ex(&m_decryptionContext, outBuffer, &bytesWritten2) == 0) {
if (EVP_DecryptFinal_ex(&m_decryptionContext, outBuffer + bytesWritten1, &bytesWritten2) == 0) {
return false; // failed final decryption step
}
RakAssert(static_cast<size_t>(bytesWritten1) + static_cast<size_t>(bytesWritten2) <= inOutBufferSize);
Expand Down

0 comments on commit e67c8fd

Please sign in to comment.