anchor.diff:  					RequestAuthenticator, RequestAttributes, StateData),
   			{stop, {shutdown, SessionID}, StateData}
   	end.
  -
  --spec id(Event, From, StateData) -> Result
  -	when
  -		Event :: term(),
  -		From :: {Pid, Tag},
  -		Pid :: pid(),
  -		Tag :: term(),
  -		StateData :: statedata(),
  -		Result :: {reply, Reply, NextStateName, NewStateData}
  -				| {reply, Reply,NextStateName, NewStateData, Timeout}
  -				| {reply, Reply,NextStateName, NewStateData, hibernate}
  -				| {next_state, NextStateName, NewStateData}
  -				| {next_state, NextStateName, NewStateData, Timeout}
  -				| {next_state, NextStateName, NewStateData, hibernate}
  -				| {stop, Reason, Reply, NewStateData} | {stop, Reason, NewStateData},
  -				Reply :: term(),
  -		NextStateName :: atom(),
  -		NewStateData :: statedata(),
  -		Timeout :: pos_integer() | infinity,
  -		Reason :: normal | term().
  -%% @doc Handle events sent with {@link //stdlib/gen_fsm:sync_send_event/2.
  -%%		gen_fsm:sync_send_event/2} and {@link //stdlib/gen_fsm:sync_send_event/3.
  -%%		gen_fsm:sync_send_event/3} in the <b>id</b> state.
  -%% @@see //stdlib/gen_fsm:StateName/3
  -%% @private
  -id(Response, _From, #statedata{eap_id = EapID, group_desc = GroupDesc,
  -		rand_func = RandFunc, prf = PRF, session_id = SessionID,
  -		auth_req_type = RequestType, origin_host = OHost,
  -		origin_realm = ORealm} = StateData) ->
  -	try
  -		EapMessage = Response#diameter_eap_app_DER.'EAP-Payload',
  -		case ocs_eap_codec:eap_packet(EapMessage) of
  -			#eap_packet{code = response, type = ?PWD, identifier = EapID,
  -					data = Data} -> 
  -				#eap_pwd{pwd_exch = id,
  -						data = EapPwdId} = ocs_eap_codec:eap_pwd(Data),
  -				#eap_pwd_id{group_desc = GroupDesc, random_fun = RandFunc,
  -						prf = PRF, token = Token, pwd_prep = none,
  -						identity = PeerID} = ocs_eap_codec:eap_pwd_id(EapPwdId),
  -				id2(Response, PeerID, Token, StateData);
  -			#eap_packet{code = response, type = ?LegacyNak, identifier = EapID} ->
  -			Answer = generate_diameter_response(SessionID, RequestType,
  -					?'DIAMETER_BASE_RESULT-CODE_INVALID_AVP_BITS', OHost, ORealm, <<>>),
  -				{stop, {shutdown, SessionID}, Answer, StateData}
  -		end
  -	catch
  -		_:_ ->
  -			EapPacket = #eap_packet{code = failure, identifier = EapID},
  -			Answer1 = generate_diameter_response(SessionID, RequestType,
  -					?'DIAMETER_BASE_RESULT-CODE_INVALID_AVP_BITS', OHost, ORealm, EapPacket),
  -			{stop, {shutdown, SessionID}, Answer1, StateData}
  -	end.
  -%% @hidden
  -id2(_Response, PeerID, Token, #statedata{eap_id = EapID, server_id = ServerID,
  -		session_id = SessionID, auth_req_type = AuthType, origin_host = OH,
  -		origin_realm = OR} = StateData) ->
  +%% @hidden
  +id2(#diameter_eap_app_DER{} = _Response, PeerID, Token,
  +		#statedata{eap_id = EapID, server_id = ServerID, session_id = SessionID,
  +		auth_req_type = AuthType, origin_host = OH, origin_realm = OR,
  +		diameter_port_server = PortServer} = StateData) ->
   	try
   		S_rand = crypto:rand_uniform(1, ?R),
   		NewEapID = (EapID rem 255) + 1,
  
positive.code: 					confirm_s = ConfirmS},
  			Answer1 = generate_diameter_response(SessionID, AuthType,
  					 ?'DIAMETER_BASE_RESULT-CODE_MULTI_ROUND_AUTH', OH, OR, EapPacket),
  			{reply, Answer1, confirm, NewStateData, ?TIMEOUT}
  	end.
  
  -spec confirm(Event, StateData) -> Result
  
negative.code: 			EapPacket = #eap_packet{code = success, identifier = EapID},
  			Answer = generate_diameter_response(SessionID, AuthType,
  					 ?'DIAMETER_BASE_RESULT-CODE_SUCCESS', OH, OR, EapPacket),
  			gen_server:cast(PortServer, {self(), Answer}),
  			{stop, {shutdown, SessionID}, StateData#statedata{mk = MK, msk = MSK}};
  		{error, _Reason} ->
  			EapPacket1 = #eap_packet{code = failure, identifier = EapID},
  			Answer1 = generate_diameter_response(SessionID, AuthType,
  					 ?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY', OH, OR, EapPacket1),
  			gen_server:cast(PortServer, {self(), Answer1}),
  			{stop, {shutdown, SessionID}, StateData}
  	end.			
  
  -spec handle_event(Event, StateName, StateData) -> Result
  