mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-22 23:50:52 +01:00
Merge branch 'handshake-complete-diffie' of https://github.com/oobjectt/nitro-renderer into oobjectt-handshake-complete-diffie
This commit is contained in:
commit
261207b0ff
File diff suppressed because one or more lines are too long
@ -437,4 +437,5 @@ export class IncomingHeader
|
||||
public static WELCOME_GIFT_CHANGE_EMAIL_RESULT = 2293;
|
||||
public static WELCOME_GIFT_STATUS = 2707;
|
||||
public static HANDSHAKE_INIT_DIFFIE = 1347;
|
||||
public static HANDSHAKE_COMPLETE_DIFFIE = 3885;
|
||||
}
|
||||
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../api';
|
||||
import { MessageEvent } from '../../../../../events';
|
||||
import { CompleteDiffieHandshakeParser } from '../../parser';
|
||||
|
||||
export class CompleteDiffieHandshakeEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, CompleteDiffieHandshakeParser);
|
||||
}
|
||||
|
||||
public getParser(): CompleteDiffieHandshakeParser
|
||||
{
|
||||
return this.parser as CompleteDiffieHandshakeParser;
|
||||
}
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
export * from './CompleteDiffieHandshakeEvent';
|
||||
export * from './DisconnectReasonEnum';
|
||||
export * from './DisconnectReasonEvent';
|
||||
export * from './InitDiffieHandshakeEvent';
|
||||
|
@ -0,0 +1,36 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
|
||||
|
||||
export class CompleteDiffieHandshakeParser implements IMessageParser
|
||||
{
|
||||
private _encryptedPublicKey: string = null;
|
||||
private _serverClientEncryption: boolean = false;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._encryptedPublicKey = wrapper.readString();
|
||||
|
||||
if(wrapper.bytesAvailable)
|
||||
{
|
||||
this._serverClientEncryption = wrapper.readBoolean();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get encryptedPublicKey(): string
|
||||
{
|
||||
return this._encryptedPublicKey;
|
||||
}
|
||||
|
||||
public get serverClientEncryption(): boolean
|
||||
{
|
||||
return this._serverClientEncryption;
|
||||
}
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
export * from './CompleteDiffieHandshakeParser';
|
||||
export * from './DisconnectReasonParser';
|
||||
export * from './InitDiffieHandshakeParser';
|
||||
export * from './NoobnessLevelMessageParser';
|
||||
|
Loading…
Reference in New Issue
Block a user