Commit Graph

74 Commits

Author SHA1 Message Date
SET
e56d1bd6eb Fix download code.
We need not check request::continuation() for stream resource.
2020-11-23 22:03:28 +01:00
SET
e4f8ac9c3a Remove useless conditional.
Not forwarding customized message to UI in EditUidValidity().
2020-11-23 22:03:28 +01:00
SET
e14a5c19f4 Log GpgME errors.
In file WT_APP_ROOT/gpgme.log.

Independently of usual Wt logging.
2020-11-23 22:02:55 +01:00
SET
b726b89086 Use new Context::setExpire to set expiration dates.
If no subkey is found (wrong fpr) or not provided, the expiry time of 
the key is set instead.

setExpire() allows to expire all subkeys at once. Not implemented here.

Requires GPGME >= 1.15.0.
2020-11-23 11:46:41 +01:00
SET
c9defdc02a Apply some CSS makeup.
Bad keys, subkeys, identities and signatures are tagged in red.
A secret key not owned by the user is shown in bold.
Application name is bold and bigger.
Popup background color is changed to floralwhite.
2020-11-22 22:36:41 +01:00
SET
bbc62a6efa Preserve source widget on click.
Remove TreeTableNodeText from parent, store it in TreeTableNodeLineEdit
and moves it back when the latter loses focus.
2020-11-22 18:58:04 +01:00
SET
14964f9862 Validate uid certification input.
Check all input in the popup before calling KeyEdit::
2020-11-22 14:48:27 +01:00
SET
6f15ab4d06 Refractor some identifiers to be more meaningful.
m_popupUid -> m_popupCertifyUid
CertifyKey() -> EditUidValidity()
2020-11-22 14:28:52 +01:00
SET
110e5e4fb3 Allow revoking key certifications.
Certified user identities in keys can be revoked using the same popup
for certification.

Requires GnuPG 2.2.24 (not available in distro's repository, not fully
tested to date).
2020-11-22 14:22:08 +01:00
SET
898764be7b Document changing subkey expiry time. 2020-11-22 09:21:38 +01:00
SET
e9a55a1f69 Allow changing subkey expiry time.
Needs GPGME 1.15.0.
Using the same UI for changing expiry time of the primary secret key.
2020-11-21 20:59:32 +01:00
SET
bb174075df Allow to add and revoke user identities.
Using a popup with required parameters.
2020-11-19 19:16:17 +01:00
SET
43e1eff221 Add function to revoke a user identity.
Done with Context::revUid, not with UserID::revoke.

Does not remove the identity.

N.B. : if the uid is revoked a second time, Error::code is 0.
2020-11-18 20:48:15 +01:00
SET
98c4fa2b22 Use right uid string.
Correct format :
        name (comment) <email>
Was :
        name <email> (comment)

3ac566fbf was wrong.
2020-11-18 20:40:16 +01:00
SET
da3f5c3516 Add function to add a new user identity to a key.
The email parameter must have a valid email address format here, else
GPGME will refuse to create the identity. This is not the case when
creating a key, where any string is accepted.
2020-11-16 15:58:50 +01:00
SET
4aa4ec9bf3 Hide export button with successful key search.
No key is selected after this.
2020-11-16 14:44:14 +01:00
SET
3ac566fbfe Format uid string correctly when creating keys.
Correct format :
	name <email> (comment)
Was :
	name <email> comment

Though the 'comment' part was visible with the cli gpg app, it was not
shown in kleopatra and in K7.
2020-11-16 14:39:57 +01:00
SET
0e9cc34ac0 Prefer key fingerprints anywhere.
During delete process, keys were identified by Key::keyID().
It seems that collisions are possible; so use fingerprints instead.
2020-11-15 20:55:05 +01:00
SET
64b480912f Update JSON configuration file template.
Add canEditExpiryTime and canCreateKeys Json keys.
2020-11-15 20:40:26 +01:00
SET
e312ac1efd Allow exporting public keys.
Secret keys cannot be exported because the loopback pinentry mechanism
fails to work.
2020-11-15 20:32:12 +01:00
SET
9ae83ed7bd Prefer fingerprint for key anchor id.
Short key id should be reserved for UI.
2020-11-15 12:17:57 +01:00
SET
7633ef9d60 Add function to export public keys.
Expects a fingerprint to export a single public key in armor mode.
2020-11-15 11:58:07 +01:00
SET
e944da9eda Test export private keys in C++.
Result : fails.
Reason : loopback passphrase provider is never called.

With default pinentry mode, the passphrase is requested normally 
and the private key is exported. But this can't be done on a web server.

Enclosed in #ifdef DEVTIME.
2020-11-15 11:53:03 +01:00
SET
f48a3602c6 Test export private keys in C.
Result : fails.
Reason : password callback is never called.

With default pinentry mode, the password is requested normally 
and the private key is exported. But this can't be done on a web server.

