fix: eap call is using wrong this, needs more refactoring later
This commit is contained in:
parent
807e1508d7
commit
837453fca2
14
src/eap.ts
14
src/eap.ts
@ -6,8 +6,6 @@ import { IResponseHandlers, ResponseHandler } from './types/Handler';
|
|||||||
import { EAPTTLS } from './eap/eap-ttls';
|
import { EAPTTLS } from './eap/eap-ttls';
|
||||||
|
|
||||||
export class EAPHandler {
|
export class EAPHandler {
|
||||||
maxFragmentSize = 1400; // @todo .. take framed-mtu into account from AVPs
|
|
||||||
|
|
||||||
eapTTLS: EAPTTLS;
|
eapTTLS: EAPTTLS;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -24,16 +22,16 @@ export class EAPHandler {
|
|||||||
identifier: number,
|
identifier: number,
|
||||||
data?: Buffer,
|
data?: Buffer,
|
||||||
msgType = 21,
|
msgType = 21,
|
||||||
msgFlags = 0b00000000
|
msgFlags = 0x00
|
||||||
) {
|
) {
|
||||||
|
const maxFragmentSize = 1400; // @todo .. take framed-mtu into account from AVPs
|
||||||
let i = 0;
|
let i = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
const fragmentMaxPart =
|
const fragmentMaxPart =
|
||||||
data && (i + 1) * this.maxFragmentSize > data.length
|
data && (i + 1) * maxFragmentSize > data.length ? undefined : (i + 1) * maxFragmentSize;
|
||||||
? undefined
|
const sslPart = data && data.slice(i * maxFragmentSize, fragmentMaxPart);
|
||||||
: (i + 1) * this.maxFragmentSize;
|
console.log('sslPart', sslPart, i, maxFragmentSize, i * maxFragmentSize, fragmentMaxPart);
|
||||||
const sslPart = data && data.slice(i * this.maxFragmentSize, fragmentMaxPart);
|
|
||||||
|
|
||||||
const includeLength =
|
const includeLength =
|
||||||
data &&
|
data &&
|
||||||
@ -106,7 +104,7 @@ export class EAPHandler {
|
|||||||
and process the next one when client has ack. (message without data)
|
and process the next one when client has ack. (message without data)
|
||||||
*/
|
*/
|
||||||
response(resBuffer);
|
response(resBuffer);
|
||||||
} while (data && i * this.maxFragmentSize < data.length);
|
} while (data && i * maxFragmentSize < data.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleEAPMessage(msg: Buffer, state: string, handlers: IResponseHandlers) {
|
handleEAPMessage(msg: Buffer, state: string, handlers: IResponseHandlers) {
|
||||||
|
Loading…
Reference in New Issue
Block a user