Skip to content

Commit

Permalink
Fix bag encryption routine (#1310)
Browse files Browse the repository at this point in the history
Bag encryption routine was truncating the recorded block by the size of the IV.
  • Loading branch information
guillaumeautran authored and mikepurvis committed Jan 18, 2018
1 parent a01abe9 commit 1557fe6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/rosbag_storage/src/aes_encryptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ uint32_t AesCbcEncryptor::encryptChunk(const uint32_t chunk_size, const uint64_t
AES_cbc_encrypt(&compressed_chunk[0], &encrypted_chunk[0], encrypted_chunk.length(), &aes_encrypt_key_, &iv[0], AES_ENCRYPT);
// Write encrypted chunk
file.write((char*) &encrypted_chunk[0], encrypted_chunk.length());
file.truncate(chunk_data_pos + encrypted_chunk.length());
file.truncate(chunk_data_pos + AES_BLOCK_SIZE + encrypted_chunk.length());
return AES_BLOCK_SIZE + encrypted_chunk.length();
}

Expand Down

0 comments on commit 1557fe6

Please sign in to comment.