Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1089
OpenSSL internally redefines the size of HMAC_CTX at
crypto/hmac/hmac_lcl.h(OpenSSL commit
e0810e35).
Ref: https://github.com/openssl/openssl/pull/4338
We should not use it directly and should remove relevant
functions(Hmac*GetContextSize).
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1792
But for compatiblility, temporarily change these definition
of HMAC_*_CTX_SIZE.
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Signed-off-by: Xiaoyu Lu <xiaoyux.lu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Gary Lin <glin@suse.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
#include "InternalCryptLib.h"\r
#include <openssl/hmac.h>\r
\r
-#define HMAC_MD5_CTX_SIZE sizeof(void *) * 4 + sizeof(unsigned int) + \\r
- sizeof(unsigned char) * HMAC_MAX_MD_CBLOCK\r
+//\r
+// NOTE: OpenSSL redefines the size of HMAC_CTX at crypto/hmac/hmac_lcl.h\r
+// #define HMAC_MAX_MD_CBLOCK_SIZE 144\r
+//\r
+#define HMAC_MD5_CTX_SIZE (sizeof(void *) * 4 + sizeof(unsigned int) + \\r
+ sizeof(unsigned char) * 144)\r
\r
/**\r
Retrieves the size, in bytes, of the context buffer required for HMAC-MD5 operations.\r
#include "InternalCryptLib.h"\r
#include <openssl/hmac.h>\r
\r
-#define HMAC_SHA1_CTX_SIZE sizeof(void *) * 4 + sizeof(unsigned int) + \\r
- sizeof(unsigned char) * HMAC_MAX_MD_CBLOCK\r
+//\r
+// NOTE: OpenSSL redefines the size of HMAC_CTX at crypto/hmac/hmac_lcl.h\r
+// #define HMAC_MAX_MD_CBLOCK_SIZE 144\r
+//\r
+//\r
+#define HMAC_SHA1_CTX_SIZE (sizeof(void *) * 4 + sizeof(unsigned int) + \\r
+ sizeof(unsigned char) * 144)\r
\r
/**\r
Retrieves the size, in bytes, of the context buffer required for HMAC-SHA1 operations.\r
#include "InternalCryptLib.h"\r
#include <openssl/hmac.h>\r
\r
-#define HMAC_SHA256_CTX_SIZE sizeof(void *) * 4 + sizeof(unsigned int) + \\r
- sizeof(unsigned char) * HMAC_MAX_MD_CBLOCK\r
+//\r
+// NOTE: OpenSSL redefines the size of HMAC_CTX at crypto/hmac/hmac_lcl.h\r
+// #define HMAC_MAX_MD_CBLOCK_SIZE 144\r
+//\r
+#define HMAC_SHA256_CTX_SIZE (sizeof(void *) * 4 + sizeof(unsigned int) + \\r
+ sizeof(unsigned char) * 144)\r
\r
/**\r
Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.\r