Update to KeePassLib version 2.45

This commit is contained in:
Geoffroy BONNEVILLE
2020-05-12 12:46:25 +02:00
parent 107e009807
commit 2e1cc97738
21 changed files with 166 additions and 65 deletions

View File

@@ -524,7 +524,7 @@ namespace ModernKeePassLib.Serialization
return false;
}
#if !ModernKeePassLib
internal static void ClearOld()
internal static void ClearOld()
{
try
{

View File

@@ -273,6 +273,7 @@ namespace ModernKeePassLib.Serialization
public static readonly string WrhMoveFileTo = "MoveFileTo";
public static event EventHandler<IOAccessEventArgs> IOAccessPre;
public static event EventHandler<IOWebRequestEventArgs> IOWebRequestPre;
#if !ModernKeePassLib && !KeePassLibSD
// Allow self-signed certificates, expired certificates, etc.
@@ -369,6 +370,13 @@ namespace ModernKeePassLib.Serialization
bool? ob = p.GetBool(IocKnownProperties.PreAuth);
if(ob.HasValue) request.PreAuthenticate = ob.Value;
#endif
if(IOConnection.IOWebRequestPre != null)
{
IOWebRequestEventArgs e = new IOWebRequestEventArgs(request,
((ioc != null) ? ioc.CloneDeep() : null));
IOConnection.IOWebRequestPre(null, e);
}
}
internal static void ConfigureWebClient(WebClient wc)
@@ -549,13 +557,13 @@ namespace ModernKeePassLib.Serialization
PrepareWebAccess(ioc);
IOWebClient wc = new IOWebClient(ioc);
ConfigureWebClient(wc);
if((ioc.UserName.Length > 0) || (ioc.Password.Length > 0))
wc.Credentials = new NetworkCredential(ioc.UserName, ioc.Password);
else if(NativeLib.IsUnix()) // Mono requires credentials
else if(MonoWorkarounds.IsRequired(688007))
wc.Credentials = new NetworkCredential("anonymous", string.Empty);
ConfigureWebClient(wc);
return wc;
}
@@ -564,13 +572,13 @@ namespace ModernKeePassLib.Serialization
PrepareWebAccess(ioc);
WebRequest req = WebRequest.Create(ioc.Path);
ConfigureWebRequest(req, ioc);
if((ioc.UserName.Length > 0) || (ioc.Password.Length > 0))
req.Credentials = new NetworkCredential(ioc.UserName, ioc.Password);
else if(NativeLib.IsUnix()) // Mono requires credentials
else if(MonoWorkarounds.IsRequired(688007))
req.Credentials = new NetworkCredential("anonymous", string.Empty);
ConfigureWebRequest(req, ioc);
return req;
}

View File

@@ -1,6 +1,6 @@
/*
KeePass Password Safe - The Open-Source Password Manager
Copyright (C) 2003-2018 Dominik Reichl <dominik.reichl@t-online.de>
Copyright (C) 2003-2020 Dominik Reichl <dominik.reichl@t-online.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -336,7 +336,7 @@ namespace ModernKeePassLib.Serialization
#if ModernKeePassLib
if (IsLocalFile()) return Bytes != null;
#else
if(IsLocalFile()) return File.Exists(m_strUrl);
return IOConnection.FileExists(this, false); // Raises event
#endif
return true;