aboutsummaryrefslogtreecommitdiff
path: root/src/serialization/container.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-06-24 23:26:58 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-08-17 16:23:58 +0000
commit7175dcb1078abbdaa130a8c5f5fd2b93fa7b3086 (patch)
tree640b83c4101dc992151630a76a13597913d2dd08 /src/serialization/container.h
parentMerge pull request #6736 (diff)
downloadmonero-7175dcb1078abbdaa130a8c5f5fd2b93fa7b3086.tar.xz
replace most boost serialization with existing monero serialization
This reduces the attack surface for data that can come from malicious sources (exported output and key images, multisig transactions...) since the monero serialization is already exposed to the outside, and the boost lib we were using had a few known crashers. For interoperability, a new load-deprecated-formats wallet setting is added (off by default). This allows loading boost format data if there is no alternative. It will likely go at some point, along with the ability to load those. Notably, the peer lists file still uses the boost serialization code, as the data it stores is define in epee, while the new serialization code is in monero, and migrating it was fairly hairy. Since this file is local and not obtained from anyone else, the marginal risk is minimal, but it could be migrated later if needed. Some tests and tools also do, this will stay as is for now.
Diffstat (limited to 'src/serialization/container.h')
-rw-r--r--src/serialization/container.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/serialization/container.h b/src/serialization/container.h
index 4bf47ecfa..d5e75bb4f 100644
--- a/src/serialization/container.h
+++ b/src/serialization/container.h
@@ -28,10 +28,6 @@
//
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
-#pragma once
-
-#include "serialization.h"
-
namespace serialization
{
namespace detail
@@ -103,7 +99,7 @@ bool do_serialize_container(Archive<true> &ar, C &v)
return false;
if (i != v.begin())
ar.delimit_array();
- if(!::serialization::detail::serialize_container_element(ar, const_cast<typename C::value_type&>(*i)))
+ if(!::serialization::detail::serialize_container_element(ar, (typename C::value_type&)*i))
return false;
if (!ar.stream().good())
return false;