anchor.diff:  		authenticator = RequestAuthenticator,
   		attributes = Attributes}, RadiusFsm},
   		#statedata{eap_id = EapID, session_id = SessionID,
  -		secret = Secret} = StateData) ->
  +		secret = Secret, group_desc = GroupDesc,
  +		rand_func = RandFunc, prf = PRF} = StateData) ->
   	Token = crypto:rand_bytes(4),
   	{ok, HostName} = inet:gethostname(),
  -	EapPwdId = #eap_pwd_id{group_desc = 19, random_fun = 1, prf = 1,
  -			token = Token, pwd_prep = none, identity = HostName},
  +	EapPwdId = #eap_pwd_id{group_desc = GroupDesc, random_fun = RandFunc,
  +			prf = PRF, token = Token, pwd_prep = none, identity = HostName},
   	EapPwdData = ocs_eap_codec:eap_pwd_id(EapPwdId),
   	EapPwd = #eap_pwd{length = false,
   			more = false, pwd_exch = id, data = EapPwdData},
   	EapData = ocs_eap_codec:eap_pwd(EapPwd),
  -	NewStateData = StateData#statedata{eap_id = EapID + 1, token = Token},
  +	NewStateData = StateData#statedata{token = Token},
   	case radius_attributes:find(?EAPMessage, Attributes) of
   		{ok, <<>>} ->
  -			send_response(?Identity, EapID, EapData, ?AccessChallenge,
  +			send_response(?Request, EapID, EapData, ?AccessChallenge,
   					RadiusID, RequestAuthenticator, Secret, RadiusFsm),
   			{next_state, wait_for_id, NewStateData, ?TIMEOUT};
   		{ok, EAPMessage} ->
   			case catch ocs_eap_codec:eap_packet(EAPMessage) of
   				#eap_packet{code = ?Response, type = ?Identity} ->
  -					send_response(?Identity, EapID, EapData, ?AccessChallenge,
  +					send_response(?Request, EapID, EapData, ?AccessChallenge,
   							RadiusID, RequestAuthenticator, Secret, RadiusFsm),
   					{next_state, wait_for_id, NewStateData, ?TIMEOUT};
   				#eap_packet{code = Code, type = EapType, data = Data} ->
  
positive.code: 					{ok, idle, StateData, ?TIMEOUT}
  			end;
  		{error, not_found} ->
  			send_response(?Identity, EapID, EapData, ?AccessChallenge,
  					RadiusID, RequestAuthenticator, Secret, RadiusFsm),
  			{next_state, wait_for_id, NewStateData, ?TIMEOUT}
  	end;
  
negative.code: 	{stop, {shutdown, SessionID}, StateData};
  wait_for_commit({#radius{id = RadiusID, authenticator = RequestAuthenticator,
  		attributes = Attributes} = AccessRequest, RadiusFsm},
  		#statedata{eap_id = EapID, secret = Secret, group_desc = GroupDesc,
  		rand_func = RandFunc, prf = PRF, pwe = PWE, element_s = ElementS,
  		scalar_s = ScalarS, s_rand = S_rand} = StateData)->
  	try 
  