Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't fail if the PSK identity doesn't match #6659

Closed
wants to merge 1 commit into from

Conversation

mattcaswell
Copy link
Member

In 1.1.0 s_server if the PSK identity doesn't match what we have then
a warning is printed and we continue the connection anyway. In 1.1.1,
if TLSv1.3 is used and the identity doesn't match then we abort the
connection. We should really be consistent with the old behaviour.

Checklist
  • documentation is added or updated
  • tests are added or updated

In 1.1.0 s_server if the PSK identity doesn't match what we have then
a warning is printed and we continue the connection anyway. In 1.1.1,
if TLSv1.3 is used and the identity doesn't match then we abort the
connection. We should really be consistent with the old behaviour.
@richsalz richsalz added the approval: done This pull request has the required number of approvals label Jul 6, 2018
@kaduk
Copy link
Contributor

kaduk commented Jul 6, 2018

There is some guidance in the TLS 1.3 spec on this topic; let me pull it up.

@kaduk
Copy link
Contributor

kaduk commented Jul 6, 2018

Ah, this is just in s_server anyway, not in the library core.

The text I was looking for is:

   Implementor's note: When session resumption is the primary use case
   of PSKs, the most straightforward way to implement the PSK/cipher
   suite matching requirements is to negotiate the cipher suite first
   and then exclude any incompatible PSKs.  Any unknown PSKs (e.g., they
   are not in the PSK database or are encrypted with an unknown key)
   SHOULD simply be ignored.  If no acceptable PSKs are found, the
   server SHOULD perform a non-PSK handshake if possible.  If backward
   compatibility is important, client-provided, externally established
   PSKs SHOULD influence cipher suite selection.

and also in the appendices:

   Because implementations respond to an invalid PSK binder by aborting
   the handshake, it may be possible for an attacker to verify whether a
   given PSK identity is valid.  Specifically, if a server accepts both
   external-PSK handshakes and certificate-based handshakes, a valid PSK
   identity will result in a failed handshake, whereas an invalid
   identity will just be skipped and result in a successful certificate
   handshake.  Servers which solely support PSK handshakes may be able
   to resist this form of attack by treating the cases where there is no
   valid PSK identity and where there is an identity but it has an
   invalid binder identically.

But it looks like those don't conflict with what we're doing here, so please go ahead.

levitte pushed a commit that referenced this pull request Jul 6, 2018
In 1.1.0 s_server if the PSK identity doesn't match what we have then
a warning is printed and we continue the connection anyway. In 1.1.1,
if TLSv1.3 is used and the identity doesn't match then we abort the
connection. We should really be consistent with the old behaviour.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from #6659)
@mattcaswell
Copy link
Member Author

This got pushed. Closing.

@mattcaswell mattcaswell closed this Jul 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval: done This pull request has the required number of approvals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants