aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src (unfollow)
Commit message (Collapse)AuthorFilesLines
2025-02-03cpp,qt: Remove C++ and Qt bindingsIngo Klöcker85-16521/+0
* README: Update. * configure.ac: Remove checks, variables and file generations related to the C++/Qt bindings. Remove cpp and qt* from available_languages and default_languages. * lang/Makefile.am (DIST_SUBDIRS): Remove cpp and qt. * lang/cpp, lang/qt: Remove. * m4/ax_check_compile_flag.m4, m4/ax_cxx_compile_stdcxx.m4, m4/ax_gcc_func_attribute.m4, m4/pkg.m4, m4/qt5.m4, m4/qt6.m4: Remove. -- The C++ and Qt bindings have been moved to separate Git repositories: gpgmepp and gpgmeqt. GnuPG-bug-id: 7262
2024-11-14cpp: Add Kyber algorithmIngo Klöcker1-0/+1
* lang/cpp/src/key.h (enum Subkey::PubkeyAlgo): Add AlgoKyber with same value as GPGME_PK_KYBER. -- GnuPG-bug-id: 7397
2024-10-23cpp: Put attributes before declarationsIngo Klöcker2-2/+2
* lang/cpp/src/key.h (UserID::Signature::Notation): Move GPGMEPP_DEPRECATED before the whole typedef declaration. * lang/cpp/src/verificationresult.h (Signature::Notation): Ditto. --
2024-10-23cpp: Add/change some includesIngo Klöcker3-4/+6
* lang/cpp/src/gpgaddexistingsubkeyeditinteractor.h, lang/cpp/src/gpgrevokekeyeditinteractor.h: Include <string>. * lang/cpp/src/key.h: Include <ctime> instead of <sys/time.h>. --
2024-10-21cpp: Add support for new flag fields beta_complianceIngo Klöcker6-6/+38
* lang/cpp/src/decryptionresult.cpp, lang/cpp/src/decryptionresult.h (class DecryptionResult): Add method isBetaCompliance. * lang/cpp/src/decryptionresult.cpp (operator<<): Add new flag. * lang/cpp/src/key.cpp, lang/cpp/src/key.h (class Key): Add method isBetaCompliance. (class Subkey): Add method isBetaCompliance. * lang/cpp/src/key.cpp: (Key::isDeVs): Remove duplicate check of is_de_vs of first subkey. (operator<<): Add new flag. * lang/cpp/src/verificationresult.cpp, lang/cpp/src/verificationresult.h (class Signature): Add method isBetaCompliance. * lang/cpp/src/verificationresult.cpp (operator<<): Add new flag. -- GnuPG-bug-id: 7346
2024-08-29cpp: Add pkgconfig file for gpgmeppIngo Klöcker2-1/+18
* configure.ac: Add substitutions GPGMEPP_PKGCONFIG_LIBS, GPGMEPP_PKGCONFIG_CFLAGS, GPGMEPP_PKGCONFIG_HOST. Apply them. Configure gpgmepp.pc file. * lang/cpp/src/Makefile.am (pkgconfigdir, pkgconfig_DATA): New. (EXTRA_DIST): Add gpgmepp.pc.in. * lang/cpp/src/gpgmepp.pc.in: New. -- This pkgconfig file will be used, at least temporarily, by qgpgme to find gpgmepp, but it's also useful in general for projects that don't use cmake. GnuPG-bug-id: 7262
2024-08-28cpp: Go with default answer on unknown question by key edit interfaceIngo Klöcker1-0/+14
* lang/cpp/src/editinteractor.cpp (edit_interactor_callback_impl): Send empty string to edit interface if General Error occurred. -- A General Error is usually returned by the nextState function of the concrete EditInteractor subclasses if gpg asks an unexpected question which isn't handled by the edit interactor's state machine. In this case, it's usually safe to go with the default answer. This makes the edit interactors much more robust. GnuPG-bug-id: 7274
2024-08-06cpp: Add support for setting owner trust and for disabling keysIngo Klöcker2-0/+67
* lang/cpp/src/context.cpp, lang/cpp/src/context.h (class Context): Add member functions setOwnerTrust, startSetOwnerTrust, setKeyEnabled, startSetKeyEnabled. * lang/cpp/src/context.cpp (owner_trust_to_string): New. -- GnuPG-bug-id: 7239
2024-07-10build,cpp: Fix include paths in forwarding headers in gpgme++ folderIngo Klöcker1-1/+1
* lang/cpp/src/Makefile.am (build rule for copied headers): Write abs_srcdir instead of srcdir in the generated headers. -- The generated include paths lacked a "../" if srcdir was relative. This lead to self-including includes for in-source builds. Including the real headers with their absolute paths fixes this. GnuPG-bug-id: 7110
2024-07-05cpp: Deprecate Error::asString and update usersIngo Klöcker3-4/+7
* lang/cpp/src/error.h (Error::asString): Mark as deprecated. * lang/cpp/src/context.cpp (operator<<), lang/cpp/src/editinteractor.cpp (edit_interactor_callback_impl), lang/cpp/tests/run-getkey.cpp (main), lang/cpp/tests/run-keylist.cpp (main), lang/cpp/tests/run-wkdlookup.cpp (main): Use Error::asStdString instead of Error::asString. -- GnuPG-bug-id: 7188
2024-07-05cpp: Add safer member function returning text describing an errorIngo Klöcker2-0/+8
* lang/cpp/src/error.h, lang/cpp/src/context.cpp (class Error): New member function asStdString. -- Unlike asString the new function doesn't cache the value returned by gpgme_strerror_r. This ensures that on Windows the UTF-8 encoded text is returned for the main thread even if the function was called before for another thread. For other threads asStdString will still return the natively encoded error description until UTF-8 encoded error descriptions can be enabled for all threads (T7185). GnuPG-bug-id: 7188
2024-07-05build,cpp: Create forwarding headers in a gpgme++ folderIngo Klöcker1-1/+12
* lang/cpp/src/Makefile.am (copied_headers): New. (build rule for all copied headers): New. (BUILT_SOURCES): New. (CLEANFILES): Add copied_headers. -- The forwarding headers make it easier to use the headers from the Qt bindings when building them against the built but not installed C++ bindings because we can always include the C++ headers with gpgme++/ prefix. This also helps to avoid including a C++ header with the same name as a header in the Qt bindings (e.g. util.h). GnuPG-bug-id: 7110
2024-06-28cpp: Remove obsolete filesIngo Klöcker2-82/+0
* lang/cpp/src/context_glib.cpp, lang/cpp/src/context_qt.cpp: Remove. -- These files have never been used since gpgmepp was imported into this repo.
2024-06-10cpp: Remove commented out and disabled codeIngo Klöcker2-156/+0
* lang/cpp/src/configuration.cpp: Remove disabled, abandoned code. * lang/cpp/src/context.cpp: Remove commented out, obsolete code. --
2024-05-24cpp: Fix includes in public headersIngo Klöcker13-14/+14
* lang/cpp/src/defaultassuantransaction.h, lang/cpp/src/gpgadduserideditinteractor.h, lang/cpp/src/gpgagentgetinfoassuantransaction.h, lang/cpp/src/gpggencardkeyinteractor.h, lang/cpp/src/gpgsetexpirytimeeditinteractor.h, lang/cpp/src/gpgsetownertrusteditinteractor.h, lang/cpp/src/gpgsignkeyeditinteractor.h, lang/cpp/src/interfaces/assuantransaction.h, lang/cpp/src/interfaces/dataprovider.h, lang/cpp/src/interfaces/statusconsumer.h, lang/cpp/src/scdgetinfoassuantransaction.h, lang/cpp/src/statusconsumerassuantransaction.h, lang/cpp/src/trustitem.h: Use #include "foo.h" instead of #include <foo.h> for own headers. -- This fixes the build for projects that include the headers (as intended) with #include <gpgme++/...> and that don't add the gpgme++ subdirectory to the list of include paths for the compiler. GnuPG-bug-id: 7110
2024-05-22qt,cpp: Implement adding ADSKs to existing keysTobias Fella2-0/+13
* lang/cpp/src/context.cpp: Add functions for adding ADSKs. * lang/cpp/src/context.h: Ditto. * lang/qt/src/qgpgmequickjob.cpp: Add implementation of ADSK job. * lang/qt/src/qgpgmequickjob.h: Ditto. * lang/qt/src/quickjob.h: Add job for adding ADSKs.
2024-05-21cpp: Add information about revocation keys to Keyikloecker/t7118-revkeysIngo Klöcker3-0/+159
* lang/cpp/src/gpgmefw.h (gpgme_revocation_key_t): New forward declaration. * lang/cpp/src/key.cpp, lang/cpp/src/key.h (class Key): New methods revocationKey, numRevocationKeys, revocationKeys. (class RevocationKey): New. (swap): New overload for RevocationKey. (operator<<): New overload for RevocationKey. * lang/cpp/src/key.cpp (operator<<): Add information about revocation keys to the output stream for Key. * lang/cpp/tests/run-keylist.cpp (main): Don't output Key if nextKey failed, e.g. at the end of the key listing. -- GnuPG-bug-id: 7118
2024-04-05cpp: Handle smart card op failure status messagesIngo Klöcker1-0/+36
* lang/cpp/src/editinteractor.cpp (parse_sc_op_failure): New. (CallbackHelper::edit_interactor_callback_impl): Parse failure code on GPGME_STATUS_SC_OP_FAILURE status. (sc_op_failure_to_error): New. -- This converts a SC_OP_FAILURE status message logged by gpg to a corresponding error. Unfortunately, GPG_ERR_BAD_PIN and GPG_ERR_BAD_RESET_CODE are mapped to the same SC_OP_FAILURE code, so that we had to choose one. GnuPG-bug-id: 6971
2023-12-19cpp: Support new flags for direct signing/encryption of filesIngo Klöcker4-1/+12
* lang/cpp/src/context.h (enum EncryptionFlags): Add constant EncryptFile. * lang/cpp/src/global.h (enum SignatureMode): Add constant SignFile. * lang/cpp/src/context.cpp (sigflags2sigflags): Handle new flag SignFile. (encryptflags2encryptflags): Handle new flag EncryptFile. (operator<<): Add new flags to the corresponding debug streams. * lang/cpp/src/signingresult.cpp (CreatedSignature::mode): Handle new flag SignFile (even if it cannot occur). -- GnuPG-bug-id: 6550
2023-10-13cpp,doc: Fix typos in API documentation and source code commentsIngo Klöcker1-1/+1
-- Anonymous contribution Signed-off-by: Ingo Klöcker <[email protected]>
2023-10-05cpp: Support new key capability flagsIngo Klöcker2-0/+37
* lang/cpp/src/key.cpp, lang/cpp/src/key.h (class Key): New methods hasCertify, hasSign, hasEncrypt, hasAuthenticate. -- GnuPG-bug-id: 6748
2023-08-15cpp: Remove unused includeIngo Klöcker4-6/+0
--
2023-08-04cpp: Expose gpgme_decrypt_result_t.is_mime through cpp APICarl Schwan2-0/+6
* lang/cpp/src/descriptionresult.cpp (DescriptionResult::isMime): New. * lang/cpp/src/descriptionresult.h: Update accordingly. -- This exposes the is_mime metadata from a decryption result to users of the C++ library. GnuPG-bug-id: 6199 Signed-off-by: Carl Schwan <[email protected]>
2023-06-16qt, cpp: Support larger size-hint on 32 bit buildsAndre Heinecke2-0/+10
* NEWS: Mention this. * lang/cpp/src/data.h, lang/cpp/src/data.cpp (Data::setSizeHint): New. * lang/qt/src/qgpgmedecryptjob.cpp, lang/qt/src/qgpgmedecryptverifyarchivejob.cpp, lang/qt/src/qgpgmedecryptverifyjob.cpp, lang/qt/src/qgpgmeencryptjob.cpp, lang/qt/src/qgpgmesignencryptjob.cpp, lang/qt/src/qgpgmesignjob.cpp, lang/qt/src/qgpgmeverifydetachedjob.cpp, lang/qt/src/qgpgmeverifyopaquejob.cpp: Set size for input IODevice. -- This fixes the case where the old detection of the size of QIOdevice using seek would overflow and instead explicitly uses QIODevice::size to check for the size and pass it through as an uint64. GnuPG-Bug-Id: T6534
2023-06-16cpp: Expose gpgme_data_set_flag through cpp APIAndre Heinecke2-0/+8
* lang/cpp/src/data.cpp (Data::setFlag): New. * lang/cpp/src/data.h: Update accordingly. * NEWS: Mention this. -- This exposes the generic flag mechanism for data to users of the C++ library. It is similar to Context::setFlag but has no getter.
2023-06-01doc,cpp: Treat GPG_ERR_FULLY_CANCELED as canceledIngo Klöcker1-1/+1
* doc/gpgme.texi (GPG_ERR_FULLY_CANCELED): New. * lang/cpp/src/context.cpp (Error::isCanceled): Also return true for GPG_ERR_FULLY_CANCELED. -- For internal purposes, GnuPG sometimes uses the error code GPG_ERR_FULLY_CANCELED instead of GPG_ERR_CANCELED. From a user perspective both values mean the same thing and should therefore be treated identically. GnuPG-bug-id: 6510
2023-04-18cpp: Fix Key::canSign()Ingo Klöcker2-17/+4
* lang/cpp/src/key.h (canReallySign): Deprecate. * lang/cpp/src/key.cpp (canSign): Remove workaround. Use implementation of canReallySign. (canReallySign): Use canSign(). (operator<<): Use canSign(). -- The workaround in canSign was added 19 years ago and canReallySign, the workaround for the workaround, was added 13 years ago. Time to get rid of those workarounds for a bug in gpgme which has been fixed long ago and which cause bugs for any unsuspecting user of Key::canSign(). GnuPG-bug-id: 6456
2023-03-21core,cpp: Add new key flags to gpgme_subkey_tWerner Koch2-0/+21
* src/gpgme.h.in (struct _gpgme_subkey): Add bit flags can_renc, can_timestamp, adn is_group_owned. Reduce size of _unused. * src/keylist.c (set_subkey_capability): Set them. * tests/run-keylist.c (main): Print them. * lang/cpp/src/key.h (Subkey::canRenc): New. (Subkey::canTimestamp): New. (Subkey::isGroupOwned): New. * lang/cpp/src/key.cpp: Implement new methods. (Subkey::isQualified): Print them. (std::ostream &operator<<): Print them. -- GnuPG-bug-id: 6395
2023-02-09cpp: Improve debug output of some enumsIngo Klöcker1-19/+32
* lang/cpp/src/verificationresult.cpp (operator<<): Fix output of Signature::PKAStatus which doesn't represent flags. Print corresponding name of enum value if Signature::Summary or Notation::Flags are 0. -- GnuPG-bug-id: 6368
2023-02-02cpp: Return successful verification for signed but not encrypted dataIngo Klöcker1-7/+15
* lang/cpp/src/context.cpp (Context::decrypt): Use decryptionResult(). (Context::verifyDetachedSignature, Context::verifyOpaqueSignature): Use verificationResult(). (Context::verificationResult): Ignore "no data" error for signed but not encrypted data. (Context::decryptAndVerify): Use decryptionResult() and verificationResult(). -- gpgme's decrypt operations set the error to GPG_ERR_NO_DATA if no encrypted data was found. It makes sense to use this error for the encryption result, but it doesn't make sense to use it also for the verfication result if signed data was found. This way using the combined decrypt-verify operations on data that may be encrypted and/or signed doesn't produce confusing results. GnuPG-bug-id: 6342
2023-02-02cpp: Update decryption flagsIngo Klöcker1-0/+1
* lang/cpp/src/context.h (DecryptArchive): New flag. -- This flag corresponds to the GPGME_DECRYPT_ARCHIVE flag in gpgme. GnuPG-bug-id: 6342
2023-02-02cpp: Add const-overloads of version comparison operatorsIngo Klöcker1-0/+70
* lang/cpp/src/engineinfo.h (EngineInfo::Version): Add const-overloads of all comparison operators. -- We keep the non-const overloads for binary compatibility. GnuPG-bug-id: 6342
2023-01-31cpp: Fix debug output of SignatureModeIngo Klöcker1-1/+9
* lang/cpp/src/context.cpp (operator<<): Treat signature mode as combination of a 2-bit flag and a 1-bit flag. -- This fixes the output for normal signature mode. GnuPG-bug-id: 6342
2023-01-30cpp: Support new archive signing flagIngo Klöcker3-15/+25
* lang/cpp/src/global.h (enum SignatureMode): Add constant SignArchive. * lang/cpp/src/context.cpp (sigmode2sigmode): Rename to sigflags2sigflags (sigflags2sigflags): ... and rename argument mode to flags and treat it as flags. Adjust the callers. (operator<<): Change local CHECK macro to handle flags. Add new flag to debug stream. * lang/cpp/src/signingresult.cpp (CreatedSignature::mode): Handle new flags (even if it cannot occur currently). -- GnuPG-bug-id: 6342
2023-01-27cpp: Support new archive encryption flagIngo Klöcker2-1/+6
* lang/cpp/src/context.h (EncryptArchive): New flag. * lang/cpp/src/context.cpp (encryptflags2encryptflags): Convert EncryptArchive to corresponding gpgme encrypt flags. (operator<<): Add new flag to debug stream. -- GnuPG-bug-id: 6342
2023-01-27cpp: Add convenience overload to set file nameIngo Klöcker2-0/+6
* lang/cpp/src/data.h, lang/cpp/src/data.cpp (setFileName): Add overload. -- GnuPG-bug-id: 6342
2023-01-26cpp: Support all encryption flagsIngo Klöcker2-1/+6
* lang/cpp/src/context.h (WantAddress): New flag. * lang/cpp/src/context.cpp (encryptflags2encryptflags): Convert WantAddress to corresponding gpgme encrypt flags. (operator<<): Add new flag to debug stream. -- GnuPG-bug-id: 6359
2023-01-26cpp: Pass ThrowKeyIds and EncryptWrap flags to GpgMEIngo Klöcker1-0/+8
* lang/cpp/src/context.cpp (encryptflags2encryptflags): Convert ThrowKeyIds and EncryptWrap to corresponding gpgme encrypt flags. (operator<<): Add flags to debug stream. -- GnuPG-bug-id: 6359
2023-01-18cpp,doc: Update list of allowed values for dirInfoIngo Klöcker1-1/+1
-- GnuPG-bug-id: 6342
2023-01-05cpp: Fix comparisons of integer expressions of different signednessIngo Klöcker1-2/+2
* lang/cpp/src/gpgrevokekeyeditinteractor.cpp (GpgRevokeKeyEditInteractor::Private::nextState): Cast signed nextLine value to std::size_t. --
2023-01-05cpp: Expliticly declare compiler generated copy constructorsIngo Klöcker15-2/+25
* lang/cpp/src/configuration.h (Component, Option), lang/cpp/src/data.h (Data), lang/cpp/src/decryptionresult.h (DecryptionResult, DecryptionResult::Recipient), lang/cpp/src/encryptionresult.h (EncryptionResult, InvalidRecipient), lang/cpp/src/engineinfo.h (EngineInfo), lang/cpp/src/importresult.h (ImportResult, Import), lang/cpp/src/key.h (Key, Subkey, UserID, UserID::Signature), lang/cpp/src/keygenerationresult.h (KeyGenerationResult), lang/cpp/src/keylistresult.h (KeyListResult), lang/cpp/src/notation.h (Notation), lang/cpp/src/signingresult.h (SigningResult, InvalidSigningKey, CreatedSignature), lang/cpp/src/swdbresult.h (SwdbResult), lang/cpp/src/tofuinfo.h (TofuInfo), lang/cpp/src/verificationresult.h (VerificationResult, Signature), lang/cpp/src/vfsmountresult.h (VfsMountResult): Explitily declare compiler generated copy constructor. -- This fixes "implicitly-declared copy constructor is deprecated" warnings.
2022-12-08cpp: Handle status errors in the base edit interactorIngo Klöcker2-4/+3
* lang/cpp/src/editinteractor.cpp (edit_interactor_callback_impl): Handle status errors. * lang/cpp/src/gpgrevokekeyeditinteractor.cpp (GpgRevokeKeyEditInteractor::Private::nextState): Remove handling of status errors. -- With this change status errors are handled for all interactors. In particular, this makes all edit interactors handle canceled password prompts correctly. GnuPG-bug-id: 6305
2022-12-08cpp: Handle statuses that need no response in the base edit interactorIngo Klöcker8-28/+7
* lang/cpp/src/editinteractor.cpp (edit_interactor_callback_impl): Do not call nextState() if status needs no response. * lang/cpp/src/gpgaddexistingsubkeyeditinteractor.cpp (GpgAddExistingSubkeyEditInteractor::Private::nextState), lang/cpp/src/gpgadduserideditinteractor.cpp (GpgAddUserIDEditInteractor::nextState), lang/cpp/src/gpggencardkeyinteractor.cpp (GpgGenCardKeyInteractor::nextState), lang/cpp/src/gpgrevokekeyeditinteractor.cpp (GpgRevokeKeyEditInteractor::Private::nextState), lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp (GpgSetExpiryTimeEditInteractor::nextState), lang/cpp/src/gpgsetownertrusteditinteractor.cpp (GpgSetOwnerTrustEditInteractor::nextState), lang/cpp/src/gpgsignkeyeditinteractor.cpp (GpgSignKeyEditInteractor::nextState): Remove handling of statuses that need no response. -- This change removes superfluous code duplication. GnuPG-bug-id: 6305
2022-10-24cpp: Allow setting the curve to use when generating ECC keysIngo Klöcker2-7/+34
lang/cpp/src/gpggencardkeyinteractor.h (class GpgGenCardKeyInteractor): Add enum Curve. Add member function setCurve. lang/cpp/src/gpggencardkeyinteractor.cpp (class GpgGenCardKeyInteractor::Private): Initialize simple members in-class. Add member curve. (GpgGenCardKeyInteractor::~GpgGenCardKeyInteractor): Use default d'tor. (GpgGenCardKeyInteractor::setCurve): New. (GpgGenCardKeyInteractor::action): Return curve defaulting to Curve25519. -- This enables users of this interactor to request the generation of ECC keys with a specific curve as smart card keys. It's up to the user to specify a curve that is actually supported by the smart card. GnuPG-bug-id: 4429
2022-09-14cpp: Reject signing expired keysIngo Klöcker1-0/+6
* lang/cpp/src/gpgsignkeyeditinteractor.cpp (enum SignKeyState): Add new state REJECT_SIGN_EXPIRED. (makeTable): Add entries for new state to transition map. (GpgSignKeyEditInteractor::action): Handle new state. -- With this change the edit interactor aborts the key signing operation with a "key expired" error instead of with a "general error". GnuPG-bug-id: 6155
2022-08-19cpp: Fix building with C++11Ingo Klöcker1-7/+7
* lang/cpp/src/importresult.cpp (ImportResult::mergeWith): Replace 'auto' in lambdas with the actual type. -- Generic lambdas require C++14. GnuPG-bug-id: 6141
2022-08-18cpp: Fix handling of "no key" or "invalid time" situationsIngo Klöcker1-2/+2
* lang/cpp/src/gpgaddexistingsubkeyeditinteractor.cpp (GpgAddExistingSubkeyEditInteractor::Private::nextState): Fix inverted logic of string comparisons. -- This fixes the problem that the interactor didn't return the proper error code if gpg didn't accept the key grip or the expiration date. GnuPG-bug-id: 6137
2022-08-09cpp: Add support for gpgme_op_set_uid_flagIngo Klöcker2-0/+13
* lang/cpp/src/context.cpp, lang/cpp/src/context.h (Context::setPrimaryUid, Context::startSetPrimaryUid): New. -- GnuPG-bug-id: 5938
2022-06-30cpp: Remove obsolete compatibility with KF5 variantsIngo Klöcker2-8/+0
* lang/cpp/src/GpgmeppConfig-w32.cmake.in.in, lang/cpp/src/GpgmeppConfig.cmake.in.in: Remove find_package() call. -- The KF5 variants have been removed years ago with revision a3cf30f89418c8a6bc9456533d95ba7fc2a33a4c.
2022-05-12cpp: Export KeyListModeSaverAndre Heinecke1-1/+1
* lang/cpp/src/context.h (Context::KeyListModeSaver): Add Export. -- This is required for Windows.