首页 > 解决方案 > Node Cipheriv Warning in Azure DevOps Extension - Release Task

问题描述

I am working on a project to develop an Azure DevOps release task extension. Recently, I am getting this warning message printed multiple times in the logs when the release task runs- "Warning: Use Cipheriv for counter mode of aes-256-ctr".

I was not getting it earlier. And the time when I started getting this error, I only changed some console.log(..), and not even any code that could possibly trigger this error. (Might be some npm dependency updates!)

Any idea regarding why am I getting this error, and how to fix it! If not, how to disable it?

P.S. - I know this question has been asked and could probably be categorized as duplicate. But I am asking in the context of Azure DevOps release tasks, others are independent node.js projects. And, those fixes didn't work for me.

标签: node.jsazure-devopsazure-pipelinesazure-pipelines-release-pipelineazure-pipelines-build-task

解决方案


这与 Azure-Pipelines-Task-Lib 和 Azure-Pipelines-agent 有关,不受您的控制。问题应该在这些项目或其依赖项中得到解决。

由于这些都随代理安装程序和任务本身一起提供,因此这不是您直接控制的。

这可能是由于代理对节点 6 的依赖性造成的。代理上支持节点 10 LTS 的工作正在进行中(节点 10 现在在代理安装程序中并排发布)。

Azure-Pipelines-Agent在这里调用了错误的方法

    let encryptKey = crypto.randomBytes(256);
    let cipher = crypto.createCipher("aes-256-ctr", encryptKey);
    let encryptedContent = cipher.update(secret, "utf8", "hex");
    encryptedContent += cipher.final("hex");

据我所知,它应该调用crypto.createCipheriv()而不是crypto.createCipher()在节点 8 或更高版本上运行时调用。Azure-Pipelines-Task-Lib 似乎依赖于同一段代码。

看起来 Azure-Pipelines-Task-Lib 的 2.8.0 修复了这个. 它现在在 npm 上,所以升级以使这些警告消失。


推荐阅读