diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2011-09-18 07:40:02 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2011-09-18 07:40:02 -0700 |
commit | cfe8dac81872ed4ba425864d550d66abcae581d2 (patch) | |
tree | 02908354efecbfb74caaf11538f6852148e74a53 /src/DotNetOpenAuth.OpenId/OpenId/ChannelElements | |
parent | d36e126e7daa6a0d106fa44692e931d489436bbf (diff) | |
download | DotNetOpenAuth-cfe8dac81872ed4ba425864d550d66abcae581d2.zip DotNetOpenAuth-cfe8dac81872ed4ba425864d550d66abcae581d2.tar.gz DotNetOpenAuth-cfe8dac81872ed4ba425864d550d66abcae581d2.tar.bz2 |
All product assemblies build without ccrewrite.exe now.
Diffstat (limited to 'src/DotNetOpenAuth.OpenId/OpenId/ChannelElements')
6 files changed, 12 insertions, 12 deletions
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ExtensionsBindingElement.cs b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ExtensionsBindingElement.cs index ace8d69..705f737 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ExtensionsBindingElement.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ExtensionsBindingElement.cs @@ -33,8 +33,8 @@ namespace DotNetOpenAuth.OpenId.ChannelElements { /// <param name="securitySettings">The security settings.</param> /// <param name="receiveUnsignedExtensions">Security setting for relying parties. Should be true for Providers.</param> internal ExtensionsBindingElement(IOpenIdExtensionFactory extensionFactory, SecuritySettings securitySettings, bool receiveUnsignedExtensions) { - Contract.Requires<ArgumentNullException>(extensionFactory != null); - Contract.Requires<ArgumentNullException>(securitySettings != null); + Requires.NotNull(extensionFactory, "extensionFactory"); + Requires.NotNull(securitySettings, "securitySettings"); this.ExtensionFactory = extensionFactory; this.receiveUnsignedExtensions = receiveUnsignedExtensions; @@ -238,7 +238,7 @@ namespace DotNetOpenAuth.OpenId.ChannelElements { /// A dictionary of message parts, including only signed parts when appropriate. /// </returns> private IDictionary<string, string> GetExtensionsDictionary(IProtocolMessage message, bool ignoreUnsigned) { - Contract.Requires<InvalidOperationException>(this.Channel != null); + Requires.ValidState(this.Channel != null); IndirectSignedResponse signedResponse = message as IndirectSignedResponse; if (signedResponse != null && ignoreUnsigned) { diff --git a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/KeyValueFormEncoding.cs b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/KeyValueFormEncoding.cs index 46c2139..1993cb4 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/KeyValueFormEncoding.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/KeyValueFormEncoding.cs @@ -101,7 +101,7 @@ namespace DotNetOpenAuth.OpenId.ChannelElements { /// </remarks> [SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times", Justification = "Not a problem for this type.")] public static byte[] GetBytes(IEnumerable<KeyValuePair<string, string>> keysAndValues) { - Contract.Requires<ArgumentNullException>(keysAndValues != null); + Requires.NotNull(keysAndValues, "keysAndValues"); using (MemoryStream ms = new MemoryStream()) { using (StreamWriter sw = new StreamWriter(ms, textEncoding)) { diff --git a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/OpenIdChannel.cs b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/OpenIdChannel.cs index cc49a95..a2a5c88 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/OpenIdChannel.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/OpenIdChannel.cs @@ -48,7 +48,7 @@ namespace DotNetOpenAuth.OpenId.ChannelElements { /// <param name="bindingElements">The binding elements to use in sending and receiving messages.</param> protected OpenIdChannel(IMessageFactory messageTypeProvider, IChannelBindingElement[] bindingElements) : base(messageTypeProvider, bindingElements) { - Contract.Requires<ArgumentNullException>(messageTypeProvider != null); + Requires.NotNull(messageTypeProvider, "messageTypeProvider"); // Customize the binding element order, since we play some tricks for higher // security and backward compatibility with older OpenID versions. diff --git a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ReturnToSignatureBindingElement.cs b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ReturnToSignatureBindingElement.cs index bc7b2a1..25a29bb 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ReturnToSignatureBindingElement.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ReturnToSignatureBindingElement.cs @@ -58,7 +58,7 @@ namespace DotNetOpenAuth.OpenId.ChannelElements { /// </summary> /// <param name="cryptoKeyStore">The crypto key store.</param> internal ReturnToSignatureBindingElement(ICryptoKeyStore cryptoKeyStore) { - Contract.Requires<ArgumentNullException>(cryptoKeyStore != null); + Requires.NotNull(cryptoKeyStore, "cryptoKeyStore"); this.cryptoKeyStore = cryptoKeyStore; } @@ -173,7 +173,7 @@ namespace DotNetOpenAuth.OpenId.ChannelElements { /// or other minor changes do not invalidate the signature. /// </remarks> private byte[] GetReturnToSignature(Uri returnTo, CryptoKey cryptoKey = null) { - Contract.Requires<ArgumentNullException>(returnTo != null); + Requires.NotNull(returnTo, "returnTo"); // Assemble the dictionary to sign, taking care to remove the signature itself // in order to accurately reproduce the original signature (which of course didn't include diff --git a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SigningBindingElement.cs b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SigningBindingElement.cs index f186adc..95a748e 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SigningBindingElement.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SigningBindingElement.cs @@ -120,9 +120,9 @@ namespace DotNetOpenAuth.OpenId.ChannelElements { /// <param name="association">The association to use to sign the message.</param> /// <returns>The calculated signature of the method.</returns> protected string GetSignature(ITamperResistantOpenIdMessage signedMessage, Association association) { - Contract.Requires<ArgumentNullException>(signedMessage != null); - Contract.Requires<ArgumentException>(!String.IsNullOrEmpty(signedMessage.SignedParameterOrder)); - Contract.Requires<ArgumentNullException>(association != null); + Requires.NotNull(signedMessage, "signedMessage"); + Requires.True(!String.IsNullOrEmpty(signedMessage.SignedParameterOrder), "signedMessage"); + Requires.NotNull(association, "association"); // Prepare the parts to sign, taking care to replace an openid.mode value // of check_authentication with its original id_res so the signature matches. diff --git a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SigningBindingElementContract.cs b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SigningBindingElementContract.cs index c46cd12..bf8b18d 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SigningBindingElementContract.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SigningBindingElementContract.cs @@ -45,7 +45,7 @@ namespace DotNetOpenAuth.OpenId.ChannelElements { /// The association to use to sign or verify the message. /// </returns> protected override Association GetAssociation(ITamperResistantOpenIdMessage signedMessage) { - Contract.Requires<ArgumentNullException>(signedMessage != null); + Requires.NotNull(signedMessage, "signedMessage"); throw new NotImplementedException(); } @@ -57,7 +57,7 @@ namespace DotNetOpenAuth.OpenId.ChannelElements { /// The referenced association; or <c>null</c> if such an association cannot be found. /// </returns> protected override Association GetSpecificAssociation(ITamperResistantOpenIdMessage signedMessage) { - Contract.Requires<ArgumentNullException>(signedMessage != null); + Requires.NotNull(signedMessage, "signedMessage"); throw new NotImplementedException(); } } |