Include chain_index in session pickle
Write a different version of the session pickle for the logging_enabled branch which includes the chain_index.
This commit is contained in:
parent
a8d0ac436e
commit
97c110f24b
2 changed files with 4 additions and 3 deletions
|
@ -381,6 +381,7 @@ std::size_t olm::pickle_length(
|
||||||
length += olm::pickle_length(value.sender_chain);
|
length += olm::pickle_length(value.sender_chain);
|
||||||
length += olm::pickle_length(value.receiver_chains);
|
length += olm::pickle_length(value.receiver_chains);
|
||||||
length += olm::pickle_length(value.skipped_message_keys);
|
length += olm::pickle_length(value.skipped_message_keys);
|
||||||
|
length += olm::pickle_length(value.chain_index);
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -392,6 +393,7 @@ std::uint8_t * olm::pickle(
|
||||||
pos = pickle(pos, value.sender_chain);
|
pos = pickle(pos, value.sender_chain);
|
||||||
pos = pickle(pos, value.receiver_chains);
|
pos = pickle(pos, value.receiver_chains);
|
||||||
pos = pickle(pos, value.skipped_message_keys);
|
pos = pickle(pos, value.skipped_message_keys);
|
||||||
|
pos = pickle(pos, value.chain_index);
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -408,8 +410,7 @@ std::uint8_t const * olm::unpickle(
|
||||||
|
|
||||||
// pickle v 0x80000001 includes a chain index; pickle v1 does not.
|
// pickle v 0x80000001 includes a chain index; pickle v1 does not.
|
||||||
if (includes_chain_index) {
|
if (includes_chain_index) {
|
||||||
std::uint32_t dummy;
|
pos = unpickle(pos, end, value.chain_index);
|
||||||
pos = unpickle(pos, end, dummy);
|
|
||||||
}
|
}
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -454,7 +454,7 @@ std::size_t olm::Session::decrypt(
|
||||||
namespace {
|
namespace {
|
||||||
// the master branch writes pickle version 1; the logging_enabled branch writes
|
// the master branch writes pickle version 1; the logging_enabled branch writes
|
||||||
// 0x80000001.
|
// 0x80000001.
|
||||||
static const std::uint32_t SESSION_PICKLE_VERSION = 1;
|
static const std::uint32_t SESSION_PICKLE_VERSION = 0x80000001;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t olm::pickle_length(
|
std::size_t olm::pickle_length(
|
||||||
|
|
Loading…
Reference in a new issue