X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fprotocol_key.c;h=af103c62d842d42d0c2e2352ba6da3398b904266;hb=a518f82af79036527cb8d1a592a6778ec1657e9c;hp=7f6e1653e4e7c71436fda21567d6ab33f2ca1663;hpb=9b9230a0a79c670b86f54fadd2807b864ff9d91f;p=tinc diff --git a/src/protocol_key.c b/src/protocol_key.c index 7f6e1653..af103c62 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -273,8 +273,10 @@ bool send_ans_key(node_t *to) { abort(); randomize(key, keylen); - cipher_set_key(to->incipher, key, false); - digest_set_key(to->indigest, key, keylen); + if(!cipher_set_key(to->incipher, key, false)) + abort(); + if(!digest_set_key(to->indigest, key, keylen)) + abort(); bin2hex(key, key, keylen); @@ -418,8 +420,10 @@ bool ans_key_h(connection_t *c, const char *request) { /* Update our copy of the origin's packet key */ - cipher_set_key(from->outcipher, key, true); - digest_set_key(from->outdigest, key, keylen); + if(!cipher_set_key(from->outcipher, key, true)) + return false; + if(!digest_set_key(from->outdigest, key, keylen)) + return false; from->status.validkey = true; from->sent_seqno = 0;