GitHub CI: check project for warnings with clang/gcc.
[tinc] / src / protocol_auth.c
index de3d70d..a40c87f 100644 (file)
@@ -26,7 +26,6 @@
 #include "control_common.h"
 #include "cipher.h"
 #include "crypto.h"
-#include "device.h"
 #include "digest.h"
 #include "ecdsa.h"
 #include "edge.h"
@@ -37,7 +36,6 @@
 #include "net.h"
 #include "netutl.h"
 #include "node.h"
-#include "prf.h"
 #include "protocol.h"
 #include "rsa.h"
 #include "script.h"
@@ -46,6 +44,7 @@
 #include "xalloc.h"
 
 #include "ed25519/sha512.h"
+#include "keys.h"
 
 int invitation_lifetime;
 ecdsa_t *invitation_key = NULL;
@@ -160,7 +159,7 @@ bool send_id(connection_t *c) {
        int minor = 0;
 
        if(experimental) {
-               if(c->outgoing && !read_ecdsa_public_key(c)) {
+               if(c->outgoing && !read_ecdsa_public_key(&c->ecdsa, &c->config_tree, c->name)) {
                        minor = 1;
                } else {
                        minor = myself->connection->protocol_minor;
@@ -453,7 +452,7 @@ bool id_h(connection_t *c, const char *request) {
                }
 
                if(experimental) {
-                       read_ecdsa_public_key(c);
+                       read_ecdsa_public_key(&c->ecdsa, &c->config_tree, c->name);
                }
 
                /* Ignore failures if no key known yet */
@@ -500,7 +499,7 @@ bool send_metakey(connection_t *c) {
                return false;
        }
 
-       if(!read_rsa_public_key(c)) {
+       if(!read_rsa_public_key(&c->rsa, c->config_tree, c->name)) {
                return false;
        }
 
@@ -917,7 +916,7 @@ static bool upgrade_h(connection_t *c, const char *request) {
                return false;
        }
 
-       if(ecdsa_active(c->ecdsa) || read_ecdsa_public_key(c)) {
+       if(ecdsa_active(c->ecdsa) || read_ecdsa_public_key(&c->ecdsa, &c->config_tree, c->name)) {
                char *knownkey = ecdsa_get_base64_public_key(c->ecdsa);
                bool different = strcmp(knownkey, pubkey);
                free(knownkey);