X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fprotocol_auth.c;h=b8d4ee8e7a0658ff1e353fa00f36d5a0ab472fbe;hb=b0d80c7f28528c2c8857c5662b4aca779b3184bb;hp=f3322c73b6461deaea4a3a4e8a872e4fdbef20d7;hpb=f0e7e6b03e34e69cac5b01a2d943ad3b9b59d36c;p=tinc diff --git a/src/protocol_auth.c b/src/protocol_auth.c index f3322c73..b8d4ee8e 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -514,14 +514,22 @@ bool metakey_h(connection_t *c, const char *request) { /* Check and lookup cipher and digest algorithms */ - if(!(c->incipher = cipher_open_by_nid(cipher)) || !cipher_set_key_from_rsa(c->incipher, key, len, false)) { - logger(DEBUG_ALWAYS, LOG_ERR, "Error during initialisation of cipher from %s (%s)", c->name, c->hostname); - return false; + if(cipher) { + if(!(c->incipher = cipher_open_by_nid(cipher)) || !cipher_set_key_from_rsa(c->incipher, key, len, false)) { + logger(DEBUG_ALWAYS, LOG_ERR, "Error during initialisation of cipher from %s (%s)", c->name, c->hostname); + return false; + } + } else { + c->incipher = NULL; } - if(!(c->indigest = digest_open_by_nid(digest, -1))) { - logger(DEBUG_ALWAYS, LOG_ERR, "Error during initialisation of digest from %s (%s)", c->name, c->hostname); - return false; + if(digest) { + if(!(c->indigest = digest_open_by_nid(digest, -1))) { + logger(DEBUG_ALWAYS, LOG_ERR, "Error during initialisation of digest from %s (%s)", c->name, c->hostname); + return false; + } + } else { + c->indigest = NULL; } c->status.decryptin = true;