gpt4 book ai didi

c - netbsd 版本的 openssh 支持 "diffie-hellman-group-exchange-sha256"但不支持 mac 的 SHA256

转载 作者:太空宇宙 更新时间:2023-11-03 23:19:15 25 4
gpt4 key购买 nike

我使用的是旧版本的 netbsd。我想将 openssh 配置为使用强密码和 mac,但是当看到可用的 mac 时,它不支持 SHA256 和更高版本。支持的 mac 是

macs[] = {
{ "hmac-sha1", SSH_EVP, EVP_sha1, 0, -1, -1 },
{ "hmac-sha1-96", SSH_EVP, EVP_sha1, 96, -1, -1 },
{ "hmac-md5", SSH_EVP, EVP_md5, 0, -1, -1 },
{ "hmac-md5-96", SSH_EVP, EVP_md5, 96, -1, -1 },
{ "hmac-ripemd160", SSH_EVP, EVP_ripemd160, 0, -1, -1 },
{ "hmac-ripemd160@openssh.com", SSH_EVP, EVP_ripemd160, 0, -1, -1 },
#ifdef UMAC_HAS_BEEN_UNBROKEN
{ "umac-64@openssh.com", SSH_UMAC, NULL, 0, 128, 64 },
#endif
{ NULL, 0, NULL, 0, -1, -1 }
};

但是当我检查支持的 key 交换密码时,我发现可以使用 SHA256

#define KEX_DH1         "diffie-hellman-group1-sha1"
#define KEX_DH14 "diffie-hellman-group14-sha1"
#define KEX_DHGEX_SHA1 "diffie-hellman-group-exchange-sha1"
#define KEX_DHGEX_SHA256 "diffie-hellman-group-exchange-sha256"

怎么样。如果我的 netbsd openssh 中有 SHA256 的实现,为什么它不能作为 mac 密码使用?

最佳答案

OpenSSH 5.0 支持 SHA-256 key 交换算法,但不支持具有 SHA-256 哈希的 MAC。作为引用,有一个源代码:

https://github.com/openssh/openssh-portable/blob/V_5_0_P1/myproposal.h

MACKey exchange 中的 SHA256 用法完全不同,两者互不影响。是否在其中任何一个中使用 SHA256 取决于此哈希在底层 OpenSSL 中的可用性,而且还取决于 OpenSSH 是否实现了此类算法。 10年前(2007年),它只是作为一种 key 交换算法实现的(MAC后来被标准化)。

原文RFC4253没有列出任何 SHA256 算法。 DH key 交换方法在 RFC4419 中标准化(2006),但使用 SHA2 的 HMACS 直到 2012 年才在 RFC6668 中标准化。 .

你的版本介于两者之间,没有这方面的标准,所以没有实现。

关于c - netbsd 版本的 openssh 支持 "diffie-hellman-group-exchange-sha256"但不支持 mac 的 SHA256,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45756085/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com