summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth.Test/Messaging/Reflection/MessageDictionaryTests.cs6
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/Extensions/AttributeExchange/AttributeExchangeRoundtripTests.cs4
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs4
-rw-r--r--src/DotNetOpenAuth/DotNetOpenAuth.csproj9
-rw-r--r--src/DotNetOpenAuth/InfoCard/ReceivedTokenEventArgs.cs2
-rw-r--r--src/DotNetOpenAuth/InfoCard/ReceivingTokenEventArgs.cs2
-rw-r--r--src/DotNetOpenAuth/InfoCard/Token/Token.cs25
-rw-r--r--src/DotNetOpenAuth/InfoCard/Token/TokenDecryptor.cs2
-rw-r--r--src/DotNetOpenAuth/InfoCard/TokenProcessingErrorEventArgs.cs2
-rw-r--r--src/DotNetOpenAuth/Messaging/Channel.cs28
-rw-r--r--src/DotNetOpenAuth/Messaging/EmptyDictionary.cs2
-rw-r--r--src/DotNetOpenAuth/Messaging/EmptyList.cs2
-rw-r--r--src/DotNetOpenAuth/Messaging/EnumerableCache.cs2
-rw-r--r--src/DotNetOpenAuth/Messaging/ErrorUtilities.cs5
-rw-r--r--src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs22
-rw-r--r--src/DotNetOpenAuth/Messaging/MessageSerializer.cs2
-rw-r--r--src/DotNetOpenAuth/Messaging/MultipartPostPart.cs2
-rw-r--r--src/DotNetOpenAuth/Messaging/Reflection/MessageDescription.cs4
-rw-r--r--src/DotNetOpenAuth/Messaging/Reflection/MessageDictionary.cs2
-rw-r--r--src/DotNetOpenAuth/OpenId/Association.cs2
-rw-r--r--src/DotNetOpenAuth/OpenId/Associations.cs2
-rw-r--r--src/DotNetOpenAuth/OpenId/DiffieHellman/DiffieHellmanManaged.cs2
-rw-r--r--src/DotNetOpenAuth/OpenId/Extensions/ExtensionsInteropHelper.cs2
-rw-r--r--src/DotNetOpenAuth/OpenId/Provider/PrivatePersonalIdentifierProviderBase.cs2
-rw-r--r--src/DotNetOpenAuth/OpenId/Realm.cs24
-rw-r--r--src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs17
26 files changed, 93 insertions, 85 deletions
diff --git a/src/DotNetOpenAuth.Test/Messaging/Reflection/MessageDictionaryTests.cs b/src/DotNetOpenAuth.Test/Messaging/Reflection/MessageDictionaryTests.cs
index 24171e1..b9e7436 100644
--- a/src/DotNetOpenAuth.Test/Messaging/Reflection/MessageDictionaryTests.cs
+++ b/src/DotNetOpenAuth.Test/Messaging/Reflection/MessageDictionaryTests.cs
@@ -300,7 +300,7 @@ namespace DotNetOpenAuth.Test.Messaging.Reflection {
[TestMethod]
public void CopyTo() {
ICollection<KeyValuePair<string, string>> target = this.MessageDescriptions.GetAccessor(this.message);
- IDictionary<string, string> targetAsDictionary = ((IDictionary<string, string>)target);
+ IDictionary<string, string> targetAsDictionary = (IDictionary<string, string>)target;
KeyValuePair<string, string>[] array = new KeyValuePair<string, string>[target.Count + 1];
int arrayIndex = 1;
target.CopyTo(array, arrayIndex);
@@ -317,7 +317,7 @@ namespace DotNetOpenAuth.Test.Messaging.Reflection {
[TestMethod]
public void ContainsKeyValuePair() {
ICollection<KeyValuePair<string, string>> target = this.MessageDescriptions.GetAccessor(this.message);
- IDictionary<string, string> targetAsDictionary = ((IDictionary<string, string>)target);
+ IDictionary<string, string> targetAsDictionary = (IDictionary<string, string>)target;
Assert.IsFalse(target.Contains(new KeyValuePair<string, string>("age", "1")));
Assert.IsTrue(target.Contains(new KeyValuePair<string, string>("age", "0")));
@@ -333,7 +333,7 @@ namespace DotNetOpenAuth.Test.Messaging.Reflection {
[TestMethod]
public void ClearValues() {
MessageDictionary target = this.MessageDescriptions.GetAccessor(this.message);
- IDictionary<string, string> targetAsDictionary = ((IDictionary<string, string>)target);
+ IDictionary<string, string> targetAsDictionary = (IDictionary<string, string>)target;
this.message.Name = "Andrew";
this.message.Age = 15;
targetAsDictionary["extra"] = "value";
diff --git a/src/DotNetOpenAuth.Test/OpenId/Extensions/AttributeExchange/AttributeExchangeRoundtripTests.cs b/src/DotNetOpenAuth.Test/OpenId/Extensions/AttributeExchange/AttributeExchangeRoundtripTests.cs
index 1051092..fa05e94 100644
--- a/src/DotNetOpenAuth.Test/OpenId/Extensions/AttributeExchange/AttributeExchangeRoundtripTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/Extensions/AttributeExchange/AttributeExchangeRoundtripTests.cs
@@ -34,8 +34,8 @@ namespace DotNetOpenAuth.Test.OpenId.Extensions {
var request = new StoreRequest();
var newAttribute = new AttributeValues(
IncrementingAttribute,
- "val" + (incrementingAttributeValue++).ToString(),
- "val" + (incrementingAttributeValue++).ToString());
+ "val" + (this.incrementingAttributeValue++).ToString(),
+ "val" + (this.incrementingAttributeValue++).ToString());
request.Attributes.Add(newAttribute);
var successResponse = new StoreResponse();
diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs
index 8f53cdd..332b0b7 100644
--- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs
@@ -113,11 +113,11 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty {
var rp = CreateRelyingParty();
// First verify that delegating identifiers work
- Assert.IsTrue(AuthenticationRequest.Create(id, rp, realm, returnTo, false).Any(), "The delegating identifier should have not generated any results.");
+ Assert.IsTrue(AuthenticationRequest.Create(id, rp, this.realm, this.returnTo, false).Any(), "The delegating identifier should have not generated any results.");
// Now disable them and try again.
rp.SecuritySettings.RejectDelegatingIdentifiers = true;
- Assert.IsFalse(AuthenticationRequest.Create(id, rp, realm, returnTo, false).Any(), "The delegating identifier should have not generated any results.");
+ Assert.IsFalse(AuthenticationRequest.Create(id, rp, this.realm, this.returnTo, false).Any(), "The delegating identifier should have not generated any results.");
}
/// <summary>
diff --git a/src/DotNetOpenAuth/DotNetOpenAuth.csproj b/src/DotNetOpenAuth/DotNetOpenAuth.csproj
index 053861a..2995374 100644
--- a/src/DotNetOpenAuth/DotNetOpenAuth.csproj
+++ b/src/DotNetOpenAuth/DotNetOpenAuth.csproj
@@ -690,4 +690,11 @@ http://opensource.org/licenses/ms-pl.html
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\tools\DotNetOpenAuth.Versioning.targets" />
<Import Project="..\..\tools\JavascriptPacker.targets" />
-</Project> \ No newline at end of file
+ <PropertyGroup>
+ <CompileDependsOn>$(CompileDependsOn);CheckForCodeContracts</CompileDependsOn>
+ </PropertyGroup>
+ <Target Name="CheckForCodeContracts">
+ <Error Condition=" '$(CodeContractsImported)' != 'true' "
+ Text="This project requires Code Contracts. Please install from: http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx"/>
+ </Target>
+</Project>
diff --git a/src/DotNetOpenAuth/InfoCard/ReceivedTokenEventArgs.cs b/src/DotNetOpenAuth/InfoCard/ReceivedTokenEventArgs.cs
index 6c6a5af..f325ff9 100644
--- a/src/DotNetOpenAuth/InfoCard/ReceivedTokenEventArgs.cs
+++ b/src/DotNetOpenAuth/InfoCard/ReceivedTokenEventArgs.cs
@@ -34,7 +34,7 @@ namespace DotNetOpenAuth.InfoCard {
[SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Called by code contracts.")]
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
[ContractInvariantMethod]
- protected void ObjectInvariant() {
+ private void ObjectInvariant() {
Contract.Invariant(this.Token != null);
}
#endif
diff --git a/src/DotNetOpenAuth/InfoCard/ReceivingTokenEventArgs.cs b/src/DotNetOpenAuth/InfoCard/ReceivingTokenEventArgs.cs
index aaf734b..124f9f8 100644
--- a/src/DotNetOpenAuth/InfoCard/ReceivingTokenEventArgs.cs
+++ b/src/DotNetOpenAuth/InfoCard/ReceivingTokenEventArgs.cs
@@ -84,7 +84,7 @@ namespace DotNetOpenAuth.InfoCard {
[SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Called by code contracts.")]
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
[ContractInvariantMethod]
- protected void ObjectInvariant() {
+ private void ObjectInvariant() {
Contract.Invariant(this.TokenXml != null);
Contract.Invariant(this.DecryptingTokens != null);
}
diff --git a/src/DotNetOpenAuth/InfoCard/Token/Token.cs b/src/DotNetOpenAuth/InfoCard/Token/Token.cs
index 4656e3f..7fa9a95 100644
--- a/src/DotNetOpenAuth/InfoCard/Token/Token.cs
+++ b/src/DotNetOpenAuth/InfoCard/Token/Token.cs
@@ -199,19 +199,6 @@ namespace DotNetOpenAuth.InfoCard {
}
}
-#if CONTRACTS_FULL
- /// <summary>
- /// Verifies conditions that should be true for any valid state of this object.
- /// </summary>
- [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Called by code contracts.")]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
- [ContractInvariantMethod]
- protected void ObjectInvariant()
- {
- Contract.Invariant(this.AuthorizationContext != null);
- }
-#endif
-
/// <summary>
/// Determines whether the specified token XML is encrypted.
/// </summary>
@@ -224,6 +211,18 @@ namespace DotNetOpenAuth.InfoCard {
return tokenXmlReader.IsStartElement(TokenDecryptor.XmlEncryptionStrings.EncryptedData, TokenDecryptor.XmlEncryptionStrings.Namespace);
}
+#if CONTRACTS_FULL
+ /// <summary>
+ /// Verifies conditions that should be true for any valid state of this object.
+ /// </summary>
+ [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Called by code contracts.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
+ [ContractInvariantMethod]
+ private void ObjectInvariant() {
+ Contract.Invariant(this.AuthorizationContext != null);
+ }
+#endif
+
/// <summary>
/// Flattens the claims into a dictionary
/// </summary>
diff --git a/src/DotNetOpenAuth/InfoCard/Token/TokenDecryptor.cs b/src/DotNetOpenAuth/InfoCard/Token/TokenDecryptor.cs
index 2257f15..9424480 100644
--- a/src/DotNetOpenAuth/InfoCard/Token/TokenDecryptor.cs
+++ b/src/DotNetOpenAuth/InfoCard/Token/TokenDecryptor.cs
@@ -150,7 +150,7 @@ namespace DotNetOpenAuth.InfoCard {
[SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Called by code contracts.")]
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
[ContractInvariantMethod]
- protected void ObjectInvariant() {
+ private void ObjectInvariant() {
Contract.Invariant(this.Tokens != null);
}
#endif
diff --git a/src/DotNetOpenAuth/InfoCard/TokenProcessingErrorEventArgs.cs b/src/DotNetOpenAuth/InfoCard/TokenProcessingErrorEventArgs.cs
index 1b4a62d..0f17b63 100644
--- a/src/DotNetOpenAuth/InfoCard/TokenProcessingErrorEventArgs.cs
+++ b/src/DotNetOpenAuth/InfoCard/TokenProcessingErrorEventArgs.cs
@@ -41,7 +41,7 @@ namespace DotNetOpenAuth.InfoCard {
[SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Called by code contracts.")]
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
[ContractInvariantMethod]
- protected void ObjectInvariant() {
+ private void ObjectInvariant() {
Contract.Invariant(this.TokenXml != null);
Contract.Invariant(this.Exception != null);
}
diff --git a/src/DotNetOpenAuth/Messaging/Channel.cs b/src/DotNetOpenAuth/Messaging/Channel.cs
index 718fac8..ef6486a 100644
--- a/src/DotNetOpenAuth/Messaging/Channel.cs
+++ b/src/DotNetOpenAuth/Messaging/Channel.cs
@@ -1008,18 +1008,6 @@ namespace DotNetOpenAuth.Messaging {
this.incomingBindingElements.AddRange(incomingOrder);
}
-#if CONTRACTS_FULL
- /// <summary>
- /// Verifies conditions that should be true for any valid state of this object.
- /// </summary>
- [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Called by code contracts.")]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
- [ContractInvariantMethod]
- protected void ObjectInvariant() {
- Contract.Invariant(this.MessageDescriptions != null);
- }
-#endif
-
/// <summary>
/// Ensures a consistent and secure set of binding elements and
/// sorts them as necessary for a valid sequence of operations.
@@ -1069,8 +1057,8 @@ namespace DotNetOpenAuth.Messaging {
/// <param name="protection1">The first protection type to compare.</param>
/// <param name="protection2">The second protection type to compare.</param>
/// <returns>
- /// -1 if <paramref name="element1"/> should be applied to an outgoing message before <paramref name="element2"/>.
- /// 1 if <paramref name="element2"/> should be applied to an outgoing message before <paramref name="element1"/>.
+ /// -1 if <paramref name="protection1"/> should be applied to an outgoing message before <paramref name="protection2"/>.
+ /// 1 if <paramref name="protection2"/> should be applied to an outgoing message before <paramref name="protection1"/>.
/// 0 if it doesn't matter.
/// </returns>
private static int BindingElementOutgoingMessageApplicationOrder(MessageProtections protection1, MessageProtections protection2) {
@@ -1080,6 +1068,18 @@ namespace DotNetOpenAuth.Messaging {
return -((int)protection1).CompareTo((int)protection2); // descending flag ordinal order
}
+#if CONTRACTS_FULL
+ /// <summary>
+ /// Verifies conditions that should be true for any valid state of this object.
+ /// </summary>
+ [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Called by code contracts.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
+ [ContractInvariantMethod]
+ private void ObjectInvariant() {
+ Contract.Invariant(this.MessageDescriptions != null);
+ }
+#endif
+
/// <summary>
/// Verifies that all required message parts are initialized to values
/// prior to sending the message to a remote party.
diff --git a/src/DotNetOpenAuth/Messaging/EmptyDictionary.cs b/src/DotNetOpenAuth/Messaging/EmptyDictionary.cs
index 062fcf3..caf292a 100644
--- a/src/DotNetOpenAuth/Messaging/EmptyDictionary.cs
+++ b/src/DotNetOpenAuth/Messaging/EmptyDictionary.cs
@@ -198,7 +198,7 @@ namespace DotNetOpenAuth.Messaging {
/// -or-
/// The number of elements in the source <see cref="T:System.Collections.Generic.ICollection`1"/> is greater than the available space from <paramref name="arrayIndex"/> to the end of the destination <paramref name="array"/>.
/// -or-
- /// Type <paramref name="T"/> cannot be cast automatically to the type of the destination <paramref name="array"/>.
+ /// Type cannot be cast automatically to the type of the destination <paramref name="array"/>.
/// </exception>
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex) {
}
diff --git a/src/DotNetOpenAuth/Messaging/EmptyList.cs b/src/DotNetOpenAuth/Messaging/EmptyList.cs
index 2261684..ba918a4 100644
--- a/src/DotNetOpenAuth/Messaging/EmptyList.cs
+++ b/src/DotNetOpenAuth/Messaging/EmptyList.cs
@@ -159,7 +159,7 @@ namespace DotNetOpenAuth.Messaging {
/// -or-
/// The number of elements in the source <see cref="T:System.Collections.Generic.ICollection`1"/> is greater than the available space from <paramref name="arrayIndex"/> to the end of the destination <paramref name="array"/>.
/// -or-
- /// Type <paramref name="T"/> cannot be cast automatically to the type of the destination <paramref name="array"/>.
+ /// Type <typeparamref name="T"/> cannot be cast automatically to the type of the destination <paramref name="array"/>.
/// </exception>
public void CopyTo(T[] array, int arrayIndex) {
}
diff --git a/src/DotNetOpenAuth/Messaging/EnumerableCache.cs b/src/DotNetOpenAuth/Messaging/EnumerableCache.cs
index 6639de1..71825bc 100644
--- a/src/DotNetOpenAuth/Messaging/EnumerableCache.cs
+++ b/src/DotNetOpenAuth/Messaging/EnumerableCache.cs
@@ -135,7 +135,7 @@ namespace DotNetOpenAuth.Messaging {
private int cachePosition = -1;
/// <summary>
- /// Initializes a new instance of the <see cref="EnumerableCache&lt;T&gt;.EnumeratorCache"/> class.
+ /// Initializes a new instance of the <see cref="EnumeratorCache"/> class.
/// </summary>
/// <param name="parent">The parent cached enumerable whose GetEnumerator method is calling this constructor.</param>
internal EnumeratorCache(EnumerableCache<T> parent) {
diff --git a/src/DotNetOpenAuth/Messaging/ErrorUtilities.cs b/src/DotNetOpenAuth/Messaging/ErrorUtilities.cs
index b560fdc..1807f54 100644
--- a/src/DotNetOpenAuth/Messaging/ErrorUtilities.cs
+++ b/src/DotNetOpenAuth/Messaging/ErrorUtilities.cs
@@ -118,7 +118,7 @@ namespace DotNetOpenAuth.Messaging {
/// </summary>
/// <param name="condition">The condition to check.</param>
/// <param name="errorMessage">The message to include in the exception, if created.</param>
- /// <param name="args">The string formatting arguments for <paramref name="message"/>.</param>
+ /// <param name="args">The string formatting arguments for <paramref name="errorMessage"/>.</param>
/// <exception cref="NotSupportedException">Thrown if <paramref name="condition"/> evaluates to <c>false</c>.</exception>
[Pure]
internal static void VerifySupported(bool condition, string errorMessage, params object[] args) {
@@ -307,13 +307,12 @@ namespace DotNetOpenAuth.Messaging {
}
/// <summary>
- /// Verifies something about the argument supplied to a method.
+ /// Throws an <see cref="ArgumentException"/>.
/// </summary>
/// <param name="parameterName">Name of the parameter.</param>
/// <param name="message">The message to use in the exception if the condition is false.</param>
/// <param name="args">The string formatting arguments, if any.</param>
/// <returns>Never returns anything. It always throws.</returns>
- /// <exception cref="ArgumentException">Thrown if <paramref name="condition"/> evaluates to <c>false</c>.</exception>
[Pure]
internal static Exception ThrowArgumentNamed(string parameterName, string message, params object[] args) {
Contract.Requires<ArgumentNullException>(args != null);
diff --git a/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs b/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs
index 6c7f2f9..94990c8 100644
--- a/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs
+++ b/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs
@@ -362,17 +362,6 @@ namespace DotNetOpenAuth.Messaging {
return query;
}
-#if CONTRACTS_FULL
- /// <summary>
- /// Verifies conditions that should be true for any valid state of this object.
- /// </summary>
- [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Called by code contracts.")]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
- [ContractInvariantMethod]
- protected void ObjectInvariant() {
- }
-#endif
-
/// <summary>
/// Gets the public facing URL for the given incoming HTTP request.
/// </summary>
@@ -417,5 +406,16 @@ namespace DotNetOpenAuth.Messaging {
return headers;
}
+
+#if CONTRACTS_FULL
+ /// <summary>
+ /// Verifies conditions that should be true for any valid state of this object.
+ /// </summary>
+ [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Called by code contracts.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
+ [ContractInvariantMethod]
+ private void ObjectInvariant() {
+ }
+#endif
}
}
diff --git a/src/DotNetOpenAuth/Messaging/MessageSerializer.cs b/src/DotNetOpenAuth/Messaging/MessageSerializer.cs
index a21559e..ccda5d5 100644
--- a/src/DotNetOpenAuth/Messaging/MessageSerializer.cs
+++ b/src/DotNetOpenAuth/Messaging/MessageSerializer.cs
@@ -116,7 +116,7 @@ namespace DotNetOpenAuth.Messaging {
[SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Called by code contracts.")]
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
[ContractInvariantMethod]
- protected void ObjectInvariant() {
+ private void ObjectInvariant() {
Contract.Invariant(this.messageType != null);
}
#endif
diff --git a/src/DotNetOpenAuth/Messaging/MultipartPostPart.cs b/src/DotNetOpenAuth/Messaging/MultipartPostPart.cs
index 9cbf11b..7ef89a4 100644
--- a/src/DotNetOpenAuth/Messaging/MultipartPostPart.cs
+++ b/src/DotNetOpenAuth/Messaging/MultipartPostPart.cs
@@ -192,7 +192,7 @@ namespace DotNetOpenAuth.Messaging {
/// </summary>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
[ContractInvariantMethod]
- protected void Invariant() {
+ private void Invariant() {
Contract.Invariant(!string.IsNullOrEmpty(this.ContentDisposition));
Contract.Invariant(this.PartHeaders != null);
Contract.Invariant(this.ContentAttributes != null);
diff --git a/src/DotNetOpenAuth/Messaging/Reflection/MessageDescription.cs b/src/DotNetOpenAuth/Messaging/Reflection/MessageDescription.cs
index 738c2a3..5493ba6 100644
--- a/src/DotNetOpenAuth/Messaging/Reflection/MessageDescription.cs
+++ b/src/DotNetOpenAuth/Messaging/Reflection/MessageDescription.cs
@@ -128,7 +128,7 @@ namespace DotNetOpenAuth.Messaging.Reflection {
/// <param name="keys">The names of all parameters included in a message.</param>
/// <exception cref="ProtocolException">Thrown when required parts of a message are not in <paramref name="keys"/></exception>
private void EnsureRequiredMessagePartsArePresent(IEnumerable<string> keys) {
- var missingKeys = (from part in Mapping.Values
+ var missingKeys = (from part in this.Mapping.Values
where part.IsRequired && !keys.Contains(part.Name)
select part.Name).ToArray();
if (missingKeys.Length > 0) {
@@ -147,7 +147,7 @@ namespace DotNetOpenAuth.Messaging.Reflection {
/// <param name="partValues">A dictionary of key/value pairs that make up the serialized message.</param>
private void EnsureRequiredProtocolMessagePartsAreNotEmpty(IDictionary<string, string> partValues) {
string value;
- var emptyValuedKeys = (from part in Mapping.Values
+ var emptyValuedKeys = (from part in this.Mapping.Values
where !part.AllowEmpty && partValues.TryGetValue(part.Name, out value) && value != null && value.Length == 0
select part.Name).ToArray();
if (emptyValuedKeys.Length > 0) {
diff --git a/src/DotNetOpenAuth/Messaging/Reflection/MessageDictionary.cs b/src/DotNetOpenAuth/Messaging/Reflection/MessageDictionary.cs
index fedc136..49e30cb 100644
--- a/src/DotNetOpenAuth/Messaging/Reflection/MessageDictionary.cs
+++ b/src/DotNetOpenAuth/Messaging/Reflection/MessageDictionary.cs
@@ -393,7 +393,7 @@ namespace DotNetOpenAuth.Messaging.Reflection {
[SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Called by code contracts.")]
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
[ContractInvariantMethod]
- protected void ObjectInvariant() {
+ private void ObjectInvariant() {
Contract.Invariant(this.Message != null);
Contract.Invariant(this.Description != null);
}
diff --git a/src/DotNetOpenAuth/OpenId/Association.cs b/src/DotNetOpenAuth/OpenId/Association.cs
index 311ba58..62e91ec 100644
--- a/src/DotNetOpenAuth/OpenId/Association.cs
+++ b/src/DotNetOpenAuth/OpenId/Association.cs
@@ -290,7 +290,7 @@ namespace DotNetOpenAuth.OpenId {
[SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Called by code contracts.")]
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
[ContractInvariantMethod]
- protected void ObjectInvariant() {
+ private void ObjectInvariant() {
Contract.Invariant(!string.IsNullOrEmpty(this.Handle));
Contract.Invariant(this.TotalLifeLength > TimeSpan.Zero);
Contract.Invariant(this.SecretKey != null);
diff --git a/src/DotNetOpenAuth/OpenId/Associations.cs b/src/DotNetOpenAuth/OpenId/Associations.cs
index 4fd89c4..cf49d1c 100644
--- a/src/DotNetOpenAuth/OpenId/Associations.cs
+++ b/src/DotNetOpenAuth/OpenId/Associations.cs
@@ -119,7 +119,7 @@ namespace DotNetOpenAuth.OpenId {
[SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Called by code contracts.")]
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
[ContractInvariantMethod]
- protected void ObjectInvariant() {
+ private void ObjectInvariant() {
Contract.Invariant(this.associations != null);
}
#endif
diff --git a/src/DotNetOpenAuth/OpenId/DiffieHellman/DiffieHellmanManaged.cs b/src/DotNetOpenAuth/OpenId/DiffieHellman/DiffieHellmanManaged.cs
index 2535b0f..75787c3 100644
--- a/src/DotNetOpenAuth/OpenId/DiffieHellman/DiffieHellmanManaged.cs
+++ b/src/DotNetOpenAuth/OpenId/DiffieHellman/DiffieHellmanManaged.cs
@@ -162,7 +162,7 @@ namespace Org.Mentalis.Security.Cryptography {
/// Imports the specified <see cref="DHParameters"/>.
/// </summary>
/// <param name="parameters">The parameters for <see cref="DiffieHellman"/>.</param>
- /// <exception cref="CryptographicException"><paramref name="P"/> or <paramref name="G"/> is a null reference (<b>Nothing</b> in Visual Basic) -or- <paramref name="P"/> is not a prime number.</exception>
+ /// <exception cref="CryptographicException"><see cref="DHParameters.P">parameters.P</see> or <see cref="DHParameters.G">parameters.G</see> is a null reference (<b>Nothing</b> in Visual Basic) -or- <see cref="DHParameters.P">parameters.P</see> is not a prime number.</exception>
public override void ImportParameters(DHParameters parameters) {
if (parameters.P == null)
throw new CryptographicException("Missing P value.");
diff --git a/src/DotNetOpenAuth/OpenId/Extensions/ExtensionsInteropHelper.cs b/src/DotNetOpenAuth/OpenId/Extensions/ExtensionsInteropHelper.cs
index 9b166e3..9e7ccd2 100644
--- a/src/DotNetOpenAuth/OpenId/Extensions/ExtensionsInteropHelper.cs
+++ b/src/DotNetOpenAuth/OpenId/Extensions/ExtensionsInteropHelper.cs
@@ -35,7 +35,7 @@ namespace DotNetOpenAuth.OpenId.Extensions {
/// <remarks>
/// <para>If discovery on the user-supplied identifier yields hints regarding which
/// extensions and attribute formats the Provider supports, this method MAY ignore the
- /// <paramref name="attributeFormat"/> argument and accomodate the Provider to minimize
+ /// <paramref name="attributeFormats"/> argument and accomodate the Provider to minimize
/// the size of the request.</para>
/// <para>If the request does not carry an sreg extension, the method logs a warning but
/// otherwise quietly returns doing nothing.</para>
diff --git a/src/DotNetOpenAuth/OpenId/Provider/PrivatePersonalIdentifierProviderBase.cs b/src/DotNetOpenAuth/OpenId/Provider/PrivatePersonalIdentifierProviderBase.cs
index 260fc85..46e172c 100644
--- a/src/DotNetOpenAuth/OpenId/Provider/PrivatePersonalIdentifierProviderBase.cs
+++ b/src/DotNetOpenAuth/OpenId/Provider/PrivatePersonalIdentifierProviderBase.cs
@@ -213,7 +213,7 @@ namespace DotNetOpenAuth.OpenId.Provider {
/// </summary>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
[ContractInvariantMethod]
- protected void ObjectInvariant() {
+ private void ObjectInvariant() {
Contract.Invariant(this.Hasher != null);
Contract.Invariant(this.Encoder != null);
Contract.Invariant(this.BaseIdentifier != null);
diff --git a/src/DotNetOpenAuth/OpenId/Realm.cs b/src/DotNetOpenAuth/OpenId/Realm.cs
index fb0fbfb..600e6c0 100644
--- a/src/DotNetOpenAuth/OpenId/Realm.cs
+++ b/src/DotNetOpenAuth/OpenId/Realm.cs
@@ -418,18 +418,6 @@ namespace DotNetOpenAuth.OpenId {
return null;
}
-#if CONTRACTS_FULL
- /// <summary>
- /// Verifies conditions that should be true for any valid state of this object.
- /// </summary>
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
- [ContractInvariantMethod]
- protected void ObjectInvariant() {
- Contract.Invariant(this.uri != null);
- Contract.Invariant(this.uri.AbsoluteUri != null);
- }
-#endif
-
/// <summary>
/// Calls <see cref="UriBuilder.ToString"/> if the argument is non-null.
/// Otherwise throws <see cref="ArgumentNullException"/>.
@@ -450,5 +438,17 @@ namespace DotNetOpenAuth.OpenId {
// is safe: http://blog.nerdbank.net/2008/04/uriabsoluteuri-and-uritostring-are-not.html
return realmUriBuilder.ToString();
}
+
+#if CONTRACTS_FULL
+ /// <summary>
+ /// Verifies conditions that should be true for any valid state of this object.
+ /// </summary>
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")]
+ [ContractInvariantMethod]
+ private void ObjectInvariant() {
+ Contract.Invariant(this.uri != null);
+ Contract.Invariant(this.uri.AbsoluteUri != null);
+ }
+#endif
}
}
diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs
index cb50fa6..a4a60d1 100644
--- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs
+++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs
@@ -954,11 +954,10 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
req.AddExtension(extension);
}
- // Add state that needs to survive across the redirect.
- if (!this.Stateless) {
- req.SetUntrustedCallbackArgument(UsePersistentCookieCallbackKey, this.UsePersistentCookie.ToString());
- req.SetUntrustedCallbackArgument(ReturnToReceivingControlId, this.ClientID);
- }
+ // Add state that needs to survive across the redirect, but at this point
+ // only save those properties that are not expected to be changed by a
+ // LoggingIn event handler.
+ req.SetUntrustedCallbackArgument(ReturnToReceivingControlId, this.ClientID);
// Apply the control's association preference to this auth request, but only if
// it is less demanding (greater ordinal value) than the existing one.
@@ -969,6 +968,10 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
}
if (this.OnLoggingIn(req)) {
+ // We save this property after firing OnLoggingIn so that the host page can
+ // change its value and have that value saved.
+ req.SetUntrustedCallbackArgument(UsePersistentCookieCallbackKey, this.UsePersistentCookie.ToString());
+
yield return req;
}
}
@@ -1054,8 +1057,8 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
/// <summary>
/// Determines whether the specified objects are equal.
/// </summary>
- /// <param name="x">The first object of type <paramref name="T"/> to compare.</param>
- /// <param name="y">The second object of type <paramref name="T"/> to compare.</param>
+ /// <param name="x">The first object to compare.</param>
+ /// <param name="y">The second object to compare.</param>
/// <returns>
/// true if the specified objects are equal; otherwise, false.
/// </returns>