diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-03-05 16:04:35 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-03-05 16:04:35 -0800 |
commit | c282f35b8ccab78f6782d17c4ffab2b1ed96e5d2 (patch) | |
tree | e3c41cfcd6bb9c905b2648ea08cda7ca0c6edd4a /src/DotNetOpenAuth.Test/Mocks | |
parent | f02074e93cd1a1bd8b5b013c51fe26c0fb332bc6 (diff) | |
download | DotNetOpenAuth-c282f35b8ccab78f6782d17c4ffab2b1ed96e5d2.zip DotNetOpenAuth-c282f35b8ccab78f6782d17c4ffab2b1ed96e5d2.tar.gz DotNetOpenAuth-c282f35b8ccab78f6782d17c4ffab2b1ed96e5d2.tar.bz2 |
Added OpenID Provider downlevel protection for 1.x Relying Parties and turning it on by default.
Diffstat (limited to 'src/DotNetOpenAuth.Test/Mocks')
3 files changed, 18 insertions, 18 deletions
diff --git a/src/DotNetOpenAuth.Test/Mocks/MockReplayProtectionBindingElement.cs b/src/DotNetOpenAuth.Test/Mocks/MockReplayProtectionBindingElement.cs index 11d7e67..bde8380 100644 --- a/src/DotNetOpenAuth.Test/Mocks/MockReplayProtectionBindingElement.cs +++ b/src/DotNetOpenAuth.Test/Mocks/MockReplayProtectionBindingElement.cs @@ -23,17 +23,17 @@ namespace DotNetOpenAuth.Test.Mocks { /// </summary> public Channel Channel { get; set; } - bool IChannelBindingElement.PrepareMessageForSending(IProtocolMessage message) { + MessageProtections? IChannelBindingElement.PrepareMessageForSending(IProtocolMessage message) { var replayMessage = message as IReplayProtectedProtocolMessage; if (replayMessage != null) { replayMessage.Nonce = "someNonce"; - return true; + return MessageProtections.ReplayProtection; } - return false; + return null; } - bool IChannelBindingElement.PrepareMessageForReceiving(IProtocolMessage message) { + MessageProtections? IChannelBindingElement.PrepareMessageForReceiving(IProtocolMessage message) { var replayMessage = message as IReplayProtectedProtocolMessage; if (replayMessage != null) { Assert.AreEqual("someNonce", replayMessage.Nonce, "The nonce didn't serialize correctly, or something"); @@ -42,10 +42,10 @@ namespace DotNetOpenAuth.Test.Mocks { throw new ReplayedMessageException(message); } this.messageReceived = true; - return true; + return MessageProtections.ReplayProtection; } - return false; + return null; } #endregion diff --git a/src/DotNetOpenAuth.Test/Mocks/MockSigningBindingElement.cs b/src/DotNetOpenAuth.Test/Mocks/MockSigningBindingElement.cs index 7056d2c..803e471 100644 --- a/src/DotNetOpenAuth.Test/Mocks/MockSigningBindingElement.cs +++ b/src/DotNetOpenAuth.Test/Mocks/MockSigningBindingElement.cs @@ -26,26 +26,26 @@ namespace DotNetOpenAuth.Test.Mocks { /// </summary> public Channel Channel { get; set; } - bool IChannelBindingElement.PrepareMessageForSending(IProtocolMessage message) { + MessageProtections? IChannelBindingElement.PrepareMessageForSending(IProtocolMessage message) { ITamperResistantProtocolMessage signedMessage = message as ITamperResistantProtocolMessage; if (signedMessage != null) { signedMessage.Signature = MessageSignature; - return true; + return MessageProtections.TamperProtection; } - return false; + return null; } - bool IChannelBindingElement.PrepareMessageForReceiving(IProtocolMessage message) { + MessageProtections? IChannelBindingElement.PrepareMessageForReceiving(IProtocolMessage message) { ITamperResistantProtocolMessage signedMessage = message as ITamperResistantProtocolMessage; if (signedMessage != null) { if (signedMessage.Signature != MessageSignature) { throw new InvalidSignatureException(message); } - return true; + return MessageProtections.TamperProtection; } - return false; + return null; } #endregion diff --git a/src/DotNetOpenAuth.Test/Mocks/MockTransformationBindingElement.cs b/src/DotNetOpenAuth.Test/Mocks/MockTransformationBindingElement.cs index 7a69a2d..4006f65 100644 --- a/src/DotNetOpenAuth.Test/Mocks/MockTransformationBindingElement.cs +++ b/src/DotNetOpenAuth.Test/Mocks/MockTransformationBindingElement.cs @@ -34,25 +34,25 @@ namespace DotNetOpenAuth.Test.Mocks { /// </summary> public Channel Channel { get; set; } - bool IChannelBindingElement.PrepareMessageForSending(IProtocolMessage message) { + MessageProtections? IChannelBindingElement.PrepareMessageForSending(IProtocolMessage message) { var testMessage = message as TestMessage; if (testMessage != null) { testMessage.Name = this.transform + testMessage.Name; - return true; + return MessageProtections.None; } - return false; + return null; } - bool IChannelBindingElement.PrepareMessageForReceiving(IProtocolMessage message) { + MessageProtections? IChannelBindingElement.PrepareMessageForReceiving(IProtocolMessage message) { var testMessage = message as TestMessage; if (testMessage != null) { StringAssert.StartsWith(testMessage.Name, this.transform); testMessage.Name = testMessage.Name.Substring(this.transform.Length); - return true; + return MessageProtections.None; } - return false; + return null; } #endregion |