+static io_t device_io;
+devops_t devops;
+
+char *proxyhost;
+char *proxyport;
+char *proxyuser;
+char *proxypass;
+proxytype_t proxytype;
+int autoconnect;
+bool disablebuggypeers;
+
+char *scriptinterpreter;
+char *scriptextension;
+
+bool node_read_ecdsa_public_key(node_t *n) {
+ if(ecdsa_active(n->ecdsa))
+ return true;
+
+ splay_tree_t *config_tree;
+ FILE *fp;
+ char *pubname = NULL;
+ char *p;
+
+ init_configuration(&config_tree);
+ if(!read_host_config(config_tree, n->name))
+ goto exit;
+
+ /* First, check for simple ECDSAPublicKey statement */
+
+ if(get_config_string(lookup_config(config_tree, "ECDSAPublicKey"), &p)) {
+ n->ecdsa = ecdsa_set_base64_public_key(p);
+ free(p);
+ goto exit;
+ }
+
+ /* Else, check for ECDSAPublicKeyFile statement and read it */
+
+ if(!get_config_string(lookup_config(config_tree, "ECDSAPublicKeyFile"), &pubname))
+ xasprintf(&pubname, "%s" SLASH "hosts" SLASH "%s", confbase, n->name);
+
+ fp = fopen(pubname, "r");
+
+ if(!fp)
+ goto exit;
+
+ n->ecdsa = ecdsa_read_pem_public_key(fp);
+ fclose(fp);
+
+exit:
+ exit_configuration(&config_tree);
+ free(pubname);
+ return n->ecdsa;
+}
+
+bool read_ecdsa_public_key(connection_t *c) {
+ if(ecdsa_active(c->ecdsa))
+ return true;
+
+ FILE *fp;
+ char *fname;
+ char *p;
+
+ if(!c->config_tree) {
+ init_configuration(&c->config_tree);
+ if(!read_host_config(c->config_tree, c->name))
+ return false;
+ }
+
+ /* First, check for simple ECDSAPublicKey statement */
+
+ if(get_config_string(lookup_config(c->config_tree, "ECDSAPublicKey"), &p)) {
+ c->ecdsa = ecdsa_set_base64_public_key(p);
+ free(p);
+ return c->ecdsa;
+ }
+
+ /* Else, check for ECDSAPublicKeyFile statement and read it */
+
+ if(!get_config_string(lookup_config(c->config_tree, "ECDSAPublicKeyFile"), &fname))
+ xasprintf(&fname, "%s" SLASH "hosts" SLASH "%s", confbase, c->name);
+
+ fp = fopen(fname, "r");
+
+ if(!fp) {
+ logger(DEBUG_ALWAYS, LOG_ERR, "Error reading ECDSA public key file `%s': %s",
+ fname, strerror(errno));
+ free(fname);
+ return false;
+ }
+
+ c->ecdsa = ecdsa_read_pem_public_key(fp);
+ fclose(fp);
+
+ if(!c->ecdsa)
+ logger(DEBUG_ALWAYS, LOG_ERR, "Parsing ECDSA public key file `%s' failed.", fname);
+ free(fname);
+ return c->ecdsa;
+}