dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Security/Cryptography


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Security/Cryptography HMACSHA1.cs,1.1,1.2 KeyedHashAlgorithm.cs,1.1,1.2 MACTripleDES.cs,1.1,1.2
Date: Wed, 27 Nov 2002 00:04:11 -0500

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Security/Cryptography
In directory subversions:/tmp/cvs-serv25947/runtime/System/Security/Cryptography

Modified Files:
        HMACSHA1.cs KeyedHashAlgorithm.cs MACTripleDES.cs 
Log Message:


Implement dispose logic for keyed hash algorithms.


Index: HMACSHA1.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Security/Cryptography/HMACSHA1.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** HMACSHA1.cs 7 Jul 2002 11:46:32 -0000       1.1
--- HMACSHA1.cs 27 Nov 2002 05:04:08 -0000      1.2
***************
*** 55,58 ****
--- 55,74 ----
                        }
  
+       // Destructor.
+       ~HMACSHA1()
+                       {
+                               Dispose(false);
+                       }
+ 
+       // Dispose this object.
+       protected override void Dispose(bool disposing)
+                       {
+                               if(alg != null)
+                               {
+                                       ((IDisposable)alg).Dispose();
+                               }
+                               base.Dispose(disposing);
+                       }
+ 
        // Initialize the key.  If it is 64 bytes or less, then use
        // it as-is.  Otherwise hash it down.

Index: KeyedHashAlgorithm.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Security/Cryptography/KeyedHashAlgorithm.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** KeyedHashAlgorithm.cs       7 Jul 2002 11:46:32 -0000       1.1
--- KeyedHashAlgorithm.cs       27 Nov 2002 05:04:08 -0000      1.2
***************
*** 35,38 ****
--- 35,54 ----
        protected KeyedHashAlgorithm() {}
  
+       // Destructor.
+       ~KeyedHashAlgorithm()
+                       {
+                               Dispose(false);
+                       }
+ 
+       // Dispose this object.
+       protected override void Dispose(bool disposing)
+                       {
+                               if(KeyValue != null)
+                               {
+                                       KeyValue.Initialize();
+                               }
+                               base.Dispose(disposing);
+                       }
+ 
        // Create an instance of the default keyed hash algorithm.
        public new static KeyedHashAlgorithm Create()

Index: MACTripleDES.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Security/Cryptography/MACTripleDES.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** MACTripleDES.cs     7 Jul 2002 11:46:32 -0000       1.1
--- MACTripleDES.cs     27 Nov 2002 05:04:08 -0000      1.2
***************
*** 62,66 ****
                                }
                                KeyValue = rgbKey;
!                               SetupAlgorithm(CryptoConfig.TripleDESDefault);
                        }
  
--- 62,91 ----
                                }
                                KeyValue = rgbKey;
!                               SetupAlgorithm(strTripleDES);
!                       }
! 
!       // Destructor.
!       ~MACTripleDES()
!                       {
!                               Dispose(false);
!                       }
! 
!       // Dispose this object.
!       protected override void Dispose(bool disposing)
!                       {
!                               if(stream != null)
!                               {
!                                       stream.Close();
!                                       stream = null;
!                               }
!                               if(block != null)
!                               {
!                                       block.Initialize();
!                               }
!                               if(alg != null)
!                               {
!                                       ((IDisposable)alg).Dispose();
!                               }
!                               base.Dispose(disposing);
                        }
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]