Bonjour,
J'ai loupé un épisode là avec ce AuthentificationManager...
La structure est assez simple en réalité :
AuthentificationFrame s'occupe de réceptionner les paquets et de les envoyer au classe "message" correspondantes, tel que ProtocolRequired ou encore HelloConnectMessage.
AuthentificationManager quand a lui ajoute quelques fonction intéressantes qui seront utilisées dans AuthentificationFrame.
Reprenons le code de tout a l'heure :
le authentificationFrame décrypte le header et utilise l' id sous forme de switch();
ainsi quand l'id du paquet est égal a HelloConnectMessage :
case msg is HelloConnectMessage:
hcmsg = HelloConnectMessage(msg);
AuthentificationManager.getInstance().setPublicKey(hcmsg.key);
AuthentificationManager.getInstance().setSalt(hcmsg.salt);
ConnectionsHandler.getConnection().send(AuthentificationManager.getInstance().getIdentificationMessage());
KernelEventsManager.getInstance().processCallback(HookList.ConnectionTimerStart);
TimeManager.getInstance().reset();
return true;
1) AuthentificationFrame lance une nouvelle instance de HelloConnectMessage (donc décrypte le salt et la key )
2) AuthentificationFrame fait appel à AuthentificationManager pour adapter le salt et "purifier" la clef.
3) AuthentificationFrame fait appel à AuthentificationManager pour lancer une nouvelle instance de identificationMessage
à laquelle il envoie les bonnes données en paramètre.
le *3 se passe dans cette fonction :
Cliquez pour révéler
Cliquez pour masquer
public function getIdentificationMessage() : IdentificationMessage {
var _loc1_:IdentificationMessage = null;
var _loc2_:String = null;
var _loc3_:Array = null;
var _loc4_:IdentificationAccountForceMessage = null;
if(this._lva.username.indexOf("|") == -1)
{
_loc1_ = new IdentificationMessage();
if(this._lva is LoginValidationWithTicketAction || (this.nextToken))
{
_loc2_ = this.nextToken?this.nextToken:LoginValidationWithTicketAction(this._lva).ticket;
this.nextToken = null;
this.ankamaPortalKey = this.cipherMd5String(_loc2_);
_loc1_.initIdentificationMessage(_loc1_.version,XmlConfig.getInstance().getEntry("config.lang.current"),this.cipherRsa(" ",_loc2_,this._certificate),this._lva.serverId,this._lva.autoSelectServer,!(this._certificate == null),true);
}
else
{
this.ankamaPortalKey = this.cipherMd5String(this._lva.password);
_loc1_.initIdentificationMessage(_loc1_.version,XmlConfig.getInstance().getEntry("config.lang.current"),this.cipherRsa(this._lva.username,this._lva.password,this._certificate),this._lva.serverId,this._lva.autoSelectServer,!(this._certificate == null),false);
}
_loc1_.version.initVersionExtended(BuildInfos.BUILD_VERSION.major,BuildInfos.BUILD_VERSION.minor,BuildInfos.BUILD_VERSION.release,AirScanner.isStreamingVersion()?70000:BuildInfos.BUILD_REVISION,BuildInfos.BUILD_PATCH,BuildInfos.BUILD_VERSION.buildType,AirScanner.isStreamingVersion()?ClientInstallTypeEnum.CLIENT_STREAMING:ClientInstallTypeEnum.CLIENT_BUNDLE,AirScanner.hasAir()?ClientTechnologyEnum.CLIENT_AIR:ClientTechnologyEnum.CLIENT_FLASH);
return _loc1_;
}
this.ankamaPortalKey = this.cipherMd5String(this._lva.password);
_loc3_ = this._lva.username.split("|");
_loc4_ = new IdentificationAccountForceMessage();
_loc4_.initIdentificationAccountForceMessage(_loc4_.version,XmlConfig.getInstance().getEntry("config.lang.current"),this.cipherRsa(_loc3_[0],this._lva.password,this._certificate),this._lva.serverId,this._lva.autoSelectServer,!(this._certificate == null),false,0,_loc3_[1]);
_loc4_.version.initVersionExtended(BuildInfos.BUILD_VERSION.major,BuildInfos.BUILD_VERSION.minor,BuildInfos.BUILD_VERSION.release,BuildInfos.BUILD_REVISION,BuildInfos.BUILD_PATCH,BuildInfos.BUILD_VERSION.buildType,AirScanner.isStreamingVersion()?ClientInstallTypeEnum.CLIENT_STREAMING:ClientInstallTypeEnum.CLIENT_BUNDLE,AirScanner.hasAir()?ClientTechnologyEnum.CLIENT_AIR:ClientTechnologyEnum.CLIENT_FLASH);
return _loc4_;
}
Donc pour résumer, authentificationManager contient les fonctions utilisées dans notre authentificationFrame ;)