From f5b41b5c85dc2625123b00683a5baf2398d969e2 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Tue, 30 Dec 2014 03:41:58 -0800 Subject: [PATCH] WebDav Explorer code cleanup --- .../Entities/Rfc2898CryptographyParameters.cs | 16 -- .../Config/IWebDavAppConfig.cs | 1 - .../Config/WebDavAppConfigManager.cs | 2 - .../DirectoryEntryPropertyNameConstants.cs | 7 - .../Controllers/AccountController.cs | 9 - .../Controllers/FileSystemController.cs | 9 +- .../Cryptography/CryptoUtils.cs | 198 ++++++++++++++++++ .../Cryptography/Rfc2898Cryptography.cs | 62 ------ .../Rfc2898CryptographyProvider.cs | 19 -- .../WebDavExplorerAppModule.cs | 2 +- .../Models/WebDavPortalIdentity.cs | 40 ---- .../Views/Account/Login.cshtml | 2 +- .../Views/Shared/_Layout.cshtml | 2 +- .../WebsitePanel.WebDavPortal/Web.config | 11 +- .../Rfc2898CryptographyElement.cs | 32 --- ...DavExplorerConfigurationSettingsSection.cs | 7 - .../WebsitePanel.WebDavPortal.csproj | 7 +- 17 files changed, 210 insertions(+), 216 deletions(-) delete mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Config/Entities/Rfc2898CryptographyParameters.cs delete mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Constants/DirectoryEntryPropertyNameConstants.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Cryptography/CryptoUtils.cs delete mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Cryptography/Rfc2898Cryptography.cs delete mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/DependencyInjection/Rfc2898CryptographyProvider.cs delete mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/WebDavPortalIdentity.cs delete mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebConfigSections/Rfc2898CryptographyElement.cs diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Config/Entities/Rfc2898CryptographyParameters.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Config/Entities/Rfc2898CryptographyParameters.cs deleted file mode 100644 index 0cba3e5d..00000000 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Config/Entities/Rfc2898CryptographyParameters.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace WebsitePanel.WebDavPortal.Config.Entities -{ - public class Rfc2898CryptographyParameters : AbstractConfigCollection - { - public string PasswordHash { get; private set; } - public string SaltKey { get; private set; } - public string VIKey { get; private set; } - - public Rfc2898CryptographyParameters() - { - PasswordHash = ConfigSection.Rfc2898Cryptography.PasswordHash; - SaltKey = ConfigSection.Rfc2898Cryptography.SaltKey; - VIKey = ConfigSection.Rfc2898Cryptography.VIKey; - } - } -} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Config/IWebDavAppConfig.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Config/IWebDavAppConfig.cs index 2b35632a..1d326f6a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Config/IWebDavAppConfig.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Config/IWebDavAppConfig.cs @@ -8,7 +8,6 @@ namespace WebsitePanel.WebDavPortal.Config string ApplicationName { get; } ElementsRendering ElementsRendering { get; } WebsitePanelConstantUserParameters WebsitePanelConstantUserParameters { get; } - Rfc2898CryptographyParameters Rfc2898CryptographyParameters { get; } ConnectionStringsCollection ConnectionStrings { get; } SessionKeysCollection SessionKeys { get; } FileIconsDictionary FileIcons { get; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Config/WebDavAppConfigManager.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Config/WebDavAppConfigManager.cs index db14e37c..c7471a78 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Config/WebDavAppConfigManager.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Config/WebDavAppConfigManager.cs @@ -12,7 +12,6 @@ namespace WebsitePanel.WebDavPortal.Config private WebDavAppConfigManager() { _configSection = ((WebDavExplorerConfigurationSettingsSection) ConfigurationManager.GetSection(WebDavExplorerConfigurationSettingsSection.SectionName)); - Rfc2898CryptographyParameters = new Rfc2898CryptographyParameters(); WebsitePanelConstantUserParameters = new WebsitePanelConstantUserParameters(); ElementsRendering = new ElementsRendering(); ConnectionStrings = new ConnectionStringsCollection(); @@ -39,7 +38,6 @@ namespace WebsitePanel.WebDavPortal.Config public ElementsRendering ElementsRendering { get; private set; } public WebsitePanelConstantUserParameters WebsitePanelConstantUserParameters { get; private set; } - public Rfc2898CryptographyParameters Rfc2898CryptographyParameters { get; private set; } public ConnectionStringsCollection ConnectionStrings { get; private set; } public SessionKeysCollection SessionKeys { get; private set; } public FileIconsDictionary FileIcons { get; private set; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Constants/DirectoryEntryPropertyNameConstants.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Constants/DirectoryEntryPropertyNameConstants.cs deleted file mode 100644 index 83e5d7df..00000000 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Constants/DirectoryEntryPropertyNameConstants.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace WebsitePanel.WebDavPortal.Constants -{ - public static class DirectoryEntryPropertyNameConstants - { - public const string DistinguishedName = "distinguishedName"; - } -} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs index 8fcdf59d..6c824d15 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs @@ -41,14 +41,6 @@ namespace WebsitePanel.WebDavPortal.Controllers [HttpPost] public ActionResult Login(AccountModel model) { - //var ldapConnectionString = WebDavAppConfigManager.Instance.ConnectionStrings.LdapServer; - //if (ldapConnectionString == null || !Regex.IsMatch(ldapConnectionString, @"^LDAP://([\w-]+.)+[\w-]+(/[\w- ./?%&=])?$")) - // return View(new AccountModel { LdapError = "LDAP server address is invalid" }); - - //var principal = new WebDavPortalIdentity(model.Login, model.Password); - //bool isAuthenticated = principal.Identity.IsAuthenticated; - //var organizationId = principal.GetOrganizationId(); - AutheticationToServicesUsingWebsitePanelUser(); var exchangeAccount = ES.Services.ExchangeServer.GetAccountByAccountNameWithoutItemId(model.Login); var isAuthenticated = exchangeAccount != null && exchangeAccount.AccountPassword == model.Password; @@ -63,7 +55,6 @@ namespace WebsitePanel.WebDavPortal.Controllers { Session[WebDavAppConfigManager.Instance.SessionKeys.AccountInfo] = model; Session[WebDavAppConfigManager.Instance.SessionKeys.WebDavManager] = new WebDavManager(new NetworkCredential(model.Login, model.Password, WebDavAppConfigManager.Instance.UserDomain), exchangeAccount.ItemId); - //Session[WebDavAppConfigManager.Instance.SessionKeys.WebDavManager] = new WebDavManager(new NetworkCredential("Administrator", "WSP99cc$$1", WebDavAppConfigManager.Instance.UserDomain), exchangeAccount.ItemId); } catch (ConnectToWebDavServerException exception) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs index 1aab1374..c8d77ab4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs @@ -31,11 +31,6 @@ namespace WebsitePanel.WebDavPortal.Controllers if (org != webDavManager.OrganizationName) return new HttpStatusCodeResult(HttpStatusCode.NoContent); - - var test = Url.Action("ShowContent", "FileSystem"); - var tetet = Url.Action("ShowContent", "FileSystem", new { org = "pgrorg" }); - - string fileName = pathPart.Split('/').Last(); if (webDavManager.IsFile(fileName)) { @@ -52,7 +47,7 @@ namespace WebsitePanel.WebDavPortal.Controllers return View(model); } - catch (UnauthorizedException exc) + catch (UnauthorizedException) { throw new HttpException(404, "Not Found"); } @@ -81,7 +76,7 @@ namespace WebsitePanel.WebDavPortal.Controllers return PartialView("_ResourseCollectionPartial", result); } - return null; + return new HttpStatusCodeResult(HttpStatusCode.NoContent); ; } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Cryptography/CryptoUtils.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Cryptography/CryptoUtils.cs new file mode 100644 index 00000000..5251babd --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Cryptography/CryptoUtils.cs @@ -0,0 +1,198 @@ +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.IO; +using System.Linq; +using System.Security.Cryptography; +using System.Text; +using System.Web; + +namespace WebsitePanel.WebDavPortal.Cryptography +{ + public class CryptoUtils : ICryptography + { + private string EnterpriseServerRegistryPath = "SOFTWARE\\WebsitePanel\\EnterpriseServer"; + + private string CryptoKey + { + get + { + string Key = ConfigurationManager.AppSettings["WebsitePanel.AltCryptoKey"]; + string value = string.Empty; + + if (!string.IsNullOrEmpty(Key)) + { + RegistryKey root = Registry.LocalMachine; + RegistryKey rk = root.OpenSubKey(EnterpriseServerRegistryPath); + if (rk != null) + { + value = (string)rk.GetValue(Key, null); + rk.Close(); + } + } + + if (!string.IsNullOrEmpty(value)) + return value; + else + return ConfigurationManager.AppSettings["WebsitePanel.CryptoKey"]; + + } + } + + private bool EncryptionEnabled + { + get + { + return (ConfigurationManager.AppSettings["WebsitePanel.EncryptionEnabled"] != null) + ? Boolean.Parse(ConfigurationManager.AppSettings["WebsitePanel.EncryptionEnabled"]) : true; + } + } + + public string Encrypt(string InputText) + { + string Password = CryptoKey; + + if (!EncryptionEnabled) + return InputText; + + if (InputText == null) + return InputText; + + // We are now going to create an instance of the + // Rihndael class. + RijndaelManaged RijndaelCipher = new RijndaelManaged(); + + // First we need to turn the input strings into a byte array. + byte[] PlainText = System.Text.Encoding.Unicode.GetBytes(InputText); + + + // We are using salt to make it harder to guess our key + // using a dictionary attack. + byte[] Salt = Encoding.ASCII.GetBytes(Password.Length.ToString()); + + + // The (Secret Key) will be generated from the specified + // password and salt. + PasswordDeriveBytes SecretKey = new PasswordDeriveBytes(Password, Salt); + + + // Create a encryptor from the existing SecretKey bytes. + // We use 32 bytes for the secret key + // (the default Rijndael key length is 256 bit = 32 bytes) and + // then 16 bytes for the IV (initialization vector), + // (the default Rijndael IV length is 128 bit = 16 bytes) + ICryptoTransform Encryptor = RijndaelCipher.CreateEncryptor(SecretKey.GetBytes(32), SecretKey.GetBytes(16)); + + + // Create a MemoryStream that is going to hold the encrypted bytes + MemoryStream memoryStream = new MemoryStream(); + + + // Create a CryptoStream through which we are going to be processing our data. + // CryptoStreamMode.Write means that we are going to be writing data + // to the stream and the output will be written in the MemoryStream + // we have provided. (always use write mode for encryption) + CryptoStream cryptoStream = new CryptoStream(memoryStream, Encryptor, CryptoStreamMode.Write); + + // Start the encryption process. + cryptoStream.Write(PlainText, 0, PlainText.Length); + + + // Finish encrypting. + cryptoStream.FlushFinalBlock(); + + // Convert our encrypted data from a memoryStream into a byte array. + byte[] CipherBytes = memoryStream.ToArray(); + + + + // Close both streams. + memoryStream.Close(); + cryptoStream.Close(); + + + + // Convert encrypted data into a base64-encoded string. + // A common mistake would be to use an Encoding class for that. + // It does not work, because not all byte values can be + // represented by characters. We are going to be using Base64 encoding + // That is designed exactly for what we are trying to do. + string EncryptedData = Convert.ToBase64String(CipherBytes); + + + + // Return encrypted string. + return EncryptedData; + } + + public string Decrypt(string InputText) + { + try + { + if (!EncryptionEnabled) + return InputText; + + if (InputText == null || InputText == "") + return InputText; + + string Password = CryptoKey; + RijndaelManaged RijndaelCipher = new RijndaelManaged(); + + + byte[] EncryptedData = Convert.FromBase64String(InputText); + byte[] Salt = Encoding.ASCII.GetBytes(Password.Length.ToString()); + + + PasswordDeriveBytes SecretKey = new PasswordDeriveBytes(Password, Salt); + + // Create a decryptor from the existing SecretKey bytes. + ICryptoTransform Decryptor = RijndaelCipher.CreateDecryptor(SecretKey.GetBytes(32), SecretKey.GetBytes(16)); + + + MemoryStream memoryStream = new MemoryStream(EncryptedData); + + // Create a CryptoStream. (always use Read mode for decryption). + CryptoStream cryptoStream = new CryptoStream(memoryStream, Decryptor, CryptoStreamMode.Read); + + + // Since at this point we don't know what the size of decrypted data + // will be, allocate the buffer long enough to hold EncryptedData; + // DecryptedData is never longer than EncryptedData. + byte[] PlainText = new byte[EncryptedData.Length]; + + // Start decrypting. + int DecryptedCount = cryptoStream.Read(PlainText, 0, PlainText.Length); + + + memoryStream.Close(); + cryptoStream.Close(); + + // Convert decrypted data into a string. + string DecryptedData = Encoding.Unicode.GetString(PlainText, 0, DecryptedCount); + + + // Return decrypted string. + return DecryptedData; + } + catch + { + return ""; + } + } + + private string SHA1(string plainText) + { + // Convert plain text into a byte array. + byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText); + + HashAlgorithm hash = new SHA1Managed(); ; + + // Compute hash value of our plain text with appended salt. + byte[] hashBytes = hash.ComputeHash(plainTextBytes); + + // Return the result. + return Convert.ToBase64String(hashBytes); + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Cryptography/Rfc2898Cryptography.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Cryptography/Rfc2898Cryptography.cs deleted file mode 100644 index 6da98ce0..00000000 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Cryptography/Rfc2898Cryptography.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.IO; -using System.Security.Cryptography; -using System.Text; - -namespace WebsitePanel.WebDavPortal.Cryptography -{ - public class Rfc2898Cryptography : ICryptography - { - public string PasswordHash { get; set; } - public string SaltKey { get; set; } - public string VIKey { get; set; } - - public Rfc2898Cryptography(string passwordHash, string saltKey, string viKey) - { - PasswordHash = passwordHash; - SaltKey = saltKey; - VIKey = viKey; - } - - public string Encrypt(string plainText) - { - byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText); - - byte[] keyBytes = new Rfc2898DeriveBytes(PasswordHash, Encoding.ASCII.GetBytes(SaltKey)).GetBytes(256/8); - var symmetricKey = new RijndaelManaged {Mode = CipherMode.CBC, Padding = PaddingMode.Zeros}; - ICryptoTransform encryptor = symmetricKey.CreateEncryptor(keyBytes, Encoding.ASCII.GetBytes(VIKey)); - - byte[] cipherTextBytes; - - using (var memoryStream = new MemoryStream()) - { - using (var cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write)) - { - cryptoStream.Write(plainTextBytes, 0, plainTextBytes.Length); - cryptoStream.FlushFinalBlock(); - cipherTextBytes = memoryStream.ToArray(); - cryptoStream.Close(); - } - memoryStream.Close(); - } - return Convert.ToBase64String(cipherTextBytes); - } - - public string Decrypt(string encryptedText) - { - byte[] cipherTextBytes = Convert.FromBase64String(encryptedText); - byte[] keyBytes = new Rfc2898DeriveBytes(PasswordHash, Encoding.ASCII.GetBytes(SaltKey)).GetBytes(256/8); - var symmetricKey = new RijndaelManaged {Mode = CipherMode.CBC, Padding = PaddingMode.None}; - - ICryptoTransform decryptor = symmetricKey.CreateDecryptor(keyBytes, Encoding.ASCII.GetBytes(VIKey)); - var memoryStream = new MemoryStream(cipherTextBytes); - var cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read); - var plainTextBytes = new byte[cipherTextBytes.Length]; - - int decryptedByteCount = cryptoStream.Read(plainTextBytes, 0, plainTextBytes.Length); - memoryStream.Close(); - cryptoStream.Close(); - return Encoding.UTF8.GetString(plainTextBytes, 0, decryptedByteCount).TrimEnd("\0".ToCharArray()); - } - } -} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/DependencyInjection/Rfc2898CryptographyProvider.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/DependencyInjection/Rfc2898CryptographyProvider.cs deleted file mode 100644 index 1ef5b056..00000000 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/DependencyInjection/Rfc2898CryptographyProvider.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Ninject.Activation; -using WebsitePanel.WebDavPortal.Config; -using WebsitePanel.WebDavPortal.Cryptography; - -namespace WebsitePanel.WebDavPortal.DependencyInjection -{ - public class Rfc2898CryptographyProvider : Provider - { - protected override Rfc2898Cryptography CreateInstance(IContext context) - { - var rfc2898Cryptography = - new Rfc2898Cryptography(WebDavAppConfigManager.Instance.Rfc2898CryptographyParameters.PasswordHash, - WebDavAppConfigManager.Instance.Rfc2898CryptographyParameters.SaltKey, - WebDavAppConfigManager.Instance.Rfc2898CryptographyParameters.VIKey); - - return rfc2898Cryptography; - } - } -} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/DependencyInjection/WebDavExplorerAppModule.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/DependencyInjection/WebDavExplorerAppModule.cs index 67ed9d46..0029f886 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/DependencyInjection/WebDavExplorerAppModule.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/DependencyInjection/WebDavExplorerAppModule.cs @@ -13,7 +13,7 @@ namespace WebsitePanel.WebDavPortal.DependencyInjection Bind().ToConstant(HttpContext.Current.Session); Bind().ToProvider(); Bind().ToProvider(); - Bind().ToProvider(); + Bind().To(); } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/WebDavPortalIdentity.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/WebDavPortalIdentity.cs deleted file mode 100644 index 7622422c..00000000 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/WebDavPortalIdentity.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.DirectoryServices; -using System.Security.Principal; -using WebsitePanel.WebDavPortal.Constants; - -namespace WebsitePanel.WebDavPortal.Models -{ - public class WebDavPortalIdentity - { - private readonly DirectoryEntry _dictionaryEntry; - public IIdentity Identity { get; protected set; } - - public WebDavPortalIdentity(string userName, string password) : this(null, userName, password) - { - } - - public WebDavPortalIdentity(string path, string userName, string password) - { - _dictionaryEntry = new DirectoryEntry(path, userName, password); - Identity = new DirectoryIdentity(_dictionaryEntry); - } - - public object GetADObjectProperty(string name) - { - return _dictionaryEntry.Properties.Contains(name) ? _dictionaryEntry.Properties[name][0] : null; - } - - public string GetOrganizationId() - { - const string distinguishedName = "CN=user200000,OU=virt,OU=TESTOU,DC=test,DC=local"; - //string distinguishedName = GetADObjectProperty(DirectoryEntryPropertyNameConstants.DistinguishedName).ToString(); - - string[] distinguishedNameParts = distinguishedName.Split(',', '='); - if (distinguishedNameParts[2] != "OU") - throw new Exception(@"Problems with parsing 'distinguishedName' DirectoryEntry property"); - - return distinguishedNameParts[3]; - } - } -} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/Login.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/Login.cshtml index 42080dd1..75e22523 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/Login.cshtml +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/Login.cshtml @@ -7,7 +7,7 @@
-

Authentication on the LDAP server

+

Sign In

@if (Model != null && !string.IsNullOrEmpty(Model.LdapError)) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml index 691cbc26..6162ed3a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml @@ -28,7 +28,7 @@ var account = kernel.Get(); if (account != null) { - + } }
diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Web.config b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Web.config index 78bc3a7b..c8907459 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Web.config @@ -16,15 +16,16 @@ + + + + - + - - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebConfigSections/Rfc2898CryptographyElement.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebConfigSections/Rfc2898CryptographyElement.cs deleted file mode 100644 index 874fffaa..00000000 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebConfigSections/Rfc2898CryptographyElement.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Configuration; - -namespace WebsitePanel.WebDavPortal.WebConfigSections -{ - public class Rfc2898CryptographyElement : ConfigurationElement - { - private const string PasswordHashKey = "passwordHash"; - private const string SaltKeyKey = "saltKey"; - private const string ViKeyKey = "VIKey"; - - [ConfigurationProperty(PasswordHashKey, IsKey = true, IsRequired = true, DefaultValue = "66640c02dcdec47fb220539c1d47d80da5a98cd9c9fcebc317512db29a947e5c54667a85fdfdecfbde17ab76375bb9309e47025f7bb19a2c5df0c1be039d1c3d")] - public string PasswordHash - { - get { return this[PasswordHashKey].ToString(); } - set { this[PasswordHashKey] = value; } - } - - [ConfigurationProperty(SaltKeyKey, IsKey = true, IsRequired = true, DefaultValue = "f4f3397d550320975770be09e8f1510b1971b4876658ebb960a4b2df5b0d95059e8ac2c64eb8c0e0614df93bfbc31ece0f33121fc9c7bc9219db583eab3fee06")] - public string SaltKey - { - get { return this[SaltKeyKey].ToString(); } - set { this[SaltKeyKey] = value; } - } - - [ConfigurationProperty(ViKeyKey, IsKey = true, IsRequired = true, DefaultValue = "@1B2c3D4e5F6g7H8")] - public string VIKey - { - get { return this[ViKeyKey].ToString(); } - set { this[ViKeyKey] = value; } - } - } -} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebConfigSections/WebDavExplorerConfigurationSettingsSection.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebConfigSections/WebDavExplorerConfigurationSettingsSection.cs index dbe1700c..fabd4b67 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebConfigSections/WebDavExplorerConfigurationSettingsSection.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebConfigSections/WebDavExplorerConfigurationSettingsSection.cs @@ -44,13 +44,6 @@ namespace WebsitePanel.WebDavPortal.WebConfigSections set { this[ElementsRenderingKey] = value; } } - [ConfigurationProperty(Rfc2898CryptographyKey, IsRequired = true)] - public Rfc2898CryptographyElement Rfc2898Cryptography - { - get { return (Rfc2898CryptographyElement)this[Rfc2898CryptographyKey]; } - set { this[Rfc2898CryptographyKey] = value; } - } - [ConfigurationProperty(ConnectionStringsKey, IsDefaultCollection = false)] public AppConnectionStringsElementCollection ConnectionStrings { diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebsitePanel.WebDavPortal.csproj b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebsitePanel.WebDavPortal.csproj index a15d3a1f..f80d20ca 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebsitePanel.WebDavPortal.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebsitePanel.WebDavPortal.csproj @@ -148,22 +148,19 @@ - - + - - @@ -182,7 +179,6 @@ - @@ -192,7 +188,6 @@ -