git ssb

8+

cel / sbotc



Commit 999198a8aad2bb4d321e727e4ef8ee1371c320e6

Use key property from config

cel authored on 9/4/2018, 5:35:10 AM
cel committed on 9/4/2018, 5:36:00 AM
Parent: 2e1180e4bcebb5fce24105133741d3947e5cb492

Files changed

sbotc.1changed
sbotc.cchanged
sbotc.1View
@@ -78,9 +78,9 @@
7878 secret-handshake protocol.
7979 .It Pa ~/.ssb/manifest.json
8080 A map of method names to method types.
8181 .It Pa ~/.ssb/config
82-JSON file containing host, port, and SHS cap key to use if the
82 +JSON file containing key, host, port, and/or SHS cap key to use if the
8383 .Ar -s ,
8484 .Ar -p
8585 or
8686 .Ar -c
sbotc.cView
@@ -822,11 +822,13 @@
822822
823823 char config_buf[8192];
824824 len = read_file(config_buf, sizeof(config_buf), "%s/config", app_dir);
825825 if (len > 0) {
826 + ssize_t key_len = json_get_value(config_buf, "key", &key);
826827 ssize_t host_len = json_get_value(config_buf, "host", &host);
827828 ssize_t port_len = json_get_value(config_buf, "port", &port);
828829 ssize_t shs_cap_len = json_get_value(config_buf, "caps.shs", &shs_cap_key_str);
830 + if (key_len >= 0) ((char *)key)[key_len] = '\0';
829831 if (host_len >= 0) ((char *)host)[host_len] = '\0';
830832 if (port_len >= 0) ((char *)port)[port_len] = '\0';
831833 if (shs_cap_len >= 0) ((char *)shs_cap_key_str)[shs_cap_len] = '\0';
832834 } else if (len < 0 && errno != ENOENT) {

Built with git-ssb-web