Menu

#2 error handling with wrong PSK handshake

1.0
closed
nobody
None
2014-08-07
2014-08-01
No

In case the tinydtls client is used against a server with wrong PSK secret, no error is pushed back to the user, using error code.

From what I understand of the code in the dtls.c dtls_handle_message function there is something wrong:
handle_alert() is called but the error return code is not correctly tested

how I fixed the problem:

err = handle_alert(ctx, peer, msg, data, data_length);
if (err < 0 || err == 1) {
dtls_warn("received wrong package\n");
/ handle alert has invalidated peer /
peer = NULL;
return -1;
}
break;

Now I correctly receive an error and can close my session

Discussion

  • Julien Vermillard

    here a patch

     
  • Olaf Bergmann

    Olaf Bergmann - 2014-08-07

    Thanks!

     
  • Olaf Bergmann

    Olaf Bergmann - 2014-08-07
    • status: open --> closed
     
  • Olaf Bergmann

    Olaf Bergmann - 2014-08-07

    Applied the proposed patch

     
Auth0 Logo