File libqca2-allow_md5_in_fips_mode.patch of Package libqca2.9324
Index: qca-2.0.3/plugins/qca-ossl-2.0.0-beta3/qca-ossl.cpp
===================================================================
--- qca-2.0.3.orig/plugins/qca-ossl-2.0.0-beta3/qca-ossl.cpp
+++ qca-2.0.3/plugins/qca-ossl-2.0.0-beta3/qca-ossl.cpp
@@ -986,7 +986,11 @@ public:
opensslHashContext(const EVP_MD *algorithm, Provider *p, const QString &type) : HashContext(p, type)
{
m_algorithm = algorithm;
- EVP_DigestInit( &m_context, m_algorithm );
+ EVP_MD_CTX_init(&m_context);
+#ifdef EVP_MD_CTX_FLAG_NON_FIPS_ALLOW
+ EVP_MD_CTX_set_flags(&m_context, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
+#endif
+ EVP_DigestInit_ex( &m_context, m_algorithm, 0 );
}
~opensslHashContext()
@@ -997,7 +1001,11 @@ public:
void clear()
{
EVP_MD_CTX_cleanup(&m_context);
- EVP_DigestInit( &m_context, m_algorithm );
+ EVP_MD_CTX_init(&m_context);
+#ifdef EVP_MD_CTX_FLAG_NON_FIPS_ALLOW
+ EVP_MD_CTX_set_flags(&m_context, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
+#endif
+ EVP_DigestInit_ex( &m_context, m_algorithm, 0 );
}
void update(const MemoryRegion &a)