I couldn't send mail to Till because of:

1) openpgp/mime misconfigured on my system currently, so only s/mime available
2) till's addressbook entry having only openpgp/mime checked, and "Always Sign" as preference.
The keyresolver then finds no match, as expected, but didn't even tell me about it, it just cancelled.
=> added a messagebox, and added the possibility to send the mail without signing it.

svn path=/branches/kdepim/proko2/kdepim/; revision=413314
wilder-work
David Faure 21 years ago
parent 1360a2aee1
commit dccfe3a5ad
  1. 21
      keyresolver.cpp
  2. 2
      keyresolver.h

@ -793,7 +793,7 @@ bool Kleo::KeyResolver::encryptionPossible() const {
EmptyKeyList ) == d->mSecondaryEncryptionKeys.end() ;
}
Kpgp::Result Kleo::KeyResolver::resolveAllKeys( bool signingRequested, bool encryptionRequested ) {
Kpgp::Result Kleo::KeyResolver::resolveAllKeys( bool& signingRequested, bool& encryptionRequested ) {
if ( !encryptionRequested && !signingRequested ) {
// make a dummy entry with all recipients, but no signing or
// encryption keys to avoid special-casing on the caller side:
@ -810,8 +810,13 @@ Kpgp::Result Kleo::KeyResolver::resolveAllKeys( bool signingRequested, bool encr
if ( signingRequested )
if ( encryptionRequested )
result = resolveSigningKeysForEncryption();
else
else {
result = resolveSigningKeysForSigningOnly();
if ( result == Kpgp::Failure ) {
signingRequested = false;
return Kpgp::Ok;
}
}
return result;
}
@ -1056,7 +1061,17 @@ Kpgp::Result Kleo::KeyResolver::resolveSigningKeysForSigningOnly() {
return Kpgp::Ok;
}
return Kpgp::Failure;
const QString msg = i18n("Examination of recipient's signing preferences "
"showed no common type of signature matching your "
"available signing keys.\n"
"Send message without signing?" );
if ( KMessageBox::warningContinueCancel( 0, msg, i18n("No signing possible"),
KStdGuiItem::cont() )
== KMessageBox::Continue ) {
d->mFormatInfoMap[OpenPGPMIMEFormat].splitInfos.push_back( SplitInfo( allRecipients() ) );
return Kpgp::Failure; // means "Ok, but without signing"
}
return Kpgp::Canceled;
}
std::vector<GpgME::Key> Kleo::KeyResolver::signingKeysFor( CryptoMessageFormat f ) const {

@ -200,7 +200,7 @@ namespace Kleo {
Queries the user for missing keys and displays a key approval
dialog if needed.
*/
Kpgp::Result resolveAllKeys( bool signingRequested, bool encryptionRequested );
Kpgp::Result resolveAllKeys( bool& signingRequested, bool& encryptionRequested );
/**
@return the signing keys to use (if any) for the given message

Loading…
Cancel
Save