gsliepen/tinc — pull request #6 by dechamps (2013-07-20 15:52:15+00:00)
Title: Fix segfault when connecting an experimental node to a normal one

When a node has `ExperimentalProtocol` enabled, has an ECDSA public key in its configuration file, and tries to connect to a node which has `ExperimentalProtocol` disabled, the following happens:

1. `send_id()` initializes `c->ecdsa`.
2. `id_h()` runs without touching `c->ecdsa`.
3. `send_metakey()` calls `read_rsa_public_key(c)`, which returns true without setting `c->rsa` since `c->ecdsa` is active.
4. `send_metakey()` calls `rsa_size(c->rsa)`. SEGFAULT ensues.

This patch fixes the issue by disabling ECDSA in `id_h()` if the minor protocol version indicates that the other side doesn't support ECDSA.