安全和获得证书:设计协议

Security and getting a certificate: designing a protocol

在 SSL 查询开始时,客户端发送 CLIENT_HELLO 消息。 服务器回复一条证书消息,提供返回到已知可信代理的验证链。

假设为了效率我想在本地存储新协议的证书。 TLS 中的当前设计始终要求获取证书。需要我知道的证书会发生什么情况?

我正在尝试了解可能的攻击场景。考虑进行在线银行业务,并假设证书已被泄露。在这种情况下,银行没有犯罪,但他们被黑了,必须颁发新证书。这合理吗?

如果你认为银行本身是腐败的,那么在我看来,担心证书是没有意义的,因为他们有你的钱并且可以偷走它。如果与您打交道的实体犯罪,证书重要吗?

什么情况下可以吊销证书?我试图理解为什么 SSL 每次都发送证书——这看起来真的很浪费,但可能有一个很好的理由。

是否可以将所有证书都存储在客户端上,但使用受信任的服务器检查时间戳?看起来至少可以通过网络发送更少的数据

在大多数情况下,`ServerHello 之后的

TLS Certificate 消息是强制性的,因此缓存不会有任何有用的效果。参见 RFC5246

7.4.2. Server Certificate

When this message will be sent:

The server MUST send a Certificate message whenever the agreed- upon key exchange method uses certificates for authentication (this includes all key exchange methods defined in this document except DH_anon). This message will always immediately follow the ServerHello message.

TLS 有自己的方法来提高性能。当客户端在 ClientHello 中发送有效的 session_id 时,会话可以恢复,双方必须直接继续完成消息

同时 RFC5077 指定如何在没有服务器端状态的情况下恢复会话

已编辑 - 添加了对特定问题的评论

Suppose for efficiency I wanted to store certificates locally for a new protocol. The current design in TLS is always to require getting the certificate. What could happen to a certificate that would require me to know?

“总是”是不正确的。 TLS 在握手期间发送证书。协商共享密钥后,客户端稍后可以使用 sessionid(通常的行为)恢复会话。然后,服务器不发送认证链。

服务器发送认证链。客户端必须验证提供的证书是否可靠:

  • 检查数字签名 使用服务器证书的私钥执行

  • 证书由受信任的 CA 颁发。假设客户端有一个信任库,其中包含它信任的证书颁发机构的根证书。客户端构建服务器提供的证书链,直到在本地信任库中找到根证书

如果客户端在本地信任库中有服务器证书的副本,则可以完全跳过第二步中从服务器发送证书的步骤

I am trying to understand possible attack scenarios. Consider doing online banking, and suppose a certificate has been compromised. In such as case, the bank is not criminal, but they have been hacked and have to issue a new certificate. Is this reasonable?

在这种情况下,攻击者可以进行 MITM 攻击。证书必须由 CA 吊销,客户端应检查吊销。这超出了 TLS

的范围

If you consider that the bank itself is corrupt, then it seems to me there is no point in worrying about the certificate since they have your money and can just steal it. If the entity you are dealing with goes criminal, does the certificate matter?

在这种情况下,证书似乎是最少的问题...

Under what circumstances can certfiicates be revoked?

每个CA建立自己的程序。没有标准,但有“良好做法”:当证书数据更改(例如电子邮件)或变得无效(公司代表),更新后撤销旧的,当密钥被泄露或证书丢失时

Would it be possible instead to keep all certificates stored on the client, but check a timestamp with a trusted server?

是的,正如上面评论的那样:验证数字签名,验证撤销并建立刷新机制

但是如果你正在寻找与 TLS 相比的性能,会话恢复可能会有更好的结果