Use key property from config

main
cel 7 years ago committed by cel
parent 2e1180e4bc
commit 999198a8aa

@ -79,7 +79,7 @@ secret-handshake protocol.
.It Pa ~/.ssb/manifest.json
A map of method names to method types.
.It Pa ~/.ssb/config
JSON file containing host, port, and SHS cap key to use if the
JSON file containing key, host, port, and/or SHS cap key to use if the
.Ar -s ,
.Ar -p
or

@ -823,9 +823,11 @@ int main(int argc, char *argv[]) {
char config_buf[8192];
len = read_file(config_buf, sizeof(config_buf), "%s/config", app_dir);
if (len > 0) {
ssize_t key_len = json_get_value(config_buf, "key", &key);
ssize_t host_len = json_get_value(config_buf, "host", &host);
ssize_t port_len = json_get_value(config_buf, "port", &port);
ssize_t shs_cap_len = json_get_value(config_buf, "caps.shs", &shs_cap_key_str);
if (key_len >= 0) ((char *)key)[key_len] = '\0';
if (host_len >= 0) ((char *)host)[host_len] = '\0';
if (port_len >= 0) ((char *)port)[port_len] = '\0';
if (shs_cap_len >= 0) ((char *)shs_cap_key_str)[shs_cap_len] = '\0';

Loading…
Cancel
Save