anchor.diff:  					RequestAuthenticator, RequestAttributes, NewStateData),
   			{stop, {shutdown, SessionID}, NewStateData}
   	end;
  -confirm(#diameter_eap_app_DER{} = Response, #statedata{eap_id = EapID,
  +confirm(#diameter_eap_app_DER{} = Request, #statedata{eap_id = EapID,
   		session_id = SessionID, auth_req_type = AuthType, origin_host = OH,
   		origin_realm = OR, diameter_port_server = PortServer} = StateData) ->
   	try
  -		EapMessage = Response#diameter_eap_app_DER.'EAP-Payload',
  +		EapMessage = Request#diameter_eap_app_DER.'EAP-Payload',
   		EapData = ocs_eap_codec:eap_packet(EapMessage),
   		#eap_packet{code = response, type = ?PWD,
   				identifier = EapID, data = Data} = EapData,
   		EapHeader = ocs_eap_codec:eap_pwd(Data),
   		#eap_pwd{pwd_exch = confirm, data = ConfirmP} = EapHeader,
   		NewStateData = StateData#statedata{confirm_p = ConfirmP},
  -		confirm4(NewStateData)
  +		confirm4(Request, NewStateData)
   	catch
   		_:_ ->
   			EapPacket = #eap_packet{code = failure, identifier = EapID},
   			send_diameter_response(SessionID, AuthType,
   					 ?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY', OH, OR,
  -					 EapPacket, PortServer),
  +					 EapPacket, PortServer, Request, StateData),
   			{stop, {shutdown, SessionID}, StateData}
   	end.
   %% @hidden
  
positive.code: 		#eap_pwd_commit{element = ElementP, scalar = ScalarP} = Body,
  		NextStateData = StateData#statedata{scalar_p = ScalarP,
  				element_p = ElementP},
  		commit5(BodyData, NextStateData)
  	catch
  		_:_ ->
  			EapPacket2 = #eap_packet{code = failure, identifier = EapID},
  			send_diameter_response(SessionID, AuthType,
  					 ?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY', OH, OR,
  					 EapPacket2, PortServer),
  			{stop, {shutdown, SessionID}, StateData}
  	end.
  %% @hidden
  
negative.code: 	case ocs_eap_pwd:h([Ks, ElementP, ScalarP,
  			ElementS, ScalarS, Ciphersuite]) of
  		ConfirmP ->
  			confirm6(Request, StateData);
  		_ ->
  			EapPacket = #eap_packet{code = failure, identifier = EapID},
  			send_diameter_response(SessionID, AuthType,
  					 ?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY', OH, OR,
  					 EapPacket, PortServer, Request, StateData),
  			{stop, {shutdown, SessionID}, StateData}
  	end.
  %% @hidden
  confirm6(Request, #statedata{eap_id = EapID, ks = Ks, confirm_p = ConfirmP,
  		confirm_s = ConfirmS, scalar_s = ScalarS, scalar_p = ScalarP,
  		group_desc = GroupDesc, rand_func = RandFunc, prf = PRF,
  		session_id = SessionID, peer_id = PeerID, password = Password,
  