dtls: set ssl_set_server()

To decrypt packages wireshark has to know if this is a client or a
server package. Setting this member was missing in the DTLS code.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
SSL: add decrypt support for CCM and CCM_8 Ciphers

This adds decrypt support for CCM and CCM_8 Ciphers like the ones
specified in rfc6655.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: add psk decrypt support

This adds support for decryption of DTLS packages when a PSK cipher was
used.

The code for generating a pre master secret was moved from packet-ssl.c
into packet-ssl-utils.c and packet-dtls.c now uses the same code to
generate a pre master secret.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dlts: add cipher version for OpenSSL pre 0.9.8f

OpenSSL pre 0.9.8f uses the TLS version 0x0100 and is not completely
compatible with DTLS 1.0 or 1.2. One difference is that the encrypted
pre master from TLS 1.0 does not have an own length, which is needed by
TLS and DTLS 1.0, this makes decrypting impossible. This patch makes it
possible for the code to distinguish between this OpenSSL version and
real DTLS 1.0, because they are not using the same code any more. This
is needed to fix the snakeoil-dtls test.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: fix buffer overflow in mac check

With SHA256 32 bytes and with SHA384 48 bytes are needed for the hash
in dtls_check_mac(), but it only had 20, which was enough for SHA1.
In dtls_check_mac() ssl_hmac_final() is called with a buffer of 20
bytes, but it needed more, which caused a buffer overflow.

This patch also replaces the magic values with a constant and adds a
assertion which should warn if such a problem occurs again like when
SHA512 will be added.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: add support for pre master secret file

This adds support to read the pre master secrets from a log file like
it is supported for SSL/TLS.
update cipher list
dtls: dissect tls extensions

This adds dissection for more TLS extensions. The code was mostly
copied from the SSL dissector.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
tmp: add basic support for TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 and raw public keys

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