anchor.diff:  	PeerId = "6" ++ ct:get_config(mcc) ++ ct:get_config(mcc) ++ MSIN ++ "@wlan." ++ Realm,
   	PeerId1 = list_to_binary(PeerId),
   	ok = send_radius_identity(Socket, Address, Port, NasId,
  -			PeerId1, Secret, ReqAuth, EapId, RadId),
  +			PeerId1, Secret, mac(), ReqAuth, EapId, RadId),
   	{error,timeout} = gen_udp:recv(Socket, 0, 5000).
  +
  +challenge_radius_trusted() ->
  +   [{userdata, [{doc, "Send an EAP-Challenge/Response using RADIUS from a trusted client"}]}].
  +
  +challenge_radius_trusted(Config) ->
  +	Socket = ?config(socket, Config),
  +	{ok, RadiusConfig} = application:get_env(ocs, radius),
  +	{auth, [{Address, Port, _} | _]} = lists:keyfind(auth, 1, RadiusConfig),
  +	NasId = ?config(nas_id, Config),
  +	StationID = mac(),
  +	ReqAuth = radius:authenticator(),
  +	RadiusId = 1,
  +	EapId = 1,
  +	Secret = ct:get_config(radius_shared_secret),
  +	Realm = ?config(realm, Config),
  +	MSIN = msin(),
  +	Name = ct:get_config(mcc) ++ ct:get_config(mcc) ++ MSIN,
  +	PeerId = "6" ++ Name ++ "@wlan." ++ Realm,
  +	PeerId1 = list_to_binary(PeerId),
  +	P1 = price(usage, octets, rand:uniform(1000000), rand:uniform(100)),
  +	OfferId = add_offer([P1], 4),
  +	ProdRef = add_product(OfferId),
  +	#service{password = #aka_cred{k = K, opc = OPc,
  +			dif = DIF}} = add_service(Name, ProdRef),
  +	ok = send_radius_identity(Socket, Address, Port, NasId,
  +			PeerId1, Secret, StationID, ReqAuth, EapId, RadiusId),
  +	EapMessage1 = radius_access_challenge(Socket, Address, Port,
  +			Secret, RadiusId, ReqAuth),
  +	#eap_packet{code = request, type = ?AKAprime, identifier = NextEapId1,
  +			data = EapData1} = ocs_eap_codec:eap_packet(EapMessage1),
  +	#eap_aka_challenge{rand = RAND, autn = AUTN,
  +			mac = MAC1} = ocs_eap_codec:eap_aka(EapData1),
  +	{RES, CK, IK, <<AK:48>>} = ocs_milenage:f2345(OPc, K, RAND),
  +	SQN = sqn(DIF),
  +	AMF = amf(),
  +	MACA = ocs_milenage:f1(OPc, K, RAND, <<SQN:48>>, AMF),
  +%	AUTN = autn(SQN, AK, AMF, MACA),
  +	<<CKprime:16/binary, IKprime:16/binary>> = kdf(CK, IK, "WLAN", SQN, AK),
  +	<<_:16/binary, Kaut:32/binary, _:32/binary, _:64/binary,
  +         _:64/binary, _/binary>> = prf(<<IKprime/binary, CKprime/binary>>,
  +			<<"EAP-AKA'", PeerId1/binary>>, 7),
  +	EapMessage2 = ocs_eap_codec:aka_clear_mac(EapMessage1),
  +	MAC1 = crypto:hmac(sha256, Kaut, EapMessage2, 16),
  +	AkaChallenge1 = #eap_aka_challenge{res = RES, mac = <<0:128>>},
  +	EapData2 = ocs_eap_codec:eap_aka(AkaChallenge1),
  +	EapPacket1 = #eap_packet{code = response, type = ?AKAprime,
  +			identifier = NextEapId1, data = EapData2},
  +	EapMessage3 = ocs_eap_codec:eap_packet(EapPacket1),
  +	MAC2 = crypto:hmac(sha256, Kaut, EapMessage3, 16),
  +	EapMessage4 = ocs_eap_codec:aka_set_mac(MAC2, EapMessage3),
  +	NextRadiusId = RadiusId + 1,
  +	radius_access_request(Socket, Address, Port, NasId,
  +			PeerId1, Secret, StationID, ReqAuth, NextRadiusId, EapMessage4),
  +	EapMessage5 = radius_access_accept(Socket,
  +			Address, Port, Secret, NextRadiusId, ReqAuth),
  +	#eap_packet{code = success,
  +			identifier = NextEapId1} = ocs_eap_codec:eap_packet(EapMessage5).
   
   %%---------------------------------------------------------------------
   %%  Internal functions
  
positive.code: 		S :: binary(),
  		N :: pos_integer(),
  		MK :: binary().
  %% @doc Pseudo-RANDom Number Function (PRF).
  %%
  %%      See RFC5448 3.4.
  %% @private
  
negative.code: 			++ MSIN ++ "@wlan." ++ Realm,
  	PeerId1 = list_to_binary(PeerId),
  	ok = send_radius_identity(Socket, Address, Port, NasId,
  			PeerId1, Secret, mac(), ReqAuth, EapId, RadId),
  	NextEapId = EapId + 1,
  	EapMsg = radius_access_challenge(Socket,
  			Address, Port, Secret, RadId, ReqAuth),
  	#eap_packet{code = request, type = ?AKAprime, identifier = NextEapId,
  			data = EapData} = ocs_eap_codec:eap_packet(EapMsg),
  	#eap_aka_identity{fullauth_id_req = true} = ocs_eap_codec:eap_aka(EapData).
  
  identity_radius_trusted() ->
     [{userdata, [{doc, "Send an EAP-Identity/Response using RADIUS from a trusted client"}]}].
  
  identity_radius_trusted(Config) ->
  	Socket = ?config(socket, Config),
  