Node Cipheriv Warning in Azure DevOps Extension - Release Task

♀尐吖头ヾ 提交于 2020-08-27 22:24:15

问题


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.


回答1:


This is related to the Azure-Pipelines-Task-Lib and the Azure-Pipelines-agent and outside of your control. The problem should be fixed in those projects or their dependencies.

Since these all ship with the agent installer and the tasks themselves, this is not directly under your control.

This is likely caused by the dependency of the Agent on Node 6. There is work in progress to support Node 10 LTS on the agent (Node 10 now ships side-by-side in the agent installer).

The Azure-Pipelines-Agent calls the wrong method here.

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

As far as I can tell it should call crypto.createCipheriv() instead of crypto.createCipher() when running on Node 8 or higher. The Azure-Pipelines-Task-Lib seems to rely on the same piece of code.

It looks like 2.8.0 of the Azure-Pipelines-Task-Lib fixes this. It's on npm now, so upgrade to make these warnings disappear.



来源:https://stackoverflow.com/questions/55091341/node-cipheriv-warning-in-azure-devops-extension-release-task

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!