summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/AssociationHandshakeTests.cs44
-rw-r--r--src/DotNetOpenAuth/OpenId/Protocol.cs8
2 files changed, 26 insertions, 26 deletions
diff --git a/src/DotNetOpenAuth.Test/OpenId/AssociationHandshakeTests.cs b/src/DotNetOpenAuth.Test/OpenId/AssociationHandshakeTests.cs
index 6209fac..054a149 100644
--- a/src/DotNetOpenAuth.Test/OpenId/AssociationHandshakeTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/AssociationHandshakeTests.cs
@@ -19,39 +19,31 @@ namespace DotNetOpenAuth.Test.OpenId {
}
[TestMethod]
- public void DHv2() {
- Protocol protocol = Protocol.V20;
- var opDescription = new ProviderEndpointDescription(new Uri("http://host"), protocol.Version);
- this.ParameterizedAssociationTest(
- opDescription,
- protocol.Args.SignatureAlgorithm.HMAC_SHA256);
+ public void AssociateUnencrypted() {
+ this.ParameterizedAssociationTest(new Uri("https://host"));
}
[TestMethod]
- public void DHv1() {
- Protocol protocol = Protocol.V11;
- var opDescription = new ProviderEndpointDescription(new Uri("http://host"), protocol.Version);
- this.ParameterizedAssociationTest(
- opDescription,
- protocol.Args.SignatureAlgorithm.HMAC_SHA1);
+ public void AssociateDiffieHellman() {
+ this.ParameterizedAssociationTest(new Uri("http://host"));
}
- [TestMethod]
- public void PTv2() {
- Protocol protocol = Protocol.V20;
- var opDescription = new ProviderEndpointDescription(new Uri("https://host"), protocol.Version);
- this.ParameterizedAssociationTest(
- opDescription,
- protocol.Args.SignatureAlgorithm.HMAC_SHA256);
+ [TestMethod, Ignore]
+ public void AssociateDiffieHellmanOverHttps() {
+ // TODO: test the RP and OP agreeing to use Diffie-Hellman over HTTPS.
+ throw new NotImplementedException();
}
- [TestMethod]
- public void PTv1() {
- Protocol protocol = Protocol.V11;
- var opDescription = new ProviderEndpointDescription(new Uri("https://host"), protocol.Version);
- this.ParameterizedAssociationTest(
- opDescription,
- protocol.Args.SignatureAlgorithm.HMAC_SHA1);
+ /// <summary>
+ /// Runs a parameterized association flow test using all supported OpenID versions.
+ /// </summary>
+ /// <param name="opEndpoint">The OP endpoint to simulate using.</param>
+ private void ParameterizedAssociationTest(Uri opEndpoint) {
+ foreach (Protocol protocol in Protocol.AllPracticalVersions) {
+ var endpoint = new ProviderEndpointDescription(opEndpoint, protocol.Version);
+ var associationType = protocol.Version.Major < 2 ? protocol.Args.SignatureAlgorithm.HMAC_SHA1 : protocol.Args.SignatureAlgorithm.HMAC_SHA256;
+ this.ParameterizedAssociationTest(endpoint, associationType);
+ }
}
/// <summary>
diff --git a/src/DotNetOpenAuth/OpenId/Protocol.cs b/src/DotNetOpenAuth/OpenId/Protocol.cs
index 1268925..77041cb 100644
--- a/src/DotNetOpenAuth/OpenId/Protocol.cs
+++ b/src/DotNetOpenAuth/OpenId/Protocol.cs
@@ -118,10 +118,18 @@ namespace DotNetOpenAuth.OpenId {
},
},
};
+
/// <summary>
/// A list of all supported OpenID versions, in order starting from newest version.
/// </summary>
public readonly static List<Protocol> AllVersions = new List<Protocol>() { V20, V11, V10 };
+
+ /// <summary>
+ /// A list of all supported OpenID versions, in order starting from newest version.
+ /// V1.1 and V1.0 are considered the same and only V1.1 is in the list.
+ /// </summary>
+ public readonly static List<Protocol> AllPracticalVersions = new List<Protocol>() { V20, V11 };
+
/// <summary>
/// The default (or most recent) supported version of the OpenID protocol.
/// </summary>