Clean up and modernize code:

This commit removes obsolete comments, dead or no longer useful
code, and workarounds for several issues that were present in older
compilers that we no longer support.

Specifically:

- It improves the transaction metadata handling class, simplifying
  its use and making it less error-prone.
- It reduces the footprint of the Serializer class by consolidating
  code and leveraging templates.
- It cleanups the ST* class hierarchy, removing dead code, improving
  and consolidating code to reduce complexity and code duplication.
- It shores up the handling of currency codes and the conversation
  between 160-bit currency codes and their string representation.
- It migrates beast::secure_erase to the ripple namespace and uses
  a call to OpenSSL_cleanse instead of the custom implementation.
This commit is contained in:
Nik Bougalis
2020-03-27 14:26:46 -07:00
parent 6c72d5cf7e
commit dbee3f01b7
45 changed files with 244 additions and 703 deletions

View File

@@ -208,7 +208,7 @@ private:
inline void erase(std::true_type)
{
beast::secure_erase(&h_, sizeof(h_));
secure_erase(&h_, sizeof(h_));
}
};
@@ -221,16 +221,6 @@ using sha512_half_hasher_s = detail::basic_sha512_half_hasher<true>;
//------------------------------------------------------------------------------
#ifdef _MSC_VER
// Call from main to fix magic statics pre-VS2015
inline void
sha512_deprecatedMSVCWorkaround()
{
beast::sha512_hasher h;
auto const digest = static_cast<beast::sha512_hasher::result_type>(h);
}
#endif
/** Returns the SHA512-Half of a series of objects. */
template <class... Args>
sha512_half_hasher::result_type