dtls: remove checks for correct package

The checks that the correct package was received is now done in
handle_handshake() and it is not needed in each function any more.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: inline check_ccs()

The code is easier to read with the function inlined.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: handle error in dtls_get_cookie()

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: forward errors in handle_ccs()

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: add line breaks after log output

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: make it possible to code dtls alert into return code

When some functions went into an error state and wants to send an
alert, it is now possible to encode it in the return code. The
dtls_handle_message() function will then send an alert message to the
remote peer.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: send a tls alert in case of an error

Without this patch the handshake just aborted when an error occurred,
but the peer was not informed about a problem. Now a tls alert is send
to the peer and it gets informed about the error.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>