Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions src/KeePass.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33205.214
# Visual Studio Version 18
VisualStudioVersion = 18.1.11312.151
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ZlibAndroid", "ZlibAndroid\ZlibAndroid.csproj", "{1DF9DA08-D2FE-4227-BD53-761CD3F6CA42}"
EndProject
Expand Down Expand Up @@ -31,6 +31,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kp2aAutofillParser.Tests",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DropboxBinding", "DropboxBinding\DropboxBinding.csproj", "{2FE6E335-E834-4F86-AB83-2C5D225DA929}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kp2aPasskey.Core", "Kp2aPasskey.Core\Kp2aPasskey.Core.csproj", "{6B081853-9DEB-9E9F-FF45-6758B0C357CC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -395,6 +397,30 @@ Global
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.ReleaseNoNet|Win32.Build.0 = Release|Any CPU
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.ReleaseNoNet|x64.ActiveCfg = Release|Any CPU
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.ReleaseNoNet|x64.Build.0 = Release|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.Debug|Win32.ActiveCfg = Debug|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.Debug|Win32.Build.0 = Debug|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.Debug|x64.ActiveCfg = Debug|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.Debug|x64.Build.0 = Debug|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.Release|Any CPU.Build.0 = Release|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.Release|Win32.ActiveCfg = Release|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.Release|Win32.Build.0 = Release|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.Release|x64.ActiveCfg = Release|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.Release|x64.Build.0 = Release|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.ReleaseNoNet|Any CPU.ActiveCfg = Release|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.ReleaseNoNet|Any CPU.Build.0 = Release|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.ReleaseNoNet|Mixed Platforms.ActiveCfg = Release|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.ReleaseNoNet|Mixed Platforms.Build.0 = Release|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.ReleaseNoNet|Win32.ActiveCfg = Release|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.ReleaseNoNet|Win32.Build.0 = Release|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.ReleaseNoNet|x64.ActiveCfg = Release|Any CPU
{6B081853-9DEB-9E9F-FF45-6758B0C357CC}.ReleaseNoNet|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
22 changes: 22 additions & 0 deletions src/Kp2aBusinessLogic/SearchDbHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,28 @@ private static String ExtractHost(String url)
return UrlUtil.GetHost(url.Trim());
}

/// <summary>
/// Returns all entries whose <c>KPEX_PASSKEY_RELYING_PARTY</c> extra field exactly matches
/// <paramref name="relyingParty"/> (case-insensitive).
/// </summary>
public PwGroup SearchForRelyingParty(Database database, string relyingParty)
{
string strGroupName = _app.GetResourceString(UiStringKey.search_results);
PwGroup pgResults = new PwGroup(true, true, strGroupName, PwIcon.EMailSearch) { IsVirtual = true };

foreach (PwEntry entry in database.EntriesById.Values)
{
if (!entry.GetSearchingEnabled())
continue;
var storedRp = entry.Strings.ReadSafe("KPEX_PASSKEY_RELYING_PARTY");
// Log every entry that has the field so mismatches are visible in logcat
if (string.Equals(storedRp, relyingParty, StringComparison.OrdinalIgnoreCase))
pgResults.AddEntry(entry, false);
}

return pgResults;
}

public PwGroup SearchForHost(Database database, String url, bool allowSubdomains)
{
String host = ExtractHost(url);
Expand Down
9 changes: 9 additions & 0 deletions src/Kp2aBusinessLogic/database/Database.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,15 @@ public PwGroup SearchForHost(String url, bool allowSubdomains)

}

/// <summary>
/// Returns all entries whose <c>KPEX_PASSKEY_RELYING_PARTY</c> extra field
/// exactly matches <paramref name="relyingParty"/> (case-insensitive).
/// </summary>
public PwGroup SearchForRelyingParty(string relyingParty)
{
return SearchHelper.SearchForRelyingParty(this, relyingParty);
}


public void SaveData(IFileStorage fileStorage)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Kp2aBusinessLogic/database/edit/CreateDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace keepass2android

public class CreateDb : OperationWithFinishHandler
{
public const string DefaultDbName = "Keepass2Android Password Database";
private readonly IOConnectionInfo _ioc;
private readonly bool _dontSave;
private readonly IKp2aApp _app;
Expand Down Expand Up @@ -68,7 +69,7 @@ public override void Run()
db.KpDatabase.New(_ioc, _key, _app.GetFileStorage(_ioc).GetFilenameWithoutPathAndExt(_ioc));

db.KpDatabase.KdfParameters = (new AesKdf()).GetDefaultParameters();
db.KpDatabase.Name = "Keepass2Android Password Database";
db.KpDatabase.Name = DefaultDbName;
//re-set the name of the root group because the PwDatabase uses UrlUtil which is not appropriate for all file storages:
db.KpDatabase.RootGroup.Name = _app.GetFileStorage(_ioc).GetFilenameWithoutPathAndExt(_ioc);

Expand Down
Loading
Loading