summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2012-01-28 16:30:09 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2012-01-28 16:52:51 -0800
commitfc0c0e297798f12e556917dbb27f7966c181df10 (patch)
tree3ec686f8565713a0f320399a2a16feccff68147c
parent697715565590f15ab684613d468032563fa4f7ad (diff)
downloadDotNetOpenAuth-fc0c0e297798f12e556917dbb27f7966c181df10.zip
DotNetOpenAuth-fc0c0e297798f12e556917dbb27f7966c181df10.tar.gz
DotNetOpenAuth-fc0c0e297798f12e556917dbb27f7966c181df10.tar.bz2
Replaced explicit SHA* implementation references with generic ones that allows .config files to control which implementation to use.origin/v3.4
This allows FIPS-compliance requirements to be satisfied while using DotNetOpenAuth. Fixes #47
-rw-r--r--src/DotNetOpenAuth/OpenId/DiffieHellmanUtilities.cs8
-rw-r--r--src/DotNetOpenAuth/OpenId/HmacShaAssociation.cs8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/DotNetOpenAuth/OpenId/DiffieHellmanUtilities.cs b/src/DotNetOpenAuth/OpenId/DiffieHellmanUtilities.cs
index 249f1f3..7a92ed8 100644
--- a/src/DotNetOpenAuth/OpenId/DiffieHellmanUtilities.cs
+++ b/src/DotNetOpenAuth/OpenId/DiffieHellmanUtilities.cs
@@ -23,10 +23,10 @@ namespace DotNetOpenAuth.OpenId {
/// An array of known Diffie Hellman sessions, sorted by decreasing hash size.
/// </summary>
private static DHSha[] diffieHellmanSessionTypes = new List<DHSha> {
- new DHSha(new SHA512Managed(), protocol => protocol.Args.SessionType.DH_SHA512),
- new DHSha(new SHA384Managed(), protocol => protocol.Args.SessionType.DH_SHA384),
- new DHSha(new SHA256Managed(), protocol => protocol.Args.SessionType.DH_SHA256),
- new DHSha(new SHA1Managed(), protocol => protocol.Args.SessionType.DH_SHA1),
+ new DHSha(SHA512.Create(), protocol => protocol.Args.SessionType.DH_SHA512),
+ new DHSha(SHA384.Create(), protocol => protocol.Args.SessionType.DH_SHA384),
+ new DHSha(SHA256.Create(), protocol => protocol.Args.SessionType.DH_SHA256),
+ new DHSha(SHA1.Create(), protocol => protocol.Args.SessionType.DH_SHA1),
} .ToArray();
/// <summary>
diff --git a/src/DotNetOpenAuth/OpenId/HmacShaAssociation.cs b/src/DotNetOpenAuth/OpenId/HmacShaAssociation.cs
index edc08ee..95d72d2 100644
--- a/src/DotNetOpenAuth/OpenId/HmacShaAssociation.cs
+++ b/src/DotNetOpenAuth/OpenId/HmacShaAssociation.cs
@@ -35,22 +35,22 @@ namespace DotNetOpenAuth.OpenId {
new HmacSha {
CreateHasher = secretKey => new HMACSHA512(secretKey),
GetAssociationType = protocol => protocol.Args.SignatureAlgorithm.HMAC_SHA512,
- BaseHashAlgorithm = new SHA512Managed(),
+ BaseHashAlgorithm = SHA512.Create(),
},
new HmacSha {
CreateHasher = secretKey => new HMACSHA384(secretKey),
GetAssociationType = protocol => protocol.Args.SignatureAlgorithm.HMAC_SHA384,
- BaseHashAlgorithm = new SHA384Managed(),
+ BaseHashAlgorithm = SHA384.Create(),
},
new HmacSha {
CreateHasher = secretKey => new HMACSHA256(secretKey),
GetAssociationType = protocol => protocol.Args.SignatureAlgorithm.HMAC_SHA256,
- BaseHashAlgorithm = new SHA256Managed(),
+ BaseHashAlgorithm = SHA256.Create(),
},
new HmacSha {
CreateHasher = secretKey => new HMACSHA1(secretKey),
GetAssociationType = protocol => protocol.Args.SignatureAlgorithm.HMAC_SHA1,
- BaseHashAlgorithm = new SHA1Managed(),
+ BaseHashAlgorithm = SHA1.Create(),
},
} .ToArray();