Summary: | Create s/MIME mail: key selection dialog search for lastname not mail address. | ||
---|---|---|---|
Product: | [Applications] kmail2 | Reporter: | Ludwig Reiter <ludwig.reiter> |
Component: | crypto | Assignee: | Andre Heinecke <aheinecke> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aheinecke, bjoern.ricks, felix.wolfsteller, sascha.teichmann |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian unstable | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Ludwig Reiter
2010-08-03 10:49:42 UTC
commit fd1ce7087f79f0c41e8c87d4f202577b097a733e branch master Author: Tobias Koenig <tokoe@kde.org> Date: Wed Dec 29 11:57:44 2010 +0100 Always look up keys by canonical email address The original code did first try to look up the key by non-canonical email address (e.g. 'Joe User <joe@example.org>') which can lead to wrong key results if there are keys with the same name but different email addresses. The fallback lookup with canonical address wouldn't be triggered in this case, because the first lookup did return a result (although a wrong one). Now we only do one lookup with the canonical email address. BUG: 246590 CCMAIL: marc@kdab.com diff --git a/messagecomposer/keyresolver.cpp b/messagecomposer/keyresolver.cpp index 6667acd..c02e131 100644 --- a/messagecomposer/keyresolver.cpp +++ b/messagecomposer/keyresolver.cpp @@ -1666,17 +1666,9 @@ std::vector<GpgME::Key> Kleo::KeyResolver::getEncryptionKeys( const QString & pe } // Now search all public keys for matching keys - std::vector<GpgME::Key> matchingKeys = lookup( QStringList( person ) ); + std::vector<GpgME::Key> matchingKeys = lookup( QStringList( address ) ); matchingKeys.erase( std::remove_if( matchingKeys.begin(), matchingKeys.end(), NotValidEncryptionKey ), matchingKeys.end() ); - // if no keys match the complete address look for keys which match - // the canonical mail address - if ( matchingKeys.empty() ) { - matchingKeys = lookup( QStringList( address ) ); - matchingKeys.erase( std::remove_if( matchingKeys.begin(), matchingKeys.end(), - NotValidEncryptionKey ), - matchingKeys.end() ); - } // if called with quite == true (from EncryptionPreferenceCounter), we only want to // check if there are keys for this recipients, not (yet) their validity, so Andre, I have no idea how to test this, your issue. |