Skip to content
Snippets Groups Projects
Commit 2382a93e authored by rswindell's avatar rswindell
Browse files

Add experimental Binkp/TLS option to [node:*] sections of sbbsecho.ini

(defaults to false)
Set to BinkpTLS=true to use BinkP over TLS for a specified node.
parent eea679fa
No related branches found
No related tags found
No related merge requests found
...@@ -596,6 +596,7 @@ function callout(addr, scfg, locks, bicfg) ...@@ -596,6 +596,7 @@ function callout(addr, scfg, locks, bicfg)
var bp = new BinkP(version_notice, undefined, rx_callback, tx_callback); var bp = new BinkP(version_notice, undefined, rx_callback, tx_callback);
var port; var port;
var host; var host;
var tls = false;
var f; var f;
var success = false; var success = false;
var src_addr; var src_addr;
...@@ -618,6 +619,7 @@ function callout(addr, scfg, locks, bicfg) ...@@ -618,6 +619,7 @@ function callout(addr, scfg, locks, bicfg)
bp.cb_data.binkitpw = bp.cb_data.binkitcfg.node[addr].pass; bp.cb_data.binkitpw = bp.cb_data.binkitcfg.node[addr].pass;
port = bp.cb_data.binkitcfg.node[addr].port; port = bp.cb_data.binkitcfg.node[addr].port;
host = bp.cb_data.binkitcfg.node[addr].host; host = bp.cb_data.binkitcfg.node[addr].host;
tls = bp.cb_data.binkitcfg.node[addr].tls;
if (bp.plain_auth_only) { if (bp.plain_auth_only) {
bp.require_md5 = false; bp.require_md5 = false;
bp.require_crypt = false; bp.require_crypt = false;
...@@ -657,7 +659,7 @@ function callout(addr, scfg, locks, bicfg) ...@@ -657,7 +659,7 @@ function callout(addr, scfg, locks, bicfg)
log(LOG_DEBUG, format("connecting to %s at %s", addr, host)); log(LOG_DEBUG, format("connecting to %s at %s", addr, host));
// We won't add files until the auth finishes... // We won't add files until the auth finishes...
success = bp.connect(addr, bp.cb_data.binkitpw, callout_auth_cb, port, host); success = bp.connect(addr, bp.cb_data.binkitpw, callout_auth_cb, port, host, tls);
// Statistics // Statistics
update_stats(stats.callout[success], addr, bp, host); update_stats(stats.callout[success], addr, bp, host);
update_totals(stats.totals, addr, bp, true, success); update_totals(stats.totals, addr, bp, true, success);
......
...@@ -402,7 +402,7 @@ BinkP.prototype.parseArgs = function(data) ...@@ -402,7 +402,7 @@ BinkP.prototype.parseArgs = function(data)
* parameter string send with the M_OK message... hopefully either "secure" * parameter string send with the M_OK message... hopefully either "secure"
* or "non-secure" * or "non-secure"
*/ */
BinkP.prototype.connect = function(addr, password, auth_cb, port, inet_host) BinkP.prototype.connect = function(addr, password, auth_cb, port, inet_host, tls)
{ {
var pkt; var pkt;
var i; var i;
...@@ -455,6 +455,11 @@ BinkP.prototype.connect = function(addr, password, auth_cb, port, inet_host) ...@@ -455,6 +455,11 @@ BinkP.prototype.connect = function(addr, password, auth_cb, port, inet_host)
log(LOG_DEBUG, "Connection to "+inet_host+":"+port+" successful"); log(LOG_DEBUG, "Connection to "+inet_host+":"+port+" successful");
if(tls === true) {
log(LOG_INFO, "Negotiating TLS");
this.sock.ssl_session = true;
}
this.authenticated = undefined; this.authenticated = undefined;
if (this.crypt_support && !this.plain_auth_only && password !== '-') if (this.crypt_support && !this.plain_auth_only && password !== '-')
this.sendCmd(this.command.M_NUL, "OPT CRYPT"); this.sendCmd(this.command.M_NUL, "OPT CRYPT");
......
...@@ -387,6 +387,7 @@ function BinkITCfg() ...@@ -387,6 +387,7 @@ function BinkITCfg()
this.node[sec].host = f.iniGetValue(section, 'BinkpHost'); this.node[sec].host = f.iniGetValue(section, 'BinkpHost');
this.node[sec].inbox = f.iniGetValue(section, 'inbox'); this.node[sec].inbox = f.iniGetValue(section, 'inbox');
this.node[sec].outbox = f.iniGetValue(section, 'outbox'); this.node[sec].outbox = f.iniGetValue(section, 'outbox');
this.node[sec].tls = f.iniGetValue(section, 'BinkpTLS', false);
}, this); }, this);
f.close(); f.close();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment