openbmc中关于invalid authentication algorithm问题

本文指导如何修复ipmitool连接OpenBMC设备时的invalidauthenticationalgorithm错误,涉及版本更新和代码调整,包括使用phosphor-ipmi-net和Wireshark进行问题定位。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ipmitool工具

当在使用ipmitool进行链接openbmc设备时,某些版本的ipmitool会进行报错,内容为:Error in open session response message : invalid authentication algorithm。此问题为ipmitool版本过低,下载一个高版本ipmitool就可以解决。详情可以参考以下链接中的内容:

https://bugs.centos.org/view.php?id=17653

非ipmitool工具

当我们其他版本的工具来链接openbmc设备时,invalid authentication algorithm问题可能依旧会发生,或者说大概率会发生:)。此时我们需要分析源代码和ipmi协议来进行更改解决这个问题。为此,我们需要以下代码和工具:

1-phosphor-ipmi-net
2-wireshark
3-ipmi-second-gen-interface-spec-v2-rev1-1手册

我们先开宗明义的说明该问题出现的具体原因以及解决方法,再进行详细介绍该问题定位的方法。

问题的原因

(csdn传入图片一直失败,奇怪!)
在ipmi协议手册第318页,介绍了authentication algorithm、integrity algorithm、confidentiality algorithm三种类型共20中情况的算法组合。openbmc和类ipmitool工具必须要包含同一种算法组合,双方才可以验证成功。openbmc端只支持编号为17的算法组合(RAKP_HMAC_SHA256 + HMAC_SHA256_128 + AES_CBC_128)。类ipmitool工具支持什么类型的算法组合,需要参考问题定位

问题解决方法

在phosphor-ipmi-net工程下,open_session.cpp文件中,openSession函数里,进行修改如何内容:
修改authentication algorithm算法认证:

if (!cipher::rakp_auth::Interface::isAlgorithmSupported(
        static_cast<cipher::rakp_auth::Algorithms>(request->authAlgo)))
{
    response->status_code =
        static_cast<uint8_t>(RAKP_ReturnCode::INVALID_AUTH_ALGO);
    return outPayload;
}

在函数isAlgorithmSupported中,添加所需的算法内容即可:

static bool isAlgorithmSupported(Algorithms algo)
{
    if (algo == Algorithms::RAKP_HMAC_SHA256)
    {
        return true;
    }
    else
    {
        return false;
    }
}

修改integrity algorithm算法认证:

if (!cipher::integrity::Interface::isAlgorithmSupported(
        static_cast<cipher::integrity::Algorithms>(request->intAlgo)))
{
    response->status_code =
        static_cast<uint8_t>(RAKP_ReturnCode::INVALID_INTEGRITY_ALGO);
    return outPayload;
}

修改confidentiality algorithm算法认证:

if (!cipher::crypt::Interface::isAlgorithmSupported(
        static_cast<cipher::crypt::Algorithms>(request->confAlgo)))
{
    response->status_code =
        static_cast<uint8_t>(RAKP_ReturnCode::INVALID_CONF_ALGO);
    return outPayload;
}

问题如何定位

这个时候就需要用到wireshark,我们需要进行抓取通信的报文(图片无法上传。。。)
发送至openbmc设备的报文:
00 00 00 00 49 4d 50 49
00 00 00 08 01 00 00 00
01 00 00 08 01 00 00 00
02 00 00 08 01 00 00 00(此为数据区域的32字节)
我们可以在ipmi 手册13.17小节中找到该字段的介绍,第十三个字节的0::5为authentication algorithm,第二十一字节的0::5字节为integrity algorithm,第二十九字节的0::5为confidentiality algorithm。

openbmc设备发送出去的报文:
00 04 00 00 49 4d 50 49
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00
我们可以在ipmi手册13.18小节中找到该字段的介绍,第二字节为错误码介绍,可以看到标号为04,错误类型为invalid authentication algorithm.

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值