node.js - 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.
解决方案
这与 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 上,所以升级以使这些警告消失。
推荐阅读
- javascript - 如何在 element-ui vuejs 中使用 :error 获得成功 validateState
- amazon-web-services - AWS Cognito 用户注册前验证。检查用户是否存在于其他数据库中
- php - Paypal Payflow 透明重定向错误代码:PL001
- mongodb - 如何在开玩笑测试中正确关闭猫鼬连接
- testing - 集成测试,通配符忽略标签
- mongodb - 如何以公里为单位计算 LineString 距离?
- laravel-5 - 将 v-html 属性与 vue-i18n 标签中的标记结合起来
- c# - 从 .NET 控制器到 Java REST 服务的 HTTP POST 文件
- python - 如何在不使用 numpy 数组的情况下从 python 字典中访问“行”的元素
- multithreading - 如何在 Java 中进行异步线程执行?