fix: pkg upgrades and small fixes
This commit is contained in:
@@ -29,7 +29,9 @@ const { argv } = yargs
|
||||
.alias('s', 'secret')
|
||||
.describe('secret', 'RADIUS secret')
|
||||
.number('port')
|
||||
.string(['secret', 'authentication']);
|
||||
.string(['secret', 'authentication']) as {
|
||||
argv: { port?: number; secret?: string; authentication?: string; authenticationOptions?: any };
|
||||
};
|
||||
|
||||
console.log(`Listener Port: ${argv.port || 1812}`);
|
||||
console.log(`RADIUS Secret: ${argv.secret}`);
|
||||
|
||||
@@ -49,7 +49,7 @@ export class SMTPAuth implements IAuthentication {
|
||||
tlsOptions: {
|
||||
servername: this.host, // SNI (needs to be set for gmail)
|
||||
},
|
||||
});
|
||||
} as any); // secure is currently not part of type def..but it is available: https://www.npmjs.com/package/smtp-client
|
||||
|
||||
let success = false;
|
||||
try {
|
||||
|
||||
@@ -14,7 +14,12 @@ export class UserPasswordPacketHandler implements IPacketHandler {
|
||||
|
||||
async handlePacket(packet: IPacket): Promise<IPacketHandlerResult> {
|
||||
const username = packet.attributes['User-Name'];
|
||||
const password = packet.attributes['User-Password'];
|
||||
let password = packet.attributes['User-Password'];
|
||||
|
||||
if (typeof password !== 'string' && password.indexOf(0x00) > 0) {
|
||||
// check if there is a 0x00 in it, and trim it from there
|
||||
password = password.slice(0, password.indexOf(0x00));
|
||||
}
|
||||
|
||||
if (!username || !password) {
|
||||
// params missing, this handler cannot continue...
|
||||
|
||||
Reference in New Issue
Block a user