security: deduplicate RAII wrapper class for EVP_MD_CTX

Change-Id: I256588a8bc601b06548f7ec45aee020ddabb9597
diff --git a/src/security/detail/openssl-helper.hpp b/src/security/detail/openssl-helper.hpp
index 51a4a36..58690ca 100644
--- a/src/security/detail/openssl-helper.hpp
+++ b/src/security/detail/openssl-helper.hpp
@@ -35,6 +35,22 @@
 int
 getEvpPkeyType(EVP_PKEY* key);
 
+class EvpMdCtx : noncopyable
+{
+public:
+  EvpMdCtx();
+
+  ~EvpMdCtx();
+
+  operator EVP_MD_CTX*() const
+  {
+    return m_ctx;
+  }
+
+private:
+  EVP_MD_CTX* m_ctx;
+};
+
 class EvpPkeyCtx : noncopyable
 {
 public: