small edits
This commit is contained in:
@@ -119,9 +119,6 @@ class WTVIRC {
|
|||||||
// SSL detected, upgrade socket to TLS
|
// SSL detected, upgrade socket to TLS
|
||||||
const keyBuffer = fs.readFileSync(this.wtvshared.parseConfigVars(this.irc_config.ssl_cert.key));
|
const keyBuffer = fs.readFileSync(this.wtvshared.parseConfigVars(this.irc_config.ssl_cert.key));
|
||||||
const certBuffer = fs.readFileSync(this.wtvshared.parseConfigVars(this.irc_config.ssl_cert.cert));
|
const certBuffer = fs.readFileSync(this.wtvshared.parseConfigVars(this.irc_config.ssl_cert.cert));
|
||||||
|
|
||||||
// Upgrade the socket to TLS (SSL handshake)
|
|
||||||
|
|
||||||
const secureSocket = new tls.TLSSocket(socket, {
|
const secureSocket = new tls.TLSSocket(socket, {
|
||||||
isServer: true,
|
isServer: true,
|
||||||
ALPNProtocols: ['irc'],
|
ALPNProtocols: ['irc'],
|
||||||
@@ -158,7 +155,6 @@ class WTVIRC {
|
|||||||
return originalWrite.apply(secureSocket, args);
|
return originalWrite.apply(secureSocket, args);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// Feed the first chunk into the TLS socket for handshake
|
|
||||||
socket.removeAllListeners('error');
|
socket.removeAllListeners('error');
|
||||||
secureSocket.setEncoding('ascii');
|
secureSocket.setEncoding('ascii');
|
||||||
secureSocket.registered = false;
|
secureSocket.registered = false;
|
||||||
@@ -1433,7 +1429,6 @@ class WTVIRC {
|
|||||||
checkMask(mask, socket) {
|
checkMask(mask, socket) {
|
||||||
const username = this.nicknames.get(socket);
|
const username = this.nicknames.get(socket);
|
||||||
if (!username) return false;
|
if (!username) return false;
|
||||||
console.log
|
|
||||||
const userIdent = this.usernames.get(username) || username;
|
const userIdent = this.usernames.get(username) || username;
|
||||||
const host = socket.host;
|
const host = socket.host;
|
||||||
const realhost = socket.realhost;
|
const realhost = socket.realhost;
|
||||||
@@ -1471,7 +1466,7 @@ class WTVIRC {
|
|||||||
matches = nickRegex.test(fullNick2) && userRegex.test(fullUser2) && hostRegex.test(fullHost2);
|
matches = nickRegex.test(fullNick2) && userRegex.test(fullUser2) && hostRegex.test(fullHost2);
|
||||||
}
|
}
|
||||||
if (!matches && fullMask3) {
|
if (!matches && fullMask3) {
|
||||||
// Try matching against the real host if available
|
// Try matching against the real IP if available
|
||||||
const [fullNick3, fullRest3] = fullMask3.split('!', 2);
|
const [fullNick3, fullRest3] = fullMask3.split('!', 2);
|
||||||
const [fullUser3, fullHost3] = (fullRest3 || '').split('@', 2);
|
const [fullUser3, fullHost3] = (fullRest3 || '').split('@', 2);
|
||||||
matches = nickRegex.test(fullNick3) && userRegex.test(fullUser3) && hostRegex.test(fullHost3);
|
matches = nickRegex.test(fullNick3) && userRegex.test(fullUser3) && hostRegex.test(fullHost3);
|
||||||
|
|||||||
Reference in New Issue
Block a user