1. 12 Nov, 2020 3 commits
  2. 11 Nov, 2020 2 commits
  3. 09 Nov, 2020 1 commit
    • Werner Koch's avatar
      Require at least libgpg-error 1.36 · eb99e8c4
      Werner Koch authored
      
      
      * configure.ac (NEED_GPG_ERROR_VERSION): Require 1.36.
      * src/cJSON.c: Remove code for older version.
      * src/engine.c (gpgme_get_engine_info): Ditto.
      * src/gpgme-json.c: Ditto.
      * src/op-support.c: Ditto.
      * src/util.h: Ditto.
      --
      
      Libgpg-error 1.36 has been released more than 18 months ago so it is
      time to avoid hacks and require this verion.  This will for example
      help Kleopatra to support PIV cards and improves the gpgme-json.
      
      Signed-off-by: default avatarWerner Koch <wk@gnupg.org>
      eb99e8c4
  4. 04 Nov, 2020 1 commit
    • Ben Kibbey's avatar
      Parse STATUS_CANCELED_BY_USER. · 35ca4600
      Ben Kibbey authored
      
      
      * src/gpgme.h.in (GPGME_STATUS_CANCELED_BY_USER): New.
      * src/status-table.c (status_table_s): Add "CANCELED_BY_USER".
      * src/passphrase.c (_gpgme_passphrase_status_handler): Return
      GPG_ERR_CANCELED during GPGME_STATUS_CANCELED_BY_USER.
      
      Signed-off-by: default avatarBen Kibbey <bjk@luxsci.net>
      35ca4600
  5. 03 Nov, 2020 3 commits
    • Ingo Klöcker's avatar
      qt: Make audit parameters of result signal optional · 0fee1359
      Ingo Klöcker authored
      lang/qt/src/quickjob.h (QuickJob::result): Make parameters
      auditLogAsHtml and audigLogError optional.
      --
      
      This aligns the signature of QuickJob's result signal with the result
      signals of the other Job subclasses.
      
      GnuPG-bug-id: 5094
      0fee1359
    • Ingo Klöcker's avatar
      cpp: Mark helper functions as static · b41f5fec
      Ingo Klöcker authored
      lang/cpp/src/key.cpp (find_subkey, verify_subkey, find_uid, verify_uid,
      find_signature, verify_signature): Mark as static.
      b41f5fec
    • Ingo Klöcker's avatar
      cpp: Make signatures belonging to the same user ID sortable · 6a6d2a27
      Ingo Klöcker authored
      lang/cpp/src/key.h, lang/cpp/src/key.cpp (UserID::Signature::operator<):
      New.
      lang/cpp/src/key.cpp (signature_index): New.
      --
      
      operator< defines a canonical sort order for signatures belonging to
      the same user ID. It is based on the sort order defined by
      cmp_signodes() in g10/keylist.c of gnupg. In particular, the ordering
      of signatures made with the same key by creation time allows to see
      easily whether the most recent signature is a certification or a
      revocation.
      
      GnuPG-bug-id: 5094
      recent
      6a6d2a27
  6. 29 Oct, 2020 4 commits
    • Ingo Klöcker's avatar
      qt: Add support for revoke signature quick command · f042739d
      Ingo Klöcker authored
      * lang/qt/src/quickjob.h (QuickJob::startRevokeSignature): New.
      * lang/qt/src/qgpgmequickjob.h, lang/qt/src/qgpgmequickjob.cpp
      (QGpgMEQuickJob::startRevokeSignature): New.
      * lang/qt/src/qgpgmequickjob.cpp (revokeSignatureWorker): New.
      --
      
      GnuPG-bug-id: 5094
      f042739d
    • Ingo Klöcker's avatar
      qt: Some minor cleanups · 60328c46
      Ingo Klöcker authored
      * lang/qt/src/qgpgmequickjob.h: (GpgME::Key, QDateTime, QString):
      Remove superfluous forward declarations.
      (QGpgMEQuickJob): Remove superfluous second template argument. It is
      identical to the default.
      (QGpgMEQuickJob::result): Remove. It is already defined in the base
      class.
      60328c46
    • Ingo Klöcker's avatar
      cpp: Add support for gpgme_op_revsig · 4166d263
      Ingo Klöcker authored
      * lang/cpp/src/context.cpp, lang/cpp/src/context.h
      (Context::revokeSignature, Context::startRevokeSignature): New.
      * lang/cpp/src/context.cpp
      (getLFSeparatedListOfStrings, getLFSeparatedListOfUserIds): New.
      (getLFSeparatedListOfFingerprintsFromSubkeys): Extracted second part
      of function to getLFSeparatedListOfStrings.
      --
      
      GnuPG-bug-id: 5094
      4166d263
    • Ingo Klöcker's avatar
      core: New function gpgme_op_revsig. · f3407d0e
      Ingo Klöcker authored
      * src/gpgme.h.in (gpgme_op_revsig_start, gpgme_op_revsig): New.
      (GPGME_REVSIG_LFSEP): New.
      * src/context.h (ctx_op_data_id_t): Add OPDATA_REVSIG.
      * src/revsig.c: New.
      * src/Makefile.am (main_sources): Add revsig.
      * src/libgpgme.vers, src/gpgme.def: Add gpgme_op_revsig and
      gpgme_op_revsig_start.
      * src/engine.h, src/engine.c: (_gpgme_engine_op_revsig): New.
      * src/engine-backend.h (engine_ops): Add 'revsig' and adjust all
      engine initializers.
      * src/engine-gpg.c (gpg_revsig): New.
      (_gpgme_engine_ops_gpg): Set revsig to gpg_revsig.
      * doc/gpgme.texi: Document new functions.
      * tests/run-keysign.c: Add option --revoke.
      --
      
      This extends GPGME to support the --quick-revoke-sig command
      added by GnuPG 2.2.24. This allows revoking key signatures.
      
      GnuPG-bug-id: 5094
      f3407d0e
  7. 27 Oct, 2020 1 commit
  8. 23 Oct, 2020 5 commits
    • Ingo Klöcker's avatar
      cpp: Add support for gpgme_cancel · 74c8131d
      Ingo Klöcker authored
      * lang/cpp/src/context.cpp, lang/cpp/context.h
      (Context::cancelPendingOperationImmediately): New.
      * NEWS: Mention added API
      --
      
      This allows immediate canceling of running operations, e.g. when a
      thread with a long running operation (like SCD DEVINFO --watch) is
      going to be terminated (on application shutdown).
      
      GnuPG-bug-id: 5066
      74c8131d
    • Ingo Klöcker's avatar
      Add Assuan transaction that forwards status lines to another object · ff23e240
      Ingo Klöcker authored
      * lang/cpp/src/Makefile.am: Add new files.
      * lang/cpp/src/interfaces/statusconsumer.h,
      lang/cpp/src/statusconsumerassuantransaction.cpp,
      lang/cpp/src/statusconsumerassuantransaction.h: New.
      * NEWS: Mention new API.
      --
      
      This Assuan transaction is useful for long running Assuan commands.
      Classes implementing the StatusConsumer interface can process received
      status lines while the Assuan command is still running.
      
      GnuPG-bug-id: 5066
      ff23e240
    • Ingo Klöcker's avatar
      qt: Add QDebug stream operator for GpgME::Error · b21cabb3
      Ingo Klöcker authored
      * lang/qt/src/Makefile.am: Add new files.
      * lang/qt/src/debug.h, lang/qt/src/debug.cpp: New.
      * NEWS: Mention it.
      --
      
      This was previously implemented in Kleopatra, but it makes sense for
      all users of qgpgme.
      b21cabb3
    • Ingo Klöcker's avatar
      cpp, qt: Add missing comparison operators for version info comparison · c3406462
      Ingo Klöcker authored
      * lang/cpp/src/engineinfo.h (EngineInfo::Version::operator<=,
      EngineInfo::Version::operator>=, EngineInfo::Version::operator!=):
      New.
      * lang/qt/tests/t-various.cpp (TestVarious::testVersion): Add tests for
      new comparison operators.
      * NEWS: Mention added API
      c3406462
    • Ingo Klöcker's avatar
      cpp, qt: Fix version info comparison · 2f53a2f4
      Ingo Klöcker authored
      * lang/cpp/src/engineinfo.h
      (EngineInfo::Version::operator>(const Version &)): Fix logic.
      (EngineInfo::Version::operator>(const char *)): Use Version-overload of
      operator>.
      
      * lang/qt/tests/t-various.cpp: Add test.
      --
      
      This fixes a logic error that 2.0.0 > 2.0.0 would return true.
      2f53a2f4
  9. 03 Oct, 2020 1 commit
    • Werner Koch's avatar
      tests: Fix gcc incompatibility · 25e2d717
      Werner Koch authored
      * tests/json/t-json.c: Remove var definitions inside a for statement.
      --
      
      This useful C99 feature seems to work only in recent gcc versions.  We
      can't use it; see gnupg/doc/HACKING.
      
      GnuPG-bug-id: 5088
      25e2d717
  10. 01 Oct, 2020 1 commit
  11. 09 Sep, 2020 1 commit
    • Werner Koch's avatar
      core: Fully implement the inquire callback for assuan_transact · e4ee706e
      Werner Koch authored
      
      
      * src/engine-assuan.c (inquire_cb): Implement returning data.
      
      * tests/opassuan/t-command.c (inq_cb): Send some test data.
      --
      
      The old code only allowed to send an empty response which was good
      enough for scdaemon's KNOWNCARDP inquire but not to send actual data.
      A quick test using a test smartcard might be
      
       ./t-command 'scd setattr --inquire PRIVATE-DO-1'
      
      and then reading the data back using
      
        gpg-connect-agent 'scd getattr PRIVATE-DO-1' /bye
      
      Signed-off-by: default avatarWerner Koch <wk@gnupg.org>
      e4ee706e
  12. 08 Sep, 2020 2 commits
  13. 07 Sep, 2020 3 commits
    • Ingo Klöcker's avatar
      qt: List keys once with --with-secret instead of twice · 13bcc668
      Ingo Klöcker authored
      * lang/qt/src/qgpgmelistallkeysjob.cpp
      (do_list_keys): Rename to do_list_keys_legacy and put into unnamed
      namespace.
      (merge_keys): Put into unnamed namespace.
      (list_keys): Rename to list_keys_legacy and put into unnamed namespace.
      (do_list_keys, list_keys): New.
      * lang/qt/tests/t-keylist.cpp (testListAllKeysSync): New.
      --
      
      With gpg >= 2.1, list keys once with --with-secret instead of listing
      public keys and secret keys and then merging (part of) the information
      about the keys.
      
      GnuPG-bug-id: 4794
      13bcc668
    • Ingo Klöcker's avatar
      cpp: Add keylist mode WithSecret · 188cc9e9
      Ingo Klöcker authored
      * lang/cpp/src/global.h (WithSecret): New.
      * lang/cpp/src/context.cpp (operator<<): Handle WithSecret.
      * lang/cpp/src/util.h (add_to_gpgme_keylist_mode_t,
      convert_from_gpgme_keylist_mode_t): Ditto.
      --
      
      GnuPG-bug-id: 4794
      188cc9e9
    • Ingo Klöcker's avatar
      cpp: Add missing keylist modes · b714a6bb
      Ingo Klöcker authored
      * lang/cpp/src/util.h
      (add_to_gpgme_keylist_mode_t): Sort modes as in enum definition and
      add missing modes to check.
      (convert_from_gpgme_keylist_mode_t): Add missing handling of
      GPGME_KEYLIST_MODE_WITH_TOFU and GPGME_KEYLIST_MODE_WITH_KEYGRIP.
      b714a6bb
  14. 03 Sep, 2020 1 commit
    • Ingo Klöcker's avatar
      cpp: Copy some more subkey properties when merging keys · 4d87ea28
      Ingo Klöcker authored
      * lang/cpp/src/key.cpp (Key::mergeWith): Also merge secret flag and
      keygrip
      --
      
      The keygrip was lost if the result of a public key listing was merged
      with the result of a secret key listing as done by QGpgMEListAllKeysJob.
      
      GnuPG-bug-id: 4794
      4d87ea28
  15. 28 Aug, 2020 1 commit
    • Werner Koch's avatar
      qt: Fix an rfc2253 parser flaw · b088d81c
      Werner Koch authored
      * lang/qt/src/dn.cpp (parse_dn_part): Fix parser.
      
      --
      
      This could in theory result in reading bytes after a after Nul in a
      string and thus possible segv on unallocated memory or reading other
      parts of the memory.  However, it is harmless because the rfc2253
      strings have been received from GnuPG which is expected to emit
      correct syntax.
      
      GnuPG-bug-id: 5037
      b088d81c
  16. 14 Aug, 2020 1 commit
    • Ingo Klöcker's avatar
      core: Add error handling to setexpire · f66f856c
      Ingo Klöcker authored
      * src/genkey.c (setexpire, gpgme_op_setexpire_start,
      gpgme_op_setexpire): Move to ...
      * src/setexpire.c: New.
      * src/Makefile.am (main_sources): Add that file.
      * src/context.h (ctx_op_data_id_t): Add OPDATA_SETEXPIRE.
      
      * lang/qt/tests/t-various.cpp (testSetExpire): Test error handling.
      --
      
      Errors (and failures) emitted via status-fd need to be handled
      explicitly, i.e. we need to provide an appropriate status handler with
      corresponding op_data_t. Additionally, we need to set a passphrase
      command handler if a passphrase callback is set in the context, e.g.
      during tests.
      
      GnuPG-bug-id: 4395
      f66f856c
  17. 11 Aug, 2020 1 commit
    • Ingo Klöcker's avatar
      qt: Support changing expiry of subkeys · 4f2cd3a0
      Ingo Klöcker authored
      * lang/qt/src/changeexpiryjob.h (ChangeExpiryJob::start): New overload
      that accepts subkeys (with empty implementation).
      * lang/qt/src/qgpgmechangeexpiryjob.h,
      lang/qt/src/qgpgmechangeexpiryjob.cpp (QGpgMEChangeExpiryJob::start):
      New overload that accepts subkeys.
      --
      
      This adds the possibility to change the expiry of subkeys.
      
      GnuPG-bug-id: 4717
      4f2cd3a0
  18. 10 Aug, 2020 1 commit
    • Ingo Klöcker's avatar
      cpp: Make private helper a file static · c813734c
      Ingo Klöcker authored
      * lang/cpp/src/context.h, lang/cpp/src/context.cpp
      (Context::getLFSeparatedListOfFingerprintsFromSubkeys): Remove
      from Context; make it a static function instead
      --
      
      GnuPG-bug-id: 5003
      c813734c
  19. 06 Aug, 2020 1 commit
  20. 05 Aug, 2020 1 commit
    • Ingo Klöcker's avatar
      qt: Port to new setExpire() · 89501509
      Ingo Klöcker authored
      * lang/qt/src/qgpgmechangeexpiryjob.cpp (change_expiry): Use new
      setExpire() instead of edit() with GpgSetExpiryTimeEditInteractor
      --
      
      Using the new setExpire() (which uses --quick-set-expire) is a lot less
      complex than using gpg's edit interface. It also feels faster. Next,
      I'll add support for changing the expiration time of subkeys.
      
      GnuPG-bug-id: 5003
      89501509
  21. 04 Aug, 2020 4 commits
    • Ingo Klöcker's avatar
      qt: Add test for setExpire · 84c6b6e2
      Ingo Klöcker authored
      * lang/qt/tests/t-various.cpp (TestVarious::testSetExpire): New.
      --
      
      GnuPG-bug-id: 5003
      84c6b6e2
    • Ingo Klöcker's avatar
      cpp: Add support for gpgme_op_setexpire · aa03205f
      Ingo Klöcker authored
      * lang/cpp/src/context.cpp
      (Context::setExpire, Context::startSetExpire): New.
      (Context::getLFSeparatedListOfFingerprintsFromSubkeys):
      New helper.
      * lang/cpp/src/context.h
      (Context::SetExpireFlags): New enum.
      (Context::setExpire, Context::startSetExpire): Add
      prototypes.
      (Context::getLFSeparatedListOfFingerprintsFromSubkeys):
      Add as private helper.
      --
      
      GnuPG-bug-id: 5003
      aa03205f
    • Ingo Klöcker's avatar
      cpp: Add ostream operator for subkey · 197ba151
      Ingo Klöcker authored
      * lang/cpp/src/key.cpp (Subkey): Add ostream operator.
      * lang/cpp/src/key.h: Update accordingly.
      --
      
      This is helpful for debugging / showing the state of a subkey.
      197ba151
    • Ingo Klöcker's avatar
      core: New function gpgme_op_setexpire. · db82e99a
      Ingo Klöcker authored
      
      
      * src/gpgme.h.in (gpgme_op_setexpire_start, gpgme_op_setexpire): New.
      * src/libgpgme.vers, src/gpgme.def: Add new functions.
      * src/genkey.c (setexpire): New.
      (gpgme_op_setexpire_start, gpgme_op_setexpire): New.
      * src/engine.h, src/engine.c: (_gpgme_engine_op_setexpire): New.
      * src/engine-backend.h (engine_ops): Add 'setexpire' and adjust all
      engine initializers.
      * src/engine-gpg.c (gpg_setexpire): New.
      (_gpgme_engine_ops_gpg): Set setexpire to gpg_setexpire.
      * doc/gpgme.texi: Document new functions.
      * tests/run-genkey.c: Add option --setexpire.
      --
      
      This extends GPGME to support the --quick-set-expire command
      added by GnuPG 2.1.22. This allows changing subkeys expiry
      date without going through the editinteractor interface.
      
      Co-authored-by: default avatarAndre Heinecke <aheinecke@gnupg.org>
      GnuPG-bug-id: 4999
      db82e99a
  22. 16 Jul, 2020 1 commit