Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.4k views
in .NET FTP by (120 points)
I've searched the forums and look at this thread: http://www.enterprisedt.com/forums/viewtopic.php?t=3513 which discusses the same issue that I'm having, however the response in the thread will not solve the problem I'm having. I've pared it down to the minimum amount of code required to reproduce the issue, and I've tried adding the various preferred settings to the connection to force it to use valid FIPS compliant algorithms:

        static void Main(string[] args)
        {
            try
            {
                SecureFTPConnection.LogFile = "log.txt";
                SecureFTPConnection.LogLevel = EnterpriseDT.Util.Debug.LogLevel.All;

                // Instantiate SecureFTPConnection
                var secureFtpConnection = new SecureFTPConnection();

                // set the license
                secureFtpConnection.LicenseOwner = licenseOwner;
                secureFtpConnection.LicenseKey = licenseKey;

                // setting server address and credentials
                secureFtpConnection.ServerAddress = serverAddress;
                secureFtpConnection.ServerPort = serverPort;
                secureFtpConnection.UserName = userName;
                secureFtpConnection.Password = password;

                // select explicit FTPS
                secureFtpConnection.Protocol = FileTransferProtocol.FTPSExplicit;

                // switch off server validation (unsafe - only do this when testing)
                secureFtpConnection.ServerValidation = SecureFTPServerValidationType.None;

                secureFtpConnection.AuthenticationMethod = EnterpriseDT.Net.Ssh.AuthenticationType.Password;
                secureFtpConnection.PreferredHostKeyAlgorithms = EnterpriseDT.Net.Ssh.SSHPublicKeyAlgorithm.RSA;
                secureFtpConnection.PreferredMACAlgorithms = EnterpriseDT.Net.Ssh.SSHMACAlgorithm.HMACSHA1;
                secureFtpConnection.PreferredCipherAlgorithms = EnterpriseDT.Net.Ssh.SSHCipherAlgorithm.AES256;
                secureFtpConnection.PreferredCompressionAlgorithms = EnterpriseDT.Net.Ssh.SSHCompressionAlgorithm.None;
                secureFtpConnection.PreferredKeyExchangeMethods = EnterpriseDT.Net.Ssh.SSHKeyExchangeMethod.DiffieHellmanGroup14Sha1;

                // connect
                secureFtpConnection.Connect();
                secureFtpConnection.GetFiles();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
            Console.WriteLine("done.");
        }


When I run this with the Local Security Policy of "System cryptography: Use FIPS compliant algorithsms for encryption, hashing, signing" disabled, It succeeds and I'm able to retrieve the list of files on the other side.

When I run this with that setting enabled, however, I get this exception:

System.InvalidOperationException occurred
Message=This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.
Source=mscorlib
StackTrace:
at System.Security.Cryptography.MD5CryptoServiceProvider..ctor()
at Tnp7CpMwCpy4S1oARTH.FIAh1EM4ZlSZiiyDoia..ctor(KtyoykMDynbxsuS2jaR recordLayer, 8JIXupmhZanuaAUbk3r options)
at hkDWr6mnAuIyu6vTMHY.05mLQWmHAH49al3OaDu..ctor(KtyoykMDynbxsuS2jaR recordLayer, 8JIXupmhZanuaAUbk3r options)
at DqRyRjMQnWfoAXGDcQ2.JABdNDMZ4nPH9MyYlu8..ctor(KtyoykMDynbxsuS2jaR recordLayer, 8JIXupmhZanuaAUbk3r options)
at 86JRhhmiYS9c6tNU0DY.By6phmm1imVTLcRpQDf..ctor(jF0xEIMsrACNjMnYZB2 controller, 8JIXupmhZanuaAUbk3r options)
at PFRKKrM0ZJKfrwE23Fr.jF0xEIMsrACNjMnYZB2..ctor(lbiIV3mEXEOuPZECODu parent, Socket socket, 8JIXupmhZanuaAUbk3r options)
at aWf7DCmq2riUcdwRSvR.lbiIV3mEXEOuPZECODu.6eowPxBoS(8JIXupmhZanuaAUbk3r )
at lJAaZc9TqqOnp4b5aZG.tUhoGq9J0ggO3fxUawX.1xv496eql(BaseSocket )
at lJAaZc9TqqOnp4b5aZG.tUhoGq9J0ggO3fxUawX.FvoKB15KO()
at EnterpriseDT.Net.Ftp.Ssl.SSLFTPClient.Auth(SSLFTPSSLVersion sslVersion, Boolean secureDataChannels)
at EnterpriseDT.Net.Ftp.Ssl.SSLFTPClient.Auth(SSLFTPSSLVersion sslVersion)
at EnterpriseDT.Net.Ftp.SecureFTPConnection.SecureConnection()
at EnterpriseDT.Net.Ftp.SecureFTPConnection.Connect()
at TestSecureFTP.Program.Main(String[] args) in C:\Users\xxxxxx\Documents\Visual Studio 2010\Projects\TestApplication\TestSecureFTP\Program.cs:line 50
InnerException:

This is using version 6.3.2.20 of the edtFTPnetPRO.dll.

I can provide a logfile output if that will help.

Any help you could offer would be appreciated. We don't expect FIPS compliance from the library, but we do need to be able to use it in such an environment.

Thanks!

1 Answer

0 votes
by (162k points)
In the other thread, they are using the SFTP protocol which you can make FIPS compliant.

Because you are using FTPS, which uses SSL/TLS, this isn't possible - MD5 is embedded as part of the SSL, TLS1.0 and TLS 1.1 protocols, which are what is supported by edtFTPnet/PRO.

TLS is actually FIPS compliant and is permitted to use MD5 (see FIPS 140-2 IG, D.8 [pg. 157, point (e)(1).]) , but your FIPS compliant mode simply disables MD5 which causes the problem.

At some point we will implement TLS 1.2, which will remove dependence on MD5.

Categories

...