diff options
Diffstat (limited to 'src/DotNetOpenAuth.OpenId/OpenId/HmacShaAssociation.cs')
-rw-r--r-- | src/DotNetOpenAuth.OpenId/OpenId/HmacShaAssociation.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/HmacShaAssociation.cs b/src/DotNetOpenAuth.OpenId/OpenId/HmacShaAssociation.cs index d723756..6a681a0 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/HmacShaAssociation.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/HmacShaAssociation.cs @@ -161,7 +161,11 @@ namespace DotNetOpenAuth.OpenId { hashSizeInBits < securityRequirements.MinimumHashBitLength) { continue; } +#if !ExcludeDiffieHellman sessionType = DiffieHellmanUtilities.GetNameForSize(protocol, hashSizeInBits); +#else + sessionType = requireMatchingDHSessionType ? null : protocol.Args.SessionType.NoEncryption; +#endif if (requireMatchingDHSessionType && sessionType == null) { continue; } @@ -195,10 +199,14 @@ namespace DotNetOpenAuth.OpenId { return true; } +#if !ExcludeDiffieHellman // When there _is_ a DH session, it must match in hash length with the association type. int associationSecretLengthInBytes = GetSecretLength(protocol, associationType); int sessionHashLengthInBytes = DiffieHellmanUtilities.Lookup(protocol, sessionType).HashSize / 8; return associationSecretLengthInBytes == sessionHashLengthInBytes; +#else + return false; +#endif } /// <summary> |