projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
GitHub CI: check project for warnings with clang/gcc.
[tinc]
/
src
/
protocol_auth.c
diff --git
a/src/protocol_auth.c
b/src/protocol_auth.c
index
a270ffc
..
a40c87f
100644
(file)
--- a/
src/protocol_auth.c
+++ b/
src/protocol_auth.c
@@
-26,7
+26,6
@@
#include "control_common.h"
#include "cipher.h"
#include "crypto.h"
#include "control_common.h"
#include "cipher.h"
#include "crypto.h"
-#include "device.h"
#include "digest.h"
#include "ecdsa.h"
#include "edge.h"
#include "digest.h"
#include "ecdsa.h"
#include "edge.h"
@@
-37,7
+36,6
@@
#include "net.h"
#include "netutl.h"
#include "node.h"
#include "net.h"
#include "netutl.h"
#include "node.h"
-#include "prf.h"
#include "protocol.h"
#include "rsa.h"
#include "script.h"
#include "protocol.h"
#include "rsa.h"
#include "script.h"
@@
-46,6
+44,7
@@
#include "xalloc.h"
#include "ed25519/sha512.h"
#include "xalloc.h"
#include "ed25519/sha512.h"
+#include "keys.h"
int invitation_lifetime;
ecdsa_t *invitation_key = NULL;
int invitation_lifetime;
ecdsa_t *invitation_key = NULL;
@@
-160,7
+159,7
@@
bool send_id(connection_t *c) {
int minor = 0;
if(experimental) {
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;
minor = 1;
} else {
minor = myself->connection->protocol_minor;
@@
-214,6
+213,9
@@
static bool finalize_invitation(connection_t *c, const char *data, uint16_t len)
environment_add(&env, "REMOTEADDRESS=%s", address);
environment_add(&env, "NAME=%s", myself->name);
environment_add(&env, "REMOTEADDRESS=%s", address);
environment_add(&env, "NAME=%s", myself->name);
+ free(address);
+ free(port);
+
execute_script("invitation-accepted", &env);
environment_exit(&env);
execute_script("invitation-accepted", &env);
environment_exit(&env);
@@
-450,7
+452,7
@@
bool id_h(connection_t *c, const char *request) {
}
if(experimental) {
}
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 */
}
/* Ignore failures if no key known yet */
@@
-497,7
+499,7
@@
bool send_metakey(connection_t *c) {
return false;
}
return false;
}
- if(!read_rsa_public_key(
c
)) {
+ if(!read_rsa_public_key(
&c->rsa, c->config_tree, c->name
)) {
return false;
}
return false;
}
@@
-914,7
+916,7
@@
static bool upgrade_h(connection_t *c, const char *request) {
return false;
}
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);
char *knownkey = ecdsa_get_base64_public_key(c->ecdsa);
bool different = strcmp(knownkey, pubkey);
free(knownkey);