summaryrefslogtreecommitdiff
path: root/src/plugins/lanplus/lanplus_crypt_impl.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-10-09 09:19:55 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-10-09 09:19:55 +0200
commit7ddeb3781f3d79ef1ae5a765a66f6cdd1ec113ef (patch)
tree3546836f27de4168559a62d8022626dfb101a133 /src/plugins/lanplus/lanplus_crypt_impl.c
parent5bac665e38a15e6725f9ec17c7f7e80a0506aa08 (diff)
parent82ac6c87ce0b0af2fb8de25d70442fec406bb742 (diff)
Merge tag 'upstream/1.8.18'
Upstream version 1.8.18
Diffstat (limited to 'src/plugins/lanplus/lanplus_crypt_impl.c')
-rw-r--r--src/plugins/lanplus/lanplus_crypt_impl.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/plugins/lanplus/lanplus_crypt_impl.c b/src/plugins/lanplus/lanplus_crypt_impl.c
index cde6c54..d5fac37 100644
--- a/src/plugins/lanplus/lanplus_crypt_impl.c
+++ b/src/plugins/lanplus/lanplus_crypt_impl.c
@@ -99,7 +99,8 @@ lanplus_rand(uint8_t * buffer, uint32_t num_bytes)
/*
* lanplus_HMAC
*
- * param mac specifies the algorithm to be used, currently only SHA1 is supported
+ * param mac specifies the algorithm to be used, currently SHA1, SHA256 and MD5
+ * are supported
* param key is the key used for HMAC generation
* param key_len is the lenght of key
* param d is the data to be MAC'd
@@ -123,6 +124,14 @@ lanplus_HMAC(uint8_t mac,
if ((mac == IPMI_AUTH_RAKP_HMAC_SHA1) ||
(mac == IPMI_INTEGRITY_HMAC_SHA1_96))
evp_md = EVP_sha1();
+ else if ((mac == IPMI_AUTH_RAKP_HMAC_MD5) ||
+ (mac == IPMI_INTEGRITY_HMAC_MD5_128))
+ evp_md = EVP_md5();
+#ifdef HAVE_CRYPTO_SHA256
+ else if ((mac == IPMI_AUTH_RAKP_HMAC_SHA256) ||
+ (mac == IPMI_INTEGRITY_HMAC_SHA256_128))
+ evp_md = EVP_sha256();
+#endif /* HAVE_CRYPTO_SHA256 */
else
{
lprintf(LOG_DEBUG, "Invalid mac type 0x%x in lanplus_HMAC\n", mac);