安装ipmitool时报错,EVP_CIPHER_CTX ctx 未识别

lanplus_crypt_impl.c: In function 'lanplus_encrypt_aes_cbc_128':
lanplus_crypt_impl.c:167:17: error: storage size of 'ctx' isn't known
  167 |  EVP_CIPHER_CTX ctx;
      |                 ^~~
lanplus_crypt_impl.c:167:17: warning: unused variable 'ctx' [-Wunused-variable]
lanplus_crypt_impl.c: In function 'lanplus_decrypt_aes_cbc_128':
lanplus_crypt_impl.c:242:17: error: storage size of 'ctx' isn't known
  242 |  EVP_CIPHER_CTX ctx;
      |                 ^~~
lanplus_crypt_impl.c:242:17: warning: unused variable 'ctx' [-Wunused-variable]

出现该问题的原因是,openssl版本不同,其函数接口发生了变化,老接口"EVP_CIPHER_CTX ctx;"在新opensll版本上不能识别,需要改成新的语法格式。

只需要修改vim src/plugins/lanplus/lanplus_crypt_impl.c文件里的两个函数即可。

第1个函数,159行

void
lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
                                                        const uint8_t * key,
                                                        const uint8_t * input,
                                                        uint32_t          input_length,
                                                        uint8_t       * output,
                                                        uint32_t        * bytes_written)
{
        //EVP_CIPHER_CTX ctx;
        EVP_CIPHER_CTX *ctx;							//修改1
        ctx = EVP_CIPHER_CTX_new();						//修改2
        EVP_CIPHER_CTX_init(ctx);						//修改3
        EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);	//修改4
        EVP_CIPHER_CTX_set_padding(ctx, 0);				//修改5


        *bytes_written = 0;

        if (input_length == 0)
        {
                EVP_CIPHER_CTX_free(ctx);				//修改6
                return;
        }

        if (verbose >= 5)
        {
                printbuf(iv,  16, "encrypting with this IV");
                printbuf(key, 16, "encrypting with this key");
                printbuf(input, input_length, "encrypting this data");
        }
		/*
         * The default implementation adds a whole block of padding if the input
         * data is perfectly aligned.  We would like to keep that from happening.
         * We have made a point to have our input perfectly padded.
         */
        assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
        
        if(!EVP_EncryptUpdate(ctx, output, (int *)bytes_written, input, input_length))	//修改7
        {
                /* Error */
                *bytes_written = 0;
                EVP_CIPHER_CTX_free(ctx);				//修改8
                return;
        }
        else
        {
                uint32_t tmplen;

                if(!EVP_EncryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))	//修改9
                {
                        *bytes_written = 0;
                        EVP_CIPHER_CTX_free(ctx);		//修改10
                        return; /* Error */
                }
                else
                {
                        /* Success */
                        *bytes_written += tmplen;
                        EVP_CIPHER_CTX_cleanup(ctx);	//修改11
                }
        }
}

第2个函数,242行

void
lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
                                                        const uint8_t * key,
                                                        const uint8_t * input,
                                                        uint32_t          input_length,
                                                        uint8_t       * output,
                                                        uint32_t        * bytes_written)
{
        EVP_CIPHER_CTX *ctx;					//修改1
        ctx = EVP_CIPHER_CTX_new();		//修改2
        EVP_CIPHER_CTX_init(ctx);				//修改3
        EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);	//修改4
        EVP_CIPHER_CTX_set_padding(ctx, 0);	//修改5
		if (verbose >= 5)
        {
                printbuf(iv,  16, "decrypting with this IV");
                printbuf(key, 16, "decrypting with this key");
                printbuf(input, input_length, "decrypting this data");
        }

        *bytes_written = 0;

        if (input_length == 0)
        {
                EVP_CIPHER_CTX_free(ctx);	//修改6
                return;
        }

        /*
         * The default implementation adds a whole block of padding if the input
         * data is perfectly aligned.  We would like to keep that from happening.
         * We have made a point to have our input perfectly padded.
         */
        assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
        
        if (!EVP_DecryptUpdate(ctx, output, (int *)bytes_written, input, input_length))
        {
                /* Error */
                lprintf(LOG_DEBUG, "ERROR: decrypt update failed");
                *bytes_written = 0;
                EVP_CIPHER_CTX_free(ctx);	//修改7
                return;
        }
        else
        {
                uint32_t tmplen;

                if (!EVP_DecryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))
                {
                        char buffer[1000];
                        ERR_error_string(ERR_get_error(), buffer);
                        lprintf(LOG_DEBUG, "the ERR error %s", buffer);
                        lprintf(LOG_DEBUG, "ERROR: decrypt final failed");
                        *bytes_written = 0;
                        EVP_CIPHER_CTX_free(ctx);	//修改8
                        return; /* Error */
                }
                else
                {
                        /* Success */
                        *bytes_written += tmplen;
                        EVP_CIPHER_CTX_cleanup(ctx);	//修改9
                }
        }

        if (verbose >= 5)
        {
                lprintf(LOG_DEBUG, "Decrypted %d encrypted bytes", input_length);
                printbuf(output, *bytes_written, "Decrypted this data");
        }
}

