使用 OpenSSL 的 PSK 提示

发布于 2024-12-23 14:11:47 字数 85 浏览 7 评论 0 原文

OpenSSL 中 PSK Hint 的具体作用是什么? 我认为这是客户端的一种服务器标识,但我没有找到任何具体的信息。

What is exactly the role of the PSK Hint in OpenSSL ?
I think it's a sort of server identification for clients but I didn't found anything concrete about it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

幽梦紫曦~ 2024-12-30 14:11:47

PSK 身份提示未明确定义(请参阅 RFC 4279)。在预共享密钥 (PSK) 方案中,客户端和服务器都必须能够导出同一组加密密钥。身份提示是服务器提供的信息,用于告诉客户端如何导出密钥。

由于每个服务器都可以有自己独特的生成密钥的方式,因此客户端必须了解有关服务器的信息才能知道如何处理 PSK 身份提示。每个实现都以不同的方式使用提示。

例如 NETCONF 在生成时直接使用提示PSK(其中 + 表示连接):

PSK = SHA-1(SHA-1(psk_identity + "Key Pad for Netconf" + password) +  
            psk_identity_hint) 

而 Symbian 安全用户平面位置 (SUPL)协议使用它来呈现协议版本并提供客户端可以使用的 PSK 生成器列表。

PSK-TLS 中使用的密钥标识符必须采用 RAND@SLP 的形式,其中
SLP 采用 FQDN 格式,RAND 是 128 位数字。下列
关键标识符是为 SUPL 1.0 定义的:

...

PSK_H-SLP_Master_Key 和 PSK_SPC_Key 必须为 128 位或 256 位
长的。 PSK-TLS 协议中使用的关键提示必须设置为“3GPP2
SUPL 1.0 密钥

类似的 TLS-PSK EMV 智能卡使用身份提示来确定如何计算 PSK。

当psk-identity-hint参数没有下发时
服务器,选择默认模式。此默认模式适用于
静态相移键控。否则 psk-identity-hint 确定特定的
xCDOL1 值和 PSK 计算的配置文件。

正如您所看到的,如果您从服务器获得 PSK 提示,您就必须知道它提供了哪些信息以及如何处理它,否则您将无法生成服务器生成的同一组密钥。

脚注:诺基亚负责 PSK-TLS 草案 RFC 4279 以及 将补丁提交给 OpenSSL 来实现规范。

The PSK identity hint is not well defined (see RFC 4279). In a pre-shared key (PSK) scheme, both the client and the server have to be able to derive the same set of crypto keys. The identity hint is something the server provides to tell the client how to derive the key.

Since each server can have its own unique way of generating the key, the client has to know something about the server to know what to do with the PSK identity hint. And each implementation uses the hint differently.

For example, NETCONF uses the hint directly when generating the PSK (where + means concatenate):

PSK = SHA-1(SHA-1(psk_identity + "Key Pad for Netconf" + password) +  
            psk_identity_hint) 

Whereas the Symbian Secure User Plane Location (SUPL) protocol uses it to present the protocol version and provide a list of PSK generators that the client can use.

Key Identifiers used in PSK-TLS MUST be in the form of RAND@SLP where
SLP is in the FQDN format and RAND is a 128bits number. The following
Key Identifiers are defined for SUPL 1.0:

...

PSK_H-SLP_Master_Key and PSK_SPC_Key MUST be either 128bits or 256bits
long. Key Hints used in the PSK-TLS protocol MUST be set to “3GPP2
SUPL 1.0 Keys

Similarly TLS-PSK for EMV smart cards uses the identity hint to determine how to calculate the PSK.

When the parameter psk-identity-hint is not delivered by the
server, a default mode is selected. This default mode works with a
static PSK. Otherwise the psk-identity-hint determines a particular
profile for xCDOL1 values and PSK calculation.

So as you can see, if you get a PSK hint from a server, you already have to know what information it provides and what to do with it or you won't be able to generate the same set of keys that the server generates.

Footnote: Nokia was responsible for the PSK-TLS draft RFC 4279 and also submitted the patch to OpenSSL implementing the spec.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文