 		/**
 		 * Construct the response as described by DIGEST-MD5 documentation.
 		 */
-		private function formatResponse( map:URLVariables ):String
+		private function formatResponse( map:Dictionary ):String
 		{
 			var md5:MD5 = new MD5();
 

	import com.hurlant.util.Base64;
	import com.hurlant.util.Hex;

	import flash.net.URLVariables;
	import flash.utils.ByteArray;

	import org.igniterealtime.xiff.core.XMPPConnection;


		override public function handleChallenge( stage:int, challenge:XML ):XML
		{
			var decodedChallenge:String = Base64.decode( challenge );
			var challengeKeyValuePairs:Array = decodedChallenge.replace( /\"/g, "").split( "," );
			var challengeMap:Dictionary = new Dictionary();
			for each( var keyValuePair:String in challengeKeyValuePairs )
			{
				var keyValue:Array = keyValuePair.split( "=" );
				challengeMap[ keyValue[ 0 ] ] = keyValue[ 1 ];
			}

			var resp:XML = response;
			resp.setNamespace( DigestMD5.NS );

			if( !challengeMap.rspauth )
			{
				var responseMap:Dictionary = new Dictionary();
				responseMap.username = connection.username;
				responseMap.realm = challengeMap.realm ? challengeMap.realm : "";
				responseMap.nonce = challengeMap.nonce;
				responseMap.cnonce = new Date().time;
				responseMap.nc = "00000001";
				responseMap.qop = challengeMap.qop ? challengeMap.qop : "auth";
				responseMap[ "digest-uri" ] = "xmpp/" + ( challengeMap.realm ? challengeMap.realm : connection.domain );
				responseMap.charset = challengeMap.charset;
				responseMap.response = formatResponse( responseMap );

				var challengeResponse:String = "username=\"" + responseMap.username + "\"";
				if( challengeMap.realm ) challengeResponse += ",realm=\"" + responseMap.realm + "\"";
				challengeResponse += ",nonce=\"" + responseMap.nonce + "\"";
				challengeResponse += ",cnonce=\"" + responseMap.cnonce + "\"";
				challengeResponse += ",nc=" + responseMap.nc;
				challengeResponse += ",qop=" + responseMap.qop;
				challengeResponse += ",digest-uri=\"" + responseMap[ "digest-uri" ] + "\"";
				challengeResponse += ",response=" + responseMap.response;
				challengeResponse += ",charset=" + responseMap.charset;
				challengeResponse = Base64.encode( challengeResponse );

				resp.setChildren( challengeResponse );
			}

			return resp;
		}

