Commit 7e9ac454 authored by Rolf Eike Beer's avatar Rolf Eike Beer
Browse files

add option to allow untrusted keys to become group members

BUG:221052

svn path=/trunk/KDE/kdeutils/kgpg/; revision=1100849
parent a0d254af
<ui version="4.0" stdsetdef="1" >
<author>bj@altern.org</author>
<class>Encryption</class>
<widget class="QWidget" name="Encryption" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>421</width>
<height>280</height>
</rect>
</property>
<property name="windowTitle" >
<string>Encryption</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<item rowspan="1" row="2" column="0" colspan="3" >
<widget class="QCheckBox" name="kcfg_PgpCompatibility" >
<property name="text" >
<string>PGP 6 compatibility</string>
</property>
<property name="whatsThis" stdset="0" >
<string>&lt;qt>&lt;b>PGP 6 compatibility:&lt;/b>&lt;br />
&lt;p>Checking this option forces GnuPG to output encrypted packets that are as compliant with PGP (Pretty Good Privacy) 6 standards as possible thus allowing GnuPG users to inter operate with PGP 6 users.&lt;/p>&lt;/qt></string>
</property>
</widget>
</item>
<item rowspan="1" row="0" column="0" colspan="3" >
<widget class="QCheckBox" name="kcfg_AsciiArmor" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text" >
<string>ASCII armored encryption</string>
</property>
<property name="whatsThis" stdset="0" >
<string>&lt;qt>&lt;b>ASCII armored encryption:&lt;/b> &lt;br />
&lt;p>Checking this option outputs all encrypted files in a format that can be opened by a text editor and as such the output is suitable for placing in the body of an e-mail message.&lt;/p>&lt;/qt></string>
</property>
</widget>
</item>
<item rowspan="1" row="8" column="0" colspan="3" >
<widget class="QCheckBox" name="kcfg_PgpExtension" >
<property name="text" >
<string>Use *.pgp extension for encrypted files</string>
</property>
<property name="whatsThis" stdset="0" >
<string>&lt;qt>&lt;b>Use *.pgp extension for encrypted files:&lt;/b>&lt;br />
&lt;p>Checking this option will append a .pgp extension to all encrypted files instead of a .gpg extension. This option will maintain compatibility with users of PGP (Pretty Good Privacy) software.&lt;/p>&lt;/qt></string>
</property>
</widget>
</item>
<item rowspan="1" row="3" column="0" colspan="3" >
<widget class="QCheckBox" name="kcfg_HideUserID" >
<property name="text" >
<string>Hide user id</string>
</property>
<property name="whatsThis" stdset="0" >
<string>&lt;qt>&lt;b>Hide user ID:&lt;/b>&lt;br />
&lt;p>Checking this option will remove the keyid of the recipient from all encrypted packets. The advantage: traffic analysis of the encrypted packets cannot be performed as easily because the recipient is unknown. The disadvantage: the receiver of the encrypted packets is forced to try all secret keys before being able to decrypt the packets. This can be a lengthy process depending on the number of secret keys the receiver holds.&lt;/p>&lt;/qt></string>
</property>
</widget>
</item>
<item row="9" column="1" >
<spacer name="spacer7" >
<property name="sizeHint" >
<size>
<width>20</width>
<height>16</height>
</size>
</property>
<property name="sizeType" >
<enum>Expanding</enum>
</property>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
</spacer>
</item>
<item rowspan="1" row="7" column="0" colspan="2" >
<widget class="QCheckBox" name="kcfg_AllowCustomEncryptionOptions" >
<property name="text" >
<string>Custom encryption command:</string>
</property>
<property name="whatsThis" stdset="0" >
<string>&lt;qt>&lt;b>Custom encryption command:&lt;/b>&lt;br />
&lt;p>When activated, an entry field will be shown in the key selection dialog, enabling you to enter a custom command for encryption. This option is recommended for experienced users only.&lt;/p>&lt;/qt></string>
</property>
</widget>
</item>
<item row="7" column="2" >
<widget class="KLineEdit" name="kcfg_CustomEncryptionOptions" >
<property name="enabled" >
<bool>false</bool>
</property>
</widget>
</item>
<item rowspan="1" row="5" column="1" colspan="2" >
<widget class="KComboBox" name="always_key" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item rowspan="1" row="6" column="1" colspan="2" >
<widget class="KComboBox" name="file_key" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="5" column="0" >
<widget class="QCheckBox" name="encrypt_to_always" >
<property name="text" >
<string>Always encrypt with:</string>
</property>
<property name="whatsThis" stdset="0" >
<string>&lt;qt>&lt;b>Always encrypt with:&lt;/b>&lt;br />
&lt;p>This ensures all files/messages will also be encrypted with the chosen key. However, if the "Encrypt files with:" option is selected that chosen key will override the "Always encrypt with:" selection.&lt;/p>&lt;/qt></string>
</property>
</widget>
</item>
<item row="6" column="0" >
<widget class="QCheckBox" name="kcfg_EncryptFilesTo" >
<property name="text" >
<string>Encrypt files with:</string>
</property>
<property name="whatsThis" stdset="0" >
<string>&lt;qt>&lt;b>Encrypt files with:&lt;/b>&lt;br />
&lt;p>Checking this option and selecting a key will force any file encryption operation to use the selected key. KGpg will not query for a recipient and the default key will be bypassed.&lt;/p>&lt;/qt></string>
</property>
</widget>
</item>
<item rowspan="1" row="1" column="0" colspan="3" >
<widget class="QCheckBox" name="kcfg_AllowUntrustedKeys" >
<property name="text" >
<string>Allow encryption with untrusted keys</string>
</property>
<property name="whatsThis" stdset="0" >
<string>&lt;qt>&lt;b>Allow encryption with untrusted keys:&lt;/b>&lt;br />
&lt;p>When importing a public key, the key is usually marked as untrusted and as such cannot be used unless it is signed by the default key (thus making it 'trusted'). Checking this box enables any key to be used even if it is untrusted.&lt;/p>&lt;/qt></string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
</customwidgets>
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<author>bj@altern.org</author>
<class>Encryption</class>
<widget class="QWidget" name="Encryption">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>421</width>
<height>280</height>
</rect>
</property>
<property name="windowTitle">
<string>Encryption</string>
</property>
<layout class="QGridLayout">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0" colspan="3">
<widget class="QCheckBox" name="kcfg_AsciiArmor">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="whatsThis">
<string>&lt;qt&gt;&lt;b&gt;ASCII armored encryption:&lt;/b&gt; &lt;br /&gt;
&lt;p&gt;Checking this option outputs all encrypted files in a format that can be opened by a text editor and as such the output is suitable for placing in the body of an e-mail message.&lt;/p&gt;&lt;/qt&gt;</string>
</property>
<property name="text">
<string>ASCII armored encryption</string>
</property>
</widget>
</item>
<item row="11" column="0" colspan="3">
<widget class="QCheckBox" name="kcfg_PgpExtension">
<property name="whatsThis">
<string>&lt;qt&gt;&lt;b&gt;Use *.pgp extension for encrypted files:&lt;/b&gt;&lt;br /&gt;
&lt;p&gt;Checking this option will append a .pgp extension to all encrypted files instead of a .gpg extension. This option will maintain compatibility with users of PGP (Pretty Good Privacy) software.&lt;/p&gt;&lt;/qt&gt;</string>
</property>
<property name="text">
<string>Use *.pgp extension for encrypted files</string>
</property>
</widget>
</item>
<item row="12" column="1">
<spacer name="spacer7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item row="10" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_AllowCustomEncryptionOptions">
<property name="whatsThis">
<string>&lt;qt&gt;&lt;b&gt;Custom encryption command:&lt;/b&gt;&lt;br /&gt;
&lt;p&gt;When activated, an entry field will be shown in the key selection dialog, enabling you to enter a custom command for encryption. This option is recommended for experienced users only.&lt;/p&gt;&lt;/qt&gt;</string>
</property>
<property name="text">
<string>Custom encryption command:</string>
</property>
</widget>
</item>
<item row="10" column="2">
<widget class="KLineEdit" name="kcfg_CustomEncryptionOptions">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="8" column="1" colspan="2">
<widget class="KComboBox" name="always_key">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="9" column="1" colspan="2">
<widget class="KComboBox" name="file_key">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QCheckBox" name="encrypt_to_always">
<property name="whatsThis">
<string>&lt;qt&gt;&lt;b&gt;Always encrypt with:&lt;/b&gt;&lt;br /&gt;
&lt;p&gt;This ensures all files/messages will also be encrypted with the chosen key. However, if the &quot;Encrypt files with:&quot; option is selected that chosen key will override the &quot;Always encrypt with:&quot; selection.&lt;/p&gt;&lt;/qt&gt;</string>
</property>
<property name="text">
<string>Always encrypt with:</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QCheckBox" name="kcfg_EncryptFilesTo">
<property name="whatsThis">
<string>&lt;qt&gt;&lt;b&gt;Encrypt files with:&lt;/b&gt;&lt;br /&gt;
&lt;p&gt;Checking this option and selecting a key will force any file encryption operation to use the selected key. KGpg will not query for a recipient and the default key will be bypassed.&lt;/p&gt;&lt;/qt&gt;</string>
</property>
<property name="text">
<string>Encrypt files with:</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QCheckBox" name="kcfg_AllowUntrustedKeys">
<property name="whatsThis">
<string>&lt;qt&gt;&lt;b&gt;Allow encryption with untrusted keys:&lt;/b&gt;&lt;br /&gt;
&lt;p&gt;When importing a public key, the key is usually marked as untrusted and as such cannot be used unless it is signed by the default key (thus making it 'trusted'). Checking this box enables any key to be used even if it is untrusted.&lt;/p&gt;&lt;/qt&gt;</string>
</property>
<property name="text">
<string>Allow encryption with untrusted keys</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="kcfg_AllowUntrustedGroupMembers">
<property name="whatsThis">
<string>&lt;qt&gt;&lt;b&gt;Allow untrusted keys as members of key groups:&lt;/b&gt;&lt;br /&gt;&lt;p&gt;A key group allows simple encryption to multiple recipients at once. Similar to the &lt;em&gt;Allow encryption with untrusted keys&lt;/em&gt; option this allows untrusted keys to become member of a key group.&lt;/p&gt;&lt;/qt&gt;</string>
</property>
<property name="text">
<string>Allow untrusted keys as members of key groups</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QCheckBox" name="kcfg_HideUserID">
<property name="whatsThis">
<string>&lt;qt&gt;&lt;b&gt;Hide user ID:&lt;/b&gt;&lt;br /&gt;
&lt;p&gt;Checking this option will remove the keyid of the recipient from all encrypted packets. The advantage: traffic analysis of the encrypted packets cannot be performed as easily because the recipient is unknown. The disadvantage: the receiver of the encrypted packets is forced to try all secret keys before being able to decrypt the packets. This can be a lengthy process depending on the number of secret keys the receiver holds.&lt;/p&gt;&lt;/qt&gt;</string>
</property>
<property name="text">
<string>Hide user id</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="kcfg_PgpCompatibility">
<property name="whatsThis">
<string>&lt;qt&gt;&lt;b&gt;PGP 6 compatibility:&lt;/b&gt;&lt;br /&gt;
&lt;p&gt;Checking this option forces GnuPG to output encrypted packets that are as compliant with PGP (Pretty Good Privacy) 6 standards as possible thus allowing GnuPG users to inter operate with PGP 6 users.&lt;/p&gt;&lt;/qt&gt;</string>
</property>
<property name="text">
<string>PGP 6 compatibility</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
......@@ -16,13 +16,24 @@
#include <QHeaderView>
#include "groupeditproxymodel.h"
#include "kgpgitemmodel.h"
#include "kgpgkey.h"
#include "kgpgsettings.h"
groupEdit::groupEdit(QWidget *parent, QList<KGpgNode *> *ids)
: QWidget( parent ), members(ids)
{
setupUi( this );
m_in = new GroupEditProxyModel(this, false, members);
m_out = new GroupEditProxyModel(this, true, members);
KgpgCore::KgpgKeyTrust mintrust;
if (KGpgSettings::allowUntrustedGroupMembers()) {
mintrust = KgpgCore::TRUST_UNDEFINED;
textLabelAvailable->setText(i18n("Available Keys"));
} else {
mintrust = KgpgCore::TRUST_FULL;
textLabelAvailable->setText(i18n("Available Trusted Keys"));
}
m_in = new GroupEditProxyModel(this, false, members, mintrust);
m_out = new GroupEditProxyModel(this, true, members, mintrust);
availableKeys->setModel(m_out);
groupKeys->setModel(m_in);
buttonAdd->setIcon(KIcon("go-down"));
......
......@@ -11,16 +11,19 @@
</property>
<layout class="QVBoxLayout" >
<item>
<widget class="QLabel" name="textLabel1" >
<widget class="QLabel" name="textLabelAvailable" >
<property name="font" >
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Maximum" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Available Trusted Keys</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
......
......@@ -36,6 +36,10 @@
<label>Allow encryption with untrusted keys.</label>
<default>false</default>
</entry>
<entry name="AllowUntrustedGroupMembers" type="Bool" key="Allow_untrusted_group_members">
<label>Allow untrusted keys to become members of key groups.</label>
<default>false</default>
</entry>
<entry name="HideUserID" type="Bool" key="Hide_user_ID">
<label>Hide the user ID.</label>
<default>false</default>
......
......@@ -25,8 +25,12 @@
using namespace KgpgCore;
GroupEditProxyModel::GroupEditProxyModel(QObject *parent, const bool &invert, QList<KGpgNode *> *ids, const KgpgCore::KgpgKeyTrust &mintrust)
: QSortFilterProxyModel(parent), m_model(NULL), m_invert(invert), m_ids(ids), m_mintrust(mintrust)
GroupEditProxyModel::GroupEditProxyModel(QObject *parent, const bool &invert, QList<KGpgNode *> *ids, const KgpgCore::KgpgKeyTrust mintrust)
: QSortFilterProxyModel(parent),
m_model(NULL),
m_invert(invert),
m_ids(ids),
m_mintrust(mintrust)
{
}
......@@ -37,6 +41,13 @@ GroupEditProxyModel::setKeyModel(KGpgItemModel *md)
setSourceModel(md);
}
void
GroupEditProxyModel::setMinTrust(const KgpgCore::KgpgKeyTrust mintrust)
{
m_mintrust = mintrust;
invalidate();
}
bool
GroupEditProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
{
......
......@@ -28,9 +28,10 @@ class KGpgItemModel;
class GroupEditProxyModel: public QSortFilterProxyModel
{
public:
explicit GroupEditProxyModel(QObject * parent, const bool &invert, QList<KGpgNode *> *ids, const KgpgCore::KgpgKeyTrust &mintrust = KgpgCore::TRUST_FULL);
explicit GroupEditProxyModel(QObject * parent, const bool &invert, QList<KGpgNode *> *ids, const KgpgCore::KgpgKeyTrust mintrust = KgpgCore::TRUST_FULL);
void setKeyModel(KGpgItemModel *);
void setMinTrust(const KgpgCore::KgpgKeyTrust mintrust);
KGpgNode *nodeForIndex(const QModelIndex &index) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment