From b60b1199856604dfc0018aa614b4c0aeea816ea5 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Sun, 26 Apr 2015 22:20:04 +0200 Subject: [PATCH] Fix iostream use --- implementations/encrypted/EncryptedBlock.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/implementations/encrypted/EncryptedBlock.h b/implementations/encrypted/EncryptedBlock.h index f118875c..3770786e 100644 --- a/implementations/encrypted/EncryptedBlock.h +++ b/implementations/encrypted/EncryptedBlock.h @@ -8,6 +8,7 @@ #include "messmer/cpp-utils/macros.h" #include +#include #include #include "ciphers/Cipher.h" @@ -73,13 +74,13 @@ std::unique_ptr> EncryptedBlock::TryDecrypt(std:: if(!plaintextWithHeader) { //Decryption failed (e.g. an authenticated cipher detected modifications to the ciphertext) //TODO Think about logging - std::cerr << "Decrypting block " << baseBlock->key() << " failed. Was the block modified by an attacker?" << std::endl; + std::cerr << "Decrypting block " << baseBlock->key().ToString() << " failed. Was the block modified by an attacker?" << std::endl; return nullptr; } if(!_keyHeaderIsCorrect(baseBlock->key(), *plaintextWithHeader)) { //The stored key in the block data is incorrect - an attacker might have exchanged the contents with the encrypted data from a different block //TODO Think about logging - std::cerr << "Decrypting block " << baseBlock->key() << " failed due to invalid block key. Was the block modified by an attacker?" << std::endl; + std::cerr << "Decrypting block " << baseBlock->key().ToString() << " failed due to invalid block key. Was the block modified by an attacker?" << std::endl; return nullptr; } return std::make_unique>(std::move(baseBlock), encKey, std::move(*plaintextWithHeader));