Downgrade to net standard 1.2

This commit is contained in:
Geoffroy BONNEVILLE
2020-03-23 18:35:00 +01:00
parent b8240d482f
commit 5067f81189
60 changed files with 1250 additions and 285 deletions

View File

@@ -248,6 +248,33 @@ namespace ModernKeePassLib.Keys
try
{
#if ModernKeePassLib
var doc = XDocument.Load(ms);
var el = doc.Root;
if((el == null) || !el.Name.LocalName.Equals(RootElementName))
return null;
if(el.DescendantNodes().Count() < 2)
return null;
foreach(var xmlChild in el.Descendants())
{
if(xmlChild.Name == MetaElementName) { } // Ignore Meta
else if(xmlChild.Name == KeyElementName)
{
foreach(var xmlKeyChild in xmlChild.Descendants())
{
if(xmlKeyChild.Name == KeyDataElementName)
{
if(pbKeyData == null)
pbKeyData = Convert.FromBase64String(xmlKeyChild.Value);
}
}
}
}
#else
XmlDocument doc = XmlUtilEx.CreateXmlDocument();
doc.Load(ms);
@@ -270,6 +297,7 @@ namespace ModernKeePassLib.Keys
}
}
}
#endif
}
catch(Exception) { pbKeyData = null; }
finally { ms.Dispose(); }