Enclosed in #ifdef DEVTIME.
2020-11-15 11:04:00 +01:00
SET
5e7df13df0 Show subkey and certification algorithms.
Subkey algorithms are shown in a new table column.
Uid signature algorithms are shown in the tooltip text.
2020-11-14 15:03:36 +01:00
SET
a721bb0225 Use common code formatting style. 2020-11-14 14:46:28 +01:00
SET
a7146a07b2 Add a close button in uid certification popup. 2020-11-14 11:41:04 +01:00
SET
1c3c073ef8 Reorganize KeyEdit class.
Make KeyEdit callable by K7Main only. Does not need to used by other
classes.
2020-11-14 11:32:49 +01:00
SET
6ac7ea7c0f Reorganize code.
Move KeyEdit::IsOurKey to Tools::IsOurKey.
2020-11-14 11:25:00 +01:00
SET
bb4df1423a Move all keyring management functions to a separate class.
KeyringIO imports, creates and deletes keys. Everything is declared
private in this class, and it can be called by K7Main only.
2020-11-14 10:58:45 +01:00
SET
2b6c0960be Improve changing certification trust level.
The editing combobox should be available only for
	- all keys that do not have an associated secret key
	- the secret keys managed by the user.
2020-11-13 22:40:53 +01:00
SET
1424f31253 Ignore unknown fingerprints when certifying keys.
A fingerprint manually added in the config file may be missing in
the keyring.
2020-11-13 21:46:09 +01:00
SET
8b789b09ca Rename upload and delete classes and variables to be more meaningful.
Uploader:: -> PopupUpload
Deleter:: -> PopupDelete
K7Main::m_uploader -> K7Main::m_popupUpload
K7Main::m_deleter -> K7Main::m_popupDelete
2020-11-13 18:53:08 +01:00
SET
1b73407db2 Allow to create keys.
A popup shows required parameters. Created keys are added to the list of
secret keys managed by the user.
2020-11-13 18:37:37 +01:00
SET
b9b4396b12 Fix key generation functions.
Created key must always be looked for as it is not assigned to the
passed in null key.
Delete local context and loopback passphrase provider.
Parameter expires was ignored in CreateKeyWithEngineDefaultAlgo.
2020-11-12 22:38:10 +01:00
SET
39afc3ebdc Fix bad return value of AppConfig::WriteTextFile. 2020-11-12 10:56:37 +01:00
SET
10f2a659bf Do update ownership of secret keys.
After importing or deleting secret keys.
2020-11-11 21:37:31 +01:00
SET
335ecd1261 AppConfig : update ownership of secret key.
Allow to append or remove the fingerprint to the private key array.
2020-11-11 21:36:08 +01:00
SET
4f8ea18a66 Use fingerprint instead of keyid when importing and deleting keys. 2020-11-11 21:09:43 +01:00
SET
9cce0febdb Add key creation functions.
- create a pair of keys with default engine algorithms
 - create a secret key
 - create a subkey (public) and add it to a secret key.
2020-11-11 14:47:05 +01:00
SET
15abc8b810 Prefer transient popup to change key expiry date
This is a trade-off.

When the calendar of the WDateEdit is clicked, widget PopupExpiryTime gets hidden, forcing to show it again.

If PopupExpiryTime::setTransient is false, it will obviously persist, until explicitly hidden with the Close button. Not satisfactory to change key selection while it is visible, nor to do other tasks like changing certification trust level, certifying uids.... whatever.

Forcing its persistence while playing with many events has not been successful, and quite ugly.
2020-11-08 09:03:45 +01:00
SET
fd583c091a Optimize passphrase line edit visibility in certify key popup.
WLineEdit::isVisible always returns false when the popup is hidden !
2020-11-07 22:28:33 +01:00
SET
2bddf29596 Allow to change key expiry date.
Select new date in a popup. Controlled by a specific configuration flag.
2020-11-07 22:25:07 +01:00
SET
fcd595d530 Rename variable.
Prepare for other edits in KeyEdit (change expiry date).
m_targetKeyFpr -> m_targetUidValidityKeyFpr.
2020-11-07 18:54:38 +01:00
SET
9cf9e803d8 Better describe key certification.
Use 'Certification status' instead of 'Signature status'.
2020-11-07 16:33:13 +01:00
SET
9996ec6f1c Hint at one-way operation during key certification.
Applying Exportable and Non-Revocable options cannot be undone.
2020-11-07 16:28:28 +01:00
SET
ffd9692504 List key certifications
Set context KeyListMode to ::Signatures | ::Validate.
List certification on public key only.
2020-11-07 12:21:49 +01:00
SET
de5f765688 Merge branch 'edit' 2020-11-06 21:44:33 +01:00
SET
c8b2f81bf8 Optimize certification trust level management.
A private key should be editable to Unknown or Ultimate levels only.
A public key should be editable to all levels except Ultimate.
Undefined level is excluded for both public and private keys.

The public WTreeTableNode may list private keys if the user does not manage
these private keys. Inform of this state in the tool tip. The certification
trust level is excluded for any change.
2020-11-06 21:42:50 +01:00
SET
f32d96b868 Merge branch 'edit' 2020-11-06 17:10:10 +01:00