Menu

#5 PSK identity is not checked

1.0
closed
None
2014-11-21
2014-11-18
sbernard
No

I have a device (based on tinydtls) and a server with a preloaded psk identity.
In my use case, the connection could be initiated by the server or by the device.

I did some tests where the server initiate connection to the device with the same psk key but with a different identity, and this works without any error or warning.
(at TLS level my device is considered as the server :p)

I look at the specification and it say :

If the server does not recognize the PSK identity, it MAY respond
with an "unknown_psk_identity" alert message. Alternatively, if the
server wishes to hide the fact that the PSK identity was not known,
it MAY continue the protocol as if the PSK identity existed but the
key was incorrect: that is, respond with a "decrypt_error" alert.

Discussion

  • Olaf Bergmann

    Olaf Bergmann - 2014-11-20

    I see two issues here: First, the function get_psk_info() in the example application returns the wrong value in this case. This is fixed in commit 7c1852df.

    The second issue is that the client application is not notified of the failed connection attempt. I understand that bug #4 "raise event for connection failed instead of return error in handle_message" already addresses this, hence I close this ticket as fixed.

     
  • Olaf Bergmann

    Olaf Bergmann - 2014-11-20
    • status: open --> closed
    • assigned_to: Olaf Bergmann
     
  • sbernard

    sbernard - 2014-11-21

    Ok, I just see that the psk identify check should be done in get_psk_info.
    Thx.