aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs')
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs19
1 files changed, 14 insertions, 5 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs
index 081327e..20e619a 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs
@@ -167,7 +167,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
167 // 167 //
168 168
169 internal bool authenticated = false; 169 internal bool authenticated = false;
170 internal string scheme = null; 170 internal string scheme = Rest.Scheme;
171 internal string realm = Rest.Realm; 171 internal string realm = Rest.Realm;
172 internal string domain = null; 172 internal string domain = null;
173 internal string nonce = null; 173 internal string nonce = null;
@@ -287,11 +287,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
287 287
288 request = p_request; 288 request = p_request;
289 response = p_response; 289 response = p_response;
290 qprefix = p_qprefix; 290 qprefix = p_qprefix;
291 291
292 sbuilder.Length = 0; 292 sbuilder.Length = 0;
293 293
294 encoding = request.ContentEncoding; 294 encoding = request.ContentEncoding;
295
295 if (encoding == null) 296 if (encoding == null)
296 { 297 {
297 encoding = Rest.Encoding; 298 encoding = Rest.Encoding;
@@ -448,9 +449,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
448 449
449 if (realm != null) 450 if (realm != null)
450 { 451 {
451 sbuilder.Append(" realm=\""); 452 sbuilder.Append(" realm=");
453 sbuilder.Append(Rest.CS_DQUOTE);
452 sbuilder.Append(realm); 454 sbuilder.Append(realm);
453 sbuilder.Append("\""); 455 sbuilder.Append(Rest.CS_DQUOTE);
454 } 456 }
455 AddHeader(Rest.HttpHeaderWWWAuthenticate,sbuilder.ToString()); 457 AddHeader(Rest.HttpHeaderWWWAuthenticate,sbuilder.ToString());
456 } 458 }
@@ -677,7 +679,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
677 679
678 UserProfileData udata = Rest.UserServices.GetUserProfile(first, last); 680 UserProfileData udata = Rest.UserServices.GetUserProfile(first, last);
679 681
680 // If we don;t recognize the user id, perhaps it is god? 682 // If we don't recognize the user id, perhaps it is god?
681 683
682 if (udata == null) 684 if (udata == null)
683 return pass == Rest.GodKey; 685 return pass == Rest.GodKey;
@@ -800,6 +802,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
800 if (!authparms.ContainsKey("cnonce")) 802 if (!authparms.ContainsKey("cnonce"))
801 { 803 {
802 Rest.Log.WarnFormat("{0} Authentication failed: cnonce missing", MsgId); 804 Rest.Log.WarnFormat("{0} Authentication failed: cnonce missing", MsgId);
805 Fail(Rest.HttpStatusCodeBadRequest);
803 break; 806 break;
804 } 807 }
805 808
@@ -808,6 +811,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
808 if (!authparms.TryGetValue("nc", out nck) || nck == null) 811 if (!authparms.TryGetValue("nc", out nck) || nck == null)
809 { 812 {
810 Rest.Log.WarnFormat("{0} Authentication failed: cnonce counter missing", MsgId); 813 Rest.Log.WarnFormat("{0} Authentication failed: cnonce counter missing", MsgId);
814 Fail(Rest.HttpStatusCodeBadRequest);
811 break; 815 break;
812 } 816 }
813 817
@@ -820,6 +824,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
820 if (Rest.Hex2Int(ncl) >= Rest.Hex2Int(nck)) 824 if (Rest.Hex2Int(ncl) >= Rest.Hex2Int(nck))
821 { 825 {
822 Rest.Log.WarnFormat("{0} Authentication failed: bad cnonce counter", MsgId); 826 Rest.Log.WarnFormat("{0} Authentication failed: bad cnonce counter", MsgId);
827 Fail(Rest.HttpStatusCodeBadRequest);
823 break; 828 break;
824 } 829 }
825 cntable[nonce] = nck; 830 cntable[nonce] = nck;
@@ -840,11 +845,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
840 if (authparms.ContainsKey("cnonce")) 845 if (authparms.ContainsKey("cnonce"))
841 { 846 {
842 Rest.Log.WarnFormat("{0} Authentication failed: invalid cnonce", MsgId); 847 Rest.Log.WarnFormat("{0} Authentication failed: invalid cnonce", MsgId);
848 Fail(Rest.HttpStatusCodeBadRequest);
843 break; 849 break;
844 } 850 }
845 if (authparms.ContainsKey("nc")) 851 if (authparms.ContainsKey("nc"))
846 { 852 {
847 Rest.Log.WarnFormat("{0} Authentication failed: invalid cnonce counter[2]", MsgId); 853 Rest.Log.WarnFormat("{0} Authentication failed: invalid cnonce counter[2]", MsgId);
854 Fail(Rest.HttpStatusCodeBadRequest);
848 break; 855 break;
849 } 856 }
850 } 857 }
@@ -857,6 +864,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
857 while (false); 864 while (false);
858 865
859 } 866 }
867 else
868 Fail(Rest.HttpStatusCodeBadRequest);
860 869
861 } 870 }
862 871