diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-05-11 16:40:05 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-05-11 16:47:00 -0700 |
commit | 4cecb9a70ed347494450dc24d78cbf6642d593f8 (patch) | |
tree | 18442fd9ced4c6c20e07d9d9b6cdd45bb5b12b47 /src/DotNetOpenAuth/OAuth/ChannelElements/SigningBindingElementBase.cs | |
parent | f86c314f8c5629af776425b0c1bcb3af21b5d745 (diff) | |
download | DotNetOpenAuth-4cecb9a70ed347494450dc24d78cbf6642d593f8.zip DotNetOpenAuth-4cecb9a70ed347494450dc24d78cbf6642d593f8.tar.gz DotNetOpenAuth-4cecb9a70ed347494450dc24d78cbf6642d593f8.tar.bz2 |
Fixes OpenID and OAuth URL data string encoding to follow RFC 3986 instead of RFC 2396.
While this probably won't fix any interop issues with OpenID, it IS anticipated to fix interop issues with OAuth since the generated signature base string will be different if any of these symbols show up in the string: !*'()
Diffstat (limited to 'src/DotNetOpenAuth/OAuth/ChannelElements/SigningBindingElementBase.cs')
-rw-r--r-- | src/DotNetOpenAuth/OAuth/ChannelElements/SigningBindingElementBase.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/DotNetOpenAuth/OAuth/ChannelElements/SigningBindingElementBase.cs b/src/DotNetOpenAuth/OAuth/ChannelElements/SigningBindingElementBase.cs index 9910497..6991818 100644 --- a/src/DotNetOpenAuth/OAuth/ChannelElements/SigningBindingElementBase.cs +++ b/src/DotNetOpenAuth/OAuth/ChannelElements/SigningBindingElementBase.cs @@ -177,8 +177,8 @@ namespace DotNetOpenAuth.OAuth.ChannelElements { if (message.Recipient.Query != null) { NameValueCollection nvc = HttpUtility.ParseQueryString(message.Recipient.Query); foreach (string key in nvc) { - string escapedKey = Uri.EscapeDataString(key); - string escapedValue = Uri.EscapeDataString(nvc[key]); + string escapedKey = MessagingUtilities.EscapeUriDataStringRfc3986(key); + string escapedValue = MessagingUtilities.EscapeUriDataStringRfc3986(nvc[key]); string existingValue; if (!encodedDictionary.TryGetValue(escapedKey, out existingValue)) { encodedDictionary.Add(escapedKey, escapedValue); @@ -215,7 +215,7 @@ namespace DotNetOpenAuth.OAuth.ChannelElements { signatureBaseString.Append("&"); } - signatureBaseString.Append(Uri.EscapeDataString(element)); + signatureBaseString.Append(MessagingUtilities.EscapeUriDataStringRfc3986(element)); } Logger.Bindings.DebugFormat("Constructed signature base string: {0}", signatureBaseString); @@ -230,11 +230,11 @@ namespace DotNetOpenAuth.OAuth.ChannelElements { protected static string GetConsumerAndTokenSecretString(ITamperResistantOAuthMessage message) { StringBuilder builder = new StringBuilder(); if (!string.IsNullOrEmpty(message.ConsumerSecret)) { - builder.Append(Uri.EscapeDataString(message.ConsumerSecret)); + builder.Append(MessagingUtilities.EscapeUriDataStringRfc3986(message.ConsumerSecret)); } builder.Append("&"); if (!string.IsNullOrEmpty(message.TokenSecret)) { - builder.Append(Uri.EscapeDataString(message.TokenSecret)); + builder.Append(MessagingUtilities.EscapeUriDataStringRfc3986(message.TokenSecret)); } return builder.ToString(); } |