Commit 5290ac37 authored by simon's avatar simon

fix: pkg upgrades and small fixes

parent 4af6eded
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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...
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment