diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-11-18 07:34:24 -0800 |
---|---|---|
committer | Andrew <andrewarnott@gmail.com> | 2008-11-18 07:34:24 -0800 |
commit | 235b23ecb22cd8d8a9141b5d904eeb56c687a39c (patch) | |
tree | 2c50688e74c6204ebbccf9793276c90353e444e6 /src | |
parent | 587c9b421f3f0b3607662050c1b1546f203cc8f9 (diff) | |
download | DotNetOpenAuth-235b23ecb22cd8d8a9141b5d904eeb56c687a39c.zip DotNetOpenAuth-235b23ecb22cd8d8a9141b5d904eeb56c687a39c.tar.gz DotNetOpenAuth-235b23ecb22cd8d8a9141b5d904eeb56c687a39c.tar.bz2 |
Renamed ErrorUtilities.Verify to VerifyProtocol.
Diffstat (limited to 'src')
6 files changed, 13 insertions, 13 deletions
diff --git a/src/DotNetOpenAuth/Messaging/Channel.cs b/src/DotNetOpenAuth/Messaging/Channel.cs index 73dddb1..e6a8ed0 100644 --- a/src/DotNetOpenAuth/Messaging/Channel.cs +++ b/src/DotNetOpenAuth/Messaging/Channel.cs @@ -280,10 +280,10 @@ namespace DotNetOpenAuth.Messaging { public TRESPONSE Request<TRESPONSE>(IDirectedProtocolMessage request) where TRESPONSE : class, IProtocolMessage { IProtocolMessage response = this.Request(request); - ErrorUtilities.Verify(response != null, MessagingStrings.ExpectedMessageNotReceived, typeof(TRESPONSE)); + ErrorUtilities.VerifyProtocol(response != null, MessagingStrings.ExpectedMessageNotReceived, typeof(TRESPONSE)); var expectedResponse = response as TRESPONSE; - ErrorUtilities.Verify(expectedResponse != null, MessagingStrings.UnexpectedMessageReceived, typeof(TRESPONSE), response.GetType()); + ErrorUtilities.VerifyProtocol(expectedResponse != null, MessagingStrings.UnexpectedMessageReceived, typeof(TRESPONSE), response.GetType()); return expectedResponse; } @@ -302,7 +302,7 @@ namespace DotNetOpenAuth.Messaging { this.PrepareMessageForSending(request); Logger.DebugFormat("Sending request: {0}", request); var responseMessage = this.RequestInternal(request); - ErrorUtilities.Verify(responseMessage != null, MessagingStrings.ExpectedMessageNotReceived, typeof(IProtocolMessage).Name); + ErrorUtilities.VerifyProtocol(responseMessage != null, MessagingStrings.ExpectedMessageNotReceived, typeof(IProtocolMessage).Name); Logger.DebugFormat("Received message response: {0}", responseMessage); this.VerifyMessageAfterReceiving(responseMessage); diff --git a/src/DotNetOpenAuth/Messaging/ErrorUtilities.cs b/src/DotNetOpenAuth/Messaging/ErrorUtilities.cs index fb62c76..0ae766d 100644 --- a/src/DotNetOpenAuth/Messaging/ErrorUtilities.cs +++ b/src/DotNetOpenAuth/Messaging/ErrorUtilities.cs @@ -30,7 +30,7 @@ namespace DotNetOpenAuth.Messaging { /// <param name="faultedMessage">The message being processed that would be responsible for the exception if thrown.</param> /// <param name="errorMessage">The error message for the exception.</param> /// <param name="args">The string formatting arguments, if any.</param> - internal static void Verify(bool condition, IProtocolMessage faultedMessage, string errorMessage, params object[] args) { + internal static void VerifyProtocol(bool condition, IProtocolMessage faultedMessage, string errorMessage, params object[] args) { if (!condition) { throw new ProtocolException(string.Format(CultureInfo.CurrentCulture, errorMessage, args), faultedMessage); } @@ -42,7 +42,7 @@ namespace DotNetOpenAuth.Messaging { /// <param name="condition">True to do nothing; false to throw the exception.</param> /// <param name="message">The error message for the exception.</param> /// <param name="args">The string formatting arguments, if any.</param> - internal static void Verify(bool condition, string message, params object[] args) { + internal static void VerifyProtocol(bool condition, string message, params object[] args) { if (!condition) { throw new ProtocolException(string.Format( CultureInfo.CurrentCulture, diff --git a/src/DotNetOpenAuth/OpenId/DiffieHellmanUtilities.cs b/src/DotNetOpenAuth/OpenId/DiffieHellmanUtilities.cs index 55d8655..a93c824 100644 --- a/src/DotNetOpenAuth/OpenId/DiffieHellmanUtilities.cs +++ b/src/DotNetOpenAuth/OpenId/DiffieHellmanUtilities.cs @@ -41,7 +41,7 @@ namespace DotNetOpenAuth.OpenId { // We COULD use just First instead of FirstOrDefault, but we want to throw ProtocolException instead of InvalidOperationException. DHSha match = diffieHellmanSessionTypes.FirstOrDefault(dhsha => String.Equals(dhsha.GetName(protocol), sessionType, StringComparison.Ordinal)); - ErrorUtilities.Verify(match != null, OpenIdStrings.NoSessionTypeFound, sessionType, protocol.Version); + ErrorUtilities.VerifyProtocol(match != null, OpenIdStrings.NoSessionTypeFound, sessionType, protocol.Version); return match.Algorithm; } @@ -79,7 +79,7 @@ namespace DotNetOpenAuth.OpenId { byte[] sharedBlock = dh.DecryptKeyExchange(remotePublicKey); byte[] sharedBlockHash = hasher.ComputeHash(EnsurePositive(sharedBlock)); - ErrorUtilities.Verify(sharedBlockHash.Length == plainOrEncryptedSecret.Length, OpenIdStrings.AssociationSecretHashLengthMismatch, plainOrEncryptedSecret.Length, sharedBlockHash.Length); + ErrorUtilities.VerifyProtocol(sharedBlockHash.Length == plainOrEncryptedSecret.Length, OpenIdStrings.AssociationSecretHashLengthMismatch, plainOrEncryptedSecret.Length, sharedBlockHash.Length); byte[] secret = new byte[plainOrEncryptedSecret.Length]; for (int i = 0; i < plainOrEncryptedSecret.Length; i++) { diff --git a/src/DotNetOpenAuth/OpenId/HmacShaAssociation.cs b/src/DotNetOpenAuth/OpenId/HmacShaAssociation.cs index 6c2b2c6..845e209 100644 --- a/src/DotNetOpenAuth/OpenId/HmacShaAssociation.cs +++ b/src/DotNetOpenAuth/OpenId/HmacShaAssociation.cs @@ -60,7 +60,7 @@ namespace DotNetOpenAuth.OpenId { ErrorUtilities.VerifyArgumentNotNull(typeIdentity, "typeIdentity"); ErrorUtilities.VerifyNonZeroLength(handle, "handle"); ErrorUtilities.VerifyArgumentNotNull(secret, "secret"); - ErrorUtilities.Verify(secret.Length == typeIdentity.SecretLength, OpenIdStrings.AssociationSecretAndTypeLengthMismatch, secret.Length, typeIdentity.GetAssociationType(Protocol.Default)); + ErrorUtilities.VerifyProtocol(secret.Length == typeIdentity.SecretLength, OpenIdStrings.AssociationSecretAndTypeLengthMismatch, secret.Length, typeIdentity.GetAssociationType(Protocol.Default)); this.typeIdentity = typeIdentity; } @@ -80,7 +80,7 @@ namespace DotNetOpenAuth.OpenId { ErrorUtilities.VerifyArgumentNotNull(secret, "secret"); HmacSha match = hmacShaAssociationTypes.FirstOrDefault(sha => String.Equals(sha.GetAssociationType(protocol), associationType, StringComparison.Ordinal)); - ErrorUtilities.Verify(match != null, OpenIdStrings.NoAssociationTypeFoundByName, associationType); + ErrorUtilities.VerifyProtocol(match != null, OpenIdStrings.NoAssociationTypeFoundByName, associationType); return new HmacShaAssociation(match, handle, secret, totalLifeLength); } @@ -96,7 +96,7 @@ namespace DotNetOpenAuth.OpenId { ErrorUtilities.VerifyArgumentNotNull(secret, "secret"); HmacSha shaType = hmacShaAssociationTypes.FirstOrDefault(sha => sha.SecretLength == secret.Length); - ErrorUtilities.Verify(shaType != null, OpenIdStrings.NoAssociationTypeFoundByLength, secret.Length); + ErrorUtilities.VerifyProtocol(shaType != null, OpenIdStrings.NoAssociationTypeFoundByLength, secret.Length); return new HmacShaAssociation(shaType, handle, secret, totalLifeLength); } @@ -109,7 +109,7 @@ namespace DotNetOpenAuth.OpenId { /// <exception cref="ProtocolException">Thrown if no association can be found by the given name.</exception> public static int GetSecretLength(Protocol protocol, string associationType) { HmacSha match = hmacShaAssociationTypes.FirstOrDefault(shaType => String.Equals(shaType.GetAssociationType(protocol), associationType, StringComparison.Ordinal)); - ErrorUtilities.Verify(match != null, OpenIdStrings.NoAssociationTypeFoundByName, associationType); + ErrorUtilities.VerifyProtocol(match != null, OpenIdStrings.NoAssociationTypeFoundByName, associationType); return match.SecretLength; } diff --git a/src/DotNetOpenAuth/OpenId/Messages/AssociateRequest.cs b/src/DotNetOpenAuth/OpenId/Messages/AssociateRequest.cs index 9e4c533..1b885bf 100644 --- a/src/DotNetOpenAuth/OpenId/Messages/AssociateRequest.cs +++ b/src/DotNetOpenAuth/OpenId/Messages/AssociateRequest.cs @@ -55,7 +55,7 @@ namespace DotNetOpenAuth.OpenId.Messages { public override void EnsureValidMessage() { base.EnsureValidMessage(); - ErrorUtilities.Verify( + ErrorUtilities.VerifyProtocol( !string.Equals(this.SessionType, Protocol.Args.SessionType.NoEncryption, StringComparison.Ordinal) || this.Recipient.IsTransportSecure(), OpenIdStrings.NoEncryptionSessionRequiresHttps, this); diff --git a/src/DotNetOpenAuth/OpenId/Messages/AssociateUnencryptedRequest.cs b/src/DotNetOpenAuth/OpenId/Messages/AssociateUnencryptedRequest.cs index 836c893..ada1d32 100644 --- a/src/DotNetOpenAuth/OpenId/Messages/AssociateUnencryptedRequest.cs +++ b/src/DotNetOpenAuth/OpenId/Messages/AssociateUnencryptedRequest.cs @@ -37,7 +37,7 @@ namespace DotNetOpenAuth.OpenId.Messages { public override void EnsureValidMessage() { base.EnsureValidMessage(); - ErrorUtilities.Verify( + ErrorUtilities.VerifyProtocol( string.Equals(SessionType, Protocol.Args.SessionType.NoEncryption, StringComparison.Ordinal), MessagingStrings.UnexpectedMessagePartValueForConstant, GetType().Name, |