<think>好的,我现在需要帮用户解决关于戴尔T40声卡音频固件升级工具的问题,适用于Win10系统。首先,我得确认用户的具体需求。他们提到了一些关键词,比如KT_SUN_BOOT_UI_、IPMITOOL、KT_USB_BOOT_UI_和Web界面,这些可能涉及到固件升级的工具或方法。 首先,我应该检查戴尔官方的支持渠道。用户提供的引用[1]和[2]都是关于固态硬盘安装和系统安装的,可能和固件升级关系不大,但引用中提到的进入BIOS的方法(比如按F2)可能对固件升级有帮助。戴尔通常会在其支持页面上提供驱动程序和固件更新,所以建议用户访问戴尔的支持网站,输入服务标签或型号查找相关驱动。 接下来,用户提到的工具如IPMITOOL,这通常用于服务器管理,可能与戴尔的iDRAC(集成远程访问控制器)有关。如果T40是服务器型号,可能需要通过iDRAC的Web界面进行固件升级。引用[3]中的链接可能包含一些技术博客的内容,但需要确认是否可靠。 另外,用户提到的KT_SUN_BOOT_UI和KT_USB_BOOT_UI可能是指特定的固件升级工具,但我不确定这些是否是戴尔官方的工具。可能需要建议用户谨慎使用第三方工具,优先使用戴尔官方提供的资源,以免造成系统不稳定或兼容性问题。 还有,声卡固件升级可能需要特定的驱动程序或工具包。建议用户检查设备管理器中的声卡设备,查看制造商和型号,然后在戴尔支持页面搜索对应的固件更新。如果找不到,可能需要联系戴尔技术支持获取帮助。 最后,提醒用户在升级固件前备份重要数据,确保电源稳定,避免升级过程中断导致设备损坏。总结步骤应该是:访问戴尔支持页面查找驱动和固件,使用官方工具如SupportAssist,或通过iDRAC进行远程管理,避免使用经验证的第三方工具。</think>根据你的需求,以下是关于Dell T40声卡/音频固件升级的解决方案: ### 操作步骤指引 1. **官方驱动支持** - 访问[戴尔支持网站](https://www.dell.com/support/home/zh-cn),输入设备服务标签或型号"T40"。 - 在"驱动程序和下载"分类中筛选"声卡"相关驱动,优先选择标注"固件更新"的包[^1][^2]。 2. **使用Dell专用工具** - 安装**Dell SupportAssist**(预装或官网下载),该工具可自动检测声卡固件状态并提供升级方案。 - 对于服务器组件,可通过**iDRAC Web界面**或**IPMITOOL**命令行工具进行固件管理[^3]。 3. **特殊固件升级方法** ```powershell # 以管理员身份运行PowerShell pnputil /add-driver "C:\Driver\Audio.inf" # 指定驱动路径 devcon update "C:\Driver\Audio.inf" "HDAUDIO\VEN_XXXX" # 设备实例路径 ``` 注意:需先通过设备管理器查看声卡的硬件ID(右键设备→属性→详细信息→硬件ID)。 ### 注意事项 - 固件升级前建议创建系统还原点 - 确保使用UPS电源防止断电 - 服务器组件升级推荐通过iDRAC远程操作
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Jimbo_Zhang

有钱的捧个钱场

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值