cleanup Secure types
Removed `std::allocator::rebind` since it has been
(deprecated in C++17)(removed in C++20). Also cleaned up the
OPENSSL_cleanse for SecureString and SecureBuffer to just point to the
beginning of the data with `this->data()`.
Change-Id: I3bd5b65171a4c5b49f8747d13984e1ce96c00190
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/include/ipmid/types.hpp b/include/ipmid/types.hpp
index 8d65b0f..a36d612 100644
--- a/include/ipmid/types.hpp
+++ b/include/ipmid/types.hpp
@@ -269,12 +269,6 @@
class SecureAllocator : public std::allocator<T>
{
public:
- template <typename U>
- struct rebind
- {
- typedef SecureAllocator<U> other;
- };
-
void deallocate(T* p, size_t n)
{
OPENSSL_cleanse(p, n);
@@ -297,7 +291,7 @@
~SecureString()
{
- OPENSSL_cleanse(&((*this)[0]), this->size());
+ OPENSSL_cleanse(this->data(), this->size());
}
};
@@ -316,7 +310,7 @@
~SecureBuffer()
{
- OPENSSL_cleanse(&((*this)[0]), this->size());
+ OPENSSL_cleanse(this->data(), this->size());
}
};
} // namespace ipmi