Add helper for dealing with compliance modes
ClosedPublic

Authored by justusw on Jul 5 2017, 3:11 PM.

Details

Reviewers
aheinecke
Summary

Add a predicate to check whether we are in a given compliance mode, a
function that computes the minimum of the validity of all UIDs, and a
macro that can be used to check various objects for compliance with
CO_DE_VS without breaking compilation with older versions of GPGME,
and without cluttering the code with preprocessor conditionals.

Signed-off-by: Justus Winter <justus@gnupg.org>

Integrate compliance information in results if run in CO_DE_VS mode

When decrypting data and verifying signatures, inform the user about
whether or not the operation was VS-compliant if Kleopatra is run in
CO_DE_VS mode.

Signed-off-by: Justus Winter <justus@gnupg.org>

Display the new field 'Validity'

The key model recently gained a new field. Display this.

Signed-off-by: Justus Winter <justus@gnupg.org>

Display compliance information in the encryption wizard

Display whether or not a cryptographic operation will be in compliance
with CO_DE_VS by stating so in a label, coloring the 'next' button,
and adding an icon to it.

Signed-off-by: Justus Winter <justus@gnupg.org>

Add a convenient button to list keys that are not certified

Check if there are keys that are not fully certified, and if there
are, display a button next to the filter combobox that offers a quick
way to list those keys.

Signed-off-by: Justus Winter <justus@gnupg.org>

Here arc, butcher this commit...

Diff Detail

Repository
R168 Kleopatra
Branch
justus/compliance
Lint
No Linters Available
Unit
No Unit Test Coverage
justusw created this revision.Jul 5 2017, 3:11 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptJul 5 2017, 3:11 PM
Restricted Application added a subscriber: KDE PIM. · View Herald Transcript
justusw added inline comments.Jul 6 2017, 10:22 AM
src/utils/gnupg-helper.cpp
280

So this duplicates functionality from libkleo, which is bad, but a) I did not know where to put it exactly in libkleo (see the other diff), and b) frankly, I like my predicate better because it is easier to use (avoids the QStringLiteral("de-vs") in the expression.

289

Likewise.

aheinecke accepted this revision.Jul 10 2017, 11:54 AM

Only cosmetic complaints. If you fix these you can push the series.

Please also change the LIBKLEO_VERSION in the CMakeLists to: 5.5.81 after you commited D6516

src/crypto/gui/signencryptfileswizard.cpp
302

Minor: In other places we use compliant. Same in the string below. No need to upload a new diff just fix it before push.

413

Here and in some other places: KDE Coding style requires braces even around single line statements.

src/crypto/gui/signencryptwidget.cpp
285

Minor style with the "! "

src/utils/gnupg-helper.h
51

false instead of 0 please and tabs -> spaces.

This revision is now accepted and ready to land.Jul 10 2017, 11:55 AM
justusw closed this revision.Jul 11 2017, 10:50 AM

I merged this series. Thanks :)

Since this landed, I'm unable to build kleopatra (I'm up to date with libkleo):

[  168s] /home/abuild/rpmbuild/BUILD/kleopatra-17.07.70git.20170711T115220~4adbce1c/src/utils/gnupg-helper.h:49:26: error: 'const class GpgME::Signature' has no member named 'isDeVs'
[  168s]  # define IS_DE_VS(x) (x).isDeVs()
[  168s]                           ^
[  168s] /home/abuild/rpmbuild/BUILD/kleopatra-17.07.70git.20170711T115220~4adbce1c/src/crypto/decryptverifytask.cpp:303:17: note: in expansion of macro 'IS_DE_VS'
[  168s]               + (IS_DE_VS(sig)
[  168s]                  ^~~~~~~~
[  168s] /home/abuild/rpmbuild/BUILD/kleopatra-17.07.70git.20170711T115220~4adbce1c/src/crypto/decryptverifytask.cpp: In function 'QString {anonymous}::formatDecryptionResultDetails(const GpgME::DecryptionResult&, const std::vector<GpgME::Key>&, const QString&, bool)':
[  168s] /home/abuild/rpmbuild/BUILD/kleopatra-17.07.70git.20170711T115220~4adbce1c/src/utils/gnupg-helper.h:49:26: error: 'const class GpgME::DecryptionResult' has no member named 'isDeVs'
[  168s]  # define IS_DE_VS(x) (x).isDeVs()
[  168s]                           ^
[  168s] /home/abuild/rpmbuild/BUILD/kleopatra-17.07.70git.20170711T115220~4adbce1c/src/crypto/decryptverifytask.cpp:554:22: note: in expansion of macro 'IS_DE_VS'
[  168s]          details += ((IS_DE_VS(res)
[  168s]                       ^~~~~~~~
[  169s] make[2]: *** [src/CMakeFiles/kleopatra_bin.dir/build.make:1620: src/CMakeFiles/kleopatra_bin.dir/crypto/decryptverifytask.cpp.o] Error 1

According to my (limited) understanding, this needs https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgme.git;a=commitdiff;h=05fa2a9c7764b28fdac35eb72631439df948ca0e which is in an unreleased GPGME version. Would it be possible to conditionalize it, or, at worst, warn beforehand when these things occur?

Thanks, I thought it was part of the 1.9 release. I should add an environment that only has released versions ;-) Sorry for the trouble.