Return-Path: Delivered-To: apmail-incubator-lucene-net-commits-archive@minotaur.apache.org Received: (qmail 32663 invoked from network); 5 Aug 2009 17:46:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Aug 2009 17:46:27 -0000 Received: (qmail 11832 invoked by uid 500); 5 Aug 2009 17:46:35 -0000 Delivered-To: apmail-incubator-lucene-net-commits-archive@incubator.apache.org Received: (qmail 11780 invoked by uid 500); 5 Aug 2009 17:46:35 -0000 Mailing-List: contact lucene-net-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@incubator.apache.org Delivered-To: mailing list lucene-net-commits@incubator.apache.org Received: (qmail 11771 invoked by uid 99); 5 Aug 2009 17:46:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Aug 2009 17:46:35 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Aug 2009 17:46:24 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 88B172388857; Wed, 5 Aug 2009 17:46:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r801333 - in /incubator/lucene.net/trunk/C#/src/Lucene.Net: Store/FSDirectory.cs SupportClass.cs Date: Wed, 05 Aug 2009 17:46:03 -0000 To: lucene-net-commits@incubator.apache.org From: digy@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090805174603.88B172388857@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: digy Date: Wed Aug 5 17:46:03 2009 New Revision: 801333 URL: http://svn.apache.org/viewvc?rev=801333&view=rev Log: LUCENENET-175 for Lucene.Net 2.4.0 Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Store/FSDirectory.cs?rev=801333&r1=801332&r2=801333&view=diff ============================================================================== --- incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs (original) +++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs Wed Aug 5 17:46:03 2009 @@ -87,12 +87,18 @@ /// the getDirectory methods that take a /// lockFactory (for example, {@link #GetDirectory(String, LockFactory)}). /// - public static readonly System.String LOCK_DIR = SupportClass.AppSettings.Get("Lucene.Net.lockDir", System.IO.Path.GetTempPath()); + + //Deprecated. As of 2.1, LOCK_DIR is unused because the write.lock is now stored by default in the index directory. + //If you really want to store locks elsewhere you can create your own SimpleFSLockFactory (or NativeFSLockFactory, etc.) passing in your preferred lock directory. + //Then, pass this LockFactory instance to one of the getDirectory methods that take a lockFactory (for example, getDirectory(String, LockFactory)). + //public static readonly System.String LOCK_DIR = SupportClass.AppSettings.Get("Lucene.Net.lockDir", System.IO.Path.GetTempPath()); + + /// The default class which implements filesystem-based directories. private static System.Type IMPL; - - private static System.Security.Cryptography.MD5 DIGESTER; + + private static System.Security.Cryptography.HashAlgorithm DIGESTER; /// A buffer optionally used in renameTo method private byte[] buffer = null; @@ -972,7 +978,8 @@ { try { - DIGESTER = System.Security.Cryptography.MD5.Create(); + DIGESTER = SupportClass.Cryptography.GetHashAlgorithm(); + } catch (System.Exception e) { Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/SupportClass.cs?rev=801333&r1=801332&r2=801333&view=diff ============================================================================== --- incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs (original) +++ incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs Wed Aug 5 17:46:03 2009 @@ -1559,4 +1559,23 @@ } #endregion + public class Cryptography + { + static public bool FIPSCompliant = false; + + static public System.Security.Cryptography.HashAlgorithm GetHashAlgorithm() + { + if (FIPSCompliant) + { + //LUCENENET-175 + //No Assumptions should be made on the HashAlgorithm. It may change in time. + //SHA256 SHA384 SHA512 etc. + return System.Security.Cryptography.SHA1.Create(); + } + return System.Security.Cryptography.MD5.Create(); + } + } + + + }