anchor.diff:     [{userdata, [{doc, "Send an EAP-pwd-ID/Response to peer"}]}].
   
   pwd_id(Config) ->
  +	PeerId = <<"23456789">>,
  +	MAC = "bb:cc:dd:ee:ff:aa",
  +	PeerAuth = ocs:generate_password(),
  +	ok = ocs:add_subscriber(PeerId, PeerAuth, []),
   	Socket = ?config(socket, Config), 
   	{ok, Address} = application:get_env(ocs, radius_auth_addr),
   	{ok, Port} = application:get_env(ocs, radius_auth_port),
   	NasId = ?config(nas_id, Config),
  -	PeerId = ?config(peer_id, Config),
   	UserName = ct:get_config(radius_username),
   	Secret = ct:get_config(radius_shared_secret),
   	ReqAuth1 = radius:authenticator(),
  -	RadId = 1, EapId = 1,
  +	RadId = 2, EapId = 1,
   	ok = send_identity(Socket, Address, Port, NasId, UserName,
  -			Secret, PeerId, ReqAuth1, EapId, RadId),
  +			Secret, PeerId, MAC, ReqAuth1, EapId, RadId),
   	NextEapId = EapId + 1,
   	{NextEapId, _ServerID} = receive_id(Socket, Address,
   			Port, Secret, ReqAuth1, RadId),
   	ReqAuth2 = radius:authenticator(),
  +	Token = crypto:rand_bytes(4),
   	send_id(Socket, Address, Port, Secret,
  -			ReqAuth2, UserName, NasId, PeerId),
  +			ReqAuth2, UserName, NasId, PeerId, MAC, Token, NextEapId, RadId + 1),
   	{ok, {_Address, _Port, RespPacket1}} = gen_udp:recv(Socket, 0),
   	Response1 = radius:codec(RespPacket1),
   	#radius{code = ?AccessChallenge, attributes = Attributes} = Response1,
  
positive.code: %%  Internal functions
  %%---------------------------------------------------------------------
  
  send_identity(Socket, Address, Port, NasId,
  		UserName, Secret, PeerId, Auth, EapId, RadId) ->
  	A0 = radius_attributes:new(),
  	A1 = radius_attributes:add(?UserName, UserName, A0),
  	A2 = radius_attributes:add(?NasPort, 0, A1),
  	A3 = radius_attributes:add(?NasIdentifier, NasId, A2),
  	A4 = radius_attributes:add(?CallingStationId, "de:ad:be:ef:ca:fe", A3),
  	EapPacket  = #eap_packet{code = response, type = ?Identity,
  			identifier = EapId, data = PeerId},
  	EapMessage = ocs_eap_codec:eap_packet(EapPacket),
  	A5 = radius_attributes:add(?EAPMessage, EapMessage, A4),
  	A6 = radius_attributes:add(?MessageAuthenticator,
  			list_to_binary(lists:duplicate(16,0)), A5),
  	Request1 = #radius{code = ?AccessRequest, id = RadId,
  
negative.code: 			identity = ServerID} = ocs_eap_codec:eap_pwd_id(EapPwdData),
  	{EapId, ServerID}.
  
  send_id(Socket, Address, Port, Secret, Auth, UserName,
  		NasId, PeerId, MAC, Token, EapId, RadId) ->
  	EapPwdId = #eap_pwd_id{group_desc = 19, random_fun = 16#1, prf = 16#1,
  			token = Token, pwd_prep = none, identity = PeerId},
  	EapPwd = #eap_pwd{pwd_exch = id, data = ocs_eap_codec:eap_pwd_id(EapPwdId)},
  	EapPacket  = #eap_packet{code = response, type = ?PWD, identifier = EapId,
  			data = ocs_eap_codec:eap_pwd(EapPwd)},
  	EapMsg = ocs_eap_codec:eap_packet(EapPacket),
  	access_request(Socket, Address, Port, NasId,
  			UserName, Secret, MAC, Auth, RadId, EapMsg).
  
  send_commit(Socket, Address, Port, Secret, Auth, UserName,
  		NasId, PeerId, MAC, Token, PeerId, ServerID, Password, EapId, RadId) ->
  	Prand = crypto:rand_uniform(1, ?R),
  	PWE = ocs_eap_pwd:compute_pwe(Token, PeerId, ServerID, Password),
  	{ScalarP, ElementP} = ocs_eap_pwd:compute_scalar(<<Prand:256>>, PWE),
  	EapPwdCommit = #eap_pwd_commit{scalar = ScalarP, element = ElementP},
  	EapPwd = #eap_pwd{length = false, more = false, pwd_exch = commit,
  			data = ocs_eap_codec:eap_pwd_commit(EapPwdCommit)},
  	EapPacket = #eap_packet{code = response, type = ?PWD,
  			identifier = EapId, data = ocs_eap_codec:eap_pwd(EapPwd)},
  	EapMsg = ocs_eap_codec:eap_packet(EapPacket),
  	access_request(Socket, Address, Port, NasId,
  			UserName, Secret, MAC, Auth, RadId, EapMsg).
  
  