|
|
|
@ -3,7 +3,7 @@
|
|
|
|
|
import * as NodeCache from 'node-cache';
|
|
|
|
|
import debug from 'debug';
|
|
|
|
|
import { makeid } from '../../helpers';
|
|
|
|
|
import { IPacket, IPacketHandler, IPacketHandlerResult } from '../../types/PacketHandler';
|
|
|
|
|
import { IPacket, IPacketHandler, IPacketHandlerResult, PacketResponseCode } from '../../types/PacketHandler';
|
|
|
|
|
import { IEAPMethod } from '../../types/EAPMethod';
|
|
|
|
|
import { buildEAPResponse, decodeEAPHeader } from './eap/EAPHelper';
|
|
|
|
|
|
|
|
|
@ -34,6 +34,7 @@ export class EAPPacketHandler implements IPacketHandler {
|
|
|
|
|
// EAP MESSAGE
|
|
|
|
|
const msg = packet.attributes['EAP-Message'] as Buffer;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const { code, type, identifier, data } = decodeEAPHeader(msg);
|
|
|
|
|
|
|
|
|
|
const currentState = this.eapConnectionStates.get(stateID) as { validMethods: IEAPMethod[] };
|
|
|
|
@ -128,5 +129,9 @@ export class EAPPacketHandler implements IPacketHandler {
|
|
|
|
|
}
|
|
|
|
|
// silently ignore;
|
|
|
|
|
return {};
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error('decoding of (generic) EAP package failed', msg, err);
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|