diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-11-11 21:40:29 -0800 |
---|---|---|
committer | Andrew <andrewarnott@gmail.com> | 2008-11-11 21:40:29 -0800 |
commit | 0be1e0b76d376f9d7095737cbf1decc336bd17a1 (patch) | |
tree | 48ea052fcb1c1aa42798422f8c6265ed92ae5739 /src | |
parent | 29ab7a9b0340ccfbf62ac562095d3058bfbbafba (diff) | |
download | DotNetOpenAuth-0be1e0b76d376f9d7095737cbf1decc336bd17a1.zip DotNetOpenAuth-0be1e0b76d376f9d7095737cbf1decc336bd17a1.tar.gz DotNetOpenAuth-0be1e0b76d376f9d7095737cbf1decc336bd17a1.tar.bz2 |
error checking.
Diffstat (limited to 'src')
-rw-r--r-- | src/DotNetOpenAuth/OpenId/Association.cs | 9 | ||||
-rw-r--r-- | src/DotNetOpenAuth/OpenId/HmacShaAssociation.cs | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/DotNetOpenAuth/OpenId/Association.cs b/src/DotNetOpenAuth/OpenId/Association.cs index 0ae4583..d18735f 100644 --- a/src/DotNetOpenAuth/OpenId/Association.cs +++ b/src/DotNetOpenAuth/OpenId/Association.cs @@ -35,12 +35,9 @@ namespace DotNetOpenAuth.OpenId { /// <param name="totalLifeLength">How long the association will be useful.</param> /// <param name="issued">When this association was originally issued by the Provider.</param> protected Association(string handle, byte[] secret, TimeSpan totalLifeLength, DateTime issued) { - if (string.IsNullOrEmpty(handle)) { - throw new ArgumentNullException("handle"); - } - if (secret == null) { - throw new ArgumentNullException("secret"); - } + ErrorUtilities.VerifyNonZeroLength(handle, "handle"); + ErrorUtilities.VerifyArgumentNotNull(secret, "secret"); + this.Handle = handle; this.SecretKey = secret; this.TotalLifeLength = totalLifeLength; diff --git a/src/DotNetOpenAuth/OpenId/HmacShaAssociation.cs b/src/DotNetOpenAuth/OpenId/HmacShaAssociation.cs index a43c1e9..6c2b2c6 100644 --- a/src/DotNetOpenAuth/OpenId/HmacShaAssociation.cs +++ b/src/DotNetOpenAuth/OpenId/HmacShaAssociation.cs @@ -58,6 +58,8 @@ namespace DotNetOpenAuth.OpenId { private HmacShaAssociation(HmacSha typeIdentity, string handle, byte[] secret, TimeSpan totalLifeLength) : base(handle, secret, totalLifeLength, DateTime.UtcNow) { 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)); this.typeIdentity = typeIdentity; |