aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* cpp: Add revuid and adduid supportAndre Heinecke2017-01-114-0/+76
| | | | | | | | | | | * lang/cpp/src/context.cpp (Context::revUid, Context::startRevUid), (Context::addUid, Context::startAddUid): New. * lang/cpp/src/context.h: Declare new functions. * lang/cpp/src/key.cpp (Key::UserID::revoke) (Key::addUid): Idomatic helpers. lang/cpp/src/key.h: Declare new functions. * NEWS: Update accordingly.
* Fix cmake configuration files for MacOSAndre Heinecke2017-01-112-1/+8
| | | | | | | | | | | | * configure.ac: Set HAVE_MACOS_SYSTEM conditional. * lang/qt/src/Makefile.am, lang/cpp/src/Makefile.am, lang/qt/src/QGpgmeConfig.cmake.in.in, lang/cpp/src/GpgmeConfig.cmake.in.in: Use libsuffix again to distinguish between macos .dylib -- GnuPG-Bug-Id: 2884
* cpp: Ensure that hasSecret is correct after updateAndre Heinecke2016-12-161-1/+6
| | | | | | | | | | | * lang/cpp/src/key.cpp (Key::update): Check for a secret key first before listing public keys. -- This is a performance delay but the update should only be called in a non gui thread anyway. The information if we have the secret key for this key is important to provide after update.
* cpp: Fix addrSpec for keys without emailAndre Heinecke2016-12-151-1/+6
| | | | | | | | | | | * lang/cpp/src/key.cpp (UserID::addrSpec): Use uid->address instead of normalizing again. (&operator<<(std::ostream &, const UserID &): Print it. -- This saves a normalization and fixes the case where a user id is just a mail address without name, in that case gpgme sets "address" but not email. Because the email is then the name.
* cpp: Fix update of partial key in verifyresultAndre Heinecke2016-12-151-1/+2
| | | | | | | | | | | * lang/cpp/src/verificationresult.cpp (Signature::key(bool,bool)): Don't update the returned copy but the actual key of the signature. -- The whole point of the update is to change the partial key from the signature (e.g. only fingerprint and one uid as we would have from tofu) to a fully keylisted one.
* Remove a forgotten instance of @libsuffix@Heiko Becker2016-11-171-1/+1
| | | | | | | | | | | * lang/cpp/src/GpgmeppConfig.cmake.in.in: Remove a forgotten instance of @libsuffix@. -- b2c07bd47bd608afa5cc819b60a7b5bb8c9dd96a removed @libsuffix@ from cmake config files, but missed one instance. Signed-off-by: Heiko Becker <[email protected]>
* qt, cpp: Add cmake config files for w32Andre Heinecke2016-11-153-8/+110
| | | | | | | | | | | | | | | * lang/cpp/src/GpgmeppConfig-w32.cmake.in.in lang/qt/src/QGpgmeConfig-w32.cmake.in.in: New. * lang/cpp/src/GpgmeppConfig.cmake.in.in, lang/qt/src/QGpgmeConfig.cmake.in.in: Remove libsuffix handling. * lang/cpp/src/Makefile.am, lang/qt/src/Makefile.am: Create / install w32 config files. * configure.ac: Configure them. -- To work with DLL's cmake needs to know about the implib and the final DLL. So the config files look different enough that it's better to use alternative files.
* cpp: Add get / set Sender APIAndre Heinecke2016-11-142-0/+14
| | | | | * cpp/src/context.cpp, cpp/src/context.h (Context::setSender), (Context::getSender): Add simple wrappers.
* qt, cpp: Enable dll build for windowsAndre Heinecke2016-11-141-1/+1
| | | | | * lang/cpp/src/Makefile.am, lang/qt/src/Makefile.am: Add -no-undefined to LDFLAGS.
* cpp: Add API for swdb queriesAndre Heinecke2016-11-043-2/+361
| | | | | | * lang/cpp/src/swdbresult.cpp, lang/cpp/src/swdbresult.h (SwdbResult): New. * lang/cpp/src/Makefile.am: Update accordingly.
* cpp: Add more EngineInfo::Version ctorsAndre Heinecke2016-11-041-0/+16
| | | | | | * lang/cpp/src/engineinfo.h (EngineInfo::Version::Version(const char*)), (EngineInfo::Version::Version()): New.
* cpp: Don't include gpgme.h in tofuinfo headerAndre Heinecke2016-11-041-2/+0
| | | | | | | * lang/cpp/src/tofuinfo.h: Don't include gpgme.h -- No public header should include gpgme.h
* cpp: Extend gpgmefw for tofuinfo and swdb queryAndre Heinecke2016-11-041-0/+6
| | | | | * lang/cpp/src/gpgmefw.h (gpgme_tofu_info_t) (gpgme_query_swdb_result_t): New forwards.
* qt, cpp: Fix versioning in cmake config and headerAndre Heinecke2016-11-022-7/+6
| | | | | | | | | | | | | | | | | * configure.ac (VERSION_MAJOR, VERSION_MINOR, VERSION_MICRO): New subst variables for the version header. * lang/cpp/src/GpgmeppConfigVersion.cmake.in, lang/cpp/src/gpgmepp_version.h.in, lang/qt/src/QGpgmeConfigVersion.cmake.in, lang/qt/src/qgpgme_version.h.in: Use new variables. -- Using the LT_* variables was just wrong. Reporting the package version also makes more sense then the library version. Having different versions might make ABI breaks more visible by increasing the major version number, but to have different versions in the same package is too confusing imo and gpgme uses a versioning that is unrelated to the library version number.
* qt, cpp: Add all generated files to cleanfilesAndre Heinecke2016-11-021-1/+2
| | | | | | * cpp/src/Makefile.am (CLEANFILES), qt/src/Makefile.am (CLEANFILES): Add all generated files to cleanfiles.
* qt, cpp: Install version headers in subdirsAndre Heinecke2016-11-011-1/+1
| | | | | | | | | | | | * lang/cpp/src/Makefile.am, lang/qt/src/Makefile.am: Install version headers in include subdirs. -- This change was requested on the gnupg-devel mailing list to avoid placing these headers into the top level include directories. There is currently no known user of these headers so changing it now should not break things downstream.
* cpp: Fix init of string from nullAndre Heinecke2016-10-141-3/+6
| | | | | * lang/cpp/src/key.cpp (UserID::addrSpecFromString): Check return value before creating the string.
* qt, cpp: Fix permissions of Config filesAndre Heinecke2016-10-131-2/+2
| | | | | * lang/cpp/src/Makefile.am, lang/qt/src/Makefile.am: Do not install config files as executable.
* qt, cpp: Fix expected targets in Config filesAndre Heinecke2016-10-131-1/+1
| | | | | * lang/cpp/src/GpgmeppConfig.cmake.in.in, lang/qt/src/QGpgmeConfig.cmake.in.in: Remove KF5 variants.
* cpp: Add API for gpgme_addrspec_from_uidAndre Heinecke2016-10-112-0/+31
| | | | | | | * lang/cpp/src/key.cpp (UserID::addrSpecFromString): New static function to expose addrspec from uid. (UserID::addrSpec): New. Get addrSpec from Userid. * NEWS: Update accordingly.
* Add convenience function to get key from sigAndre Heinecke2016-10-102-0/+53
| | | | | | | | | | | | | | * lang/cpp/src/verificationresult.cpp (Signature::key(bool, bool)): New. Can be used to search / update the key associcated with this signature. -- By using update a caller can ensure that an incomplete key obtainable through the new key() function is fully loaded. With search the key can be looked up in the internal keyring. As the results are cached this can be done in the crypto thread and the result then better used in the UI thread.
* cpp: Return null key if the signature had no keyAndre Heinecke2016-10-101-0/+2
| | | | | | | | | * lang/cpp/src/verificationresult.cpp (Private): Add null key to list when there is no key associated with the signature. -- This fixes an out of bounds read when a verification did not have a key.
* Add missing includes.Justus Winter2016-10-061-0/+1
| | | | | | | | * lang/cpp/src/key.cpp: Include <strings.h> for 'strcasecmp'. * tests/gpg/t-cancel.c: Include <sys/select.h> for 'fd_set' and friends. Signed-off-by: Justus Winter <[email protected]>
* cpp: Add support for URL Data encodingsAndre Heinecke2016-10-052-1/+10
| | | | | | * lang/cpp/src/data.h (Data::Encoding): Extend enum. * lang/cpp/src/data.cpp (Data::encoding), Data::setEncoding): Support new values.
* cpp: Fix gcc diagnostic push / popAndre Heinecke2016-10-051-2/+2
| | | | | | | * lang/cpp/src/context.cpp: Fix pragmas. -- This fixes an error with -Werror=unknown-pragmas
* cpp, qt: Handle modified includedir installationAndre Heinecke2016-09-292-13/+4
| | | | | | | | | | | | | | * lang/cpp/src/Makefile.am, lang/qt/src/Makefile.am: Replace resolved_includedir. * lang/cpp/src/GpgmeppConfig.cmake.in.in, lang/qt/src/QGpgmeConfig.cmake.in.in: Use resolved_includedir instead of relying on a common installation prefix. -- This fixes usage of the config files in case gpgme is configured with a custom --includedir. We have to do the replacement manually like for libdir because configure would include variables in the replacement.
* Fix spellingDaniel Kahn Gillmor2016-09-231-2/+2
| | | | | | | | | * lang/cpp/src/context.h, lang/qt/src/protocol.h, lang/qt/src/wkspublishjob.h, src/data-identify.c, src/engine-gpg.c: minor spelling cleanup. -- Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* cpp, qt: Include config.hAndre Heinecke2016-09-2329-0/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lang/cpp/src/callbacks.cpp, lang/cpp/src/configuration.cpp, lang/cpp/src/context.cpp, lang/cpp/src/context_glib.cpp, lang/cpp/src/context_qt.cpp, lang/cpp/src/context_vanilla.cpp, lang/cpp/src/data.cpp, lang/cpp/src/decryptionresult.cpp, lang/cpp/src/defaultassuantransaction.cpp, lang/cpp/src/editinteractor.cpp, lang/cpp/src/encryptionresult.cpp, lang/cpp/src/engineinfo.cpp, lang/cpp/src/eventloopinteractor.cpp, lang/cpp/src/exception.cpp, lang/cpp/src/gpgadduserideditinteractor.cpp, lang/cpp/src/gpgagentgetinfoassuantransaction.cpp, lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp, lang/cpp/src/gpgsetownertrusteditinteractor.cpp, lang/cpp/src/gpgsignkeyeditinteractor.cpp, lang/cpp/src/importresult.cpp, lang/cpp/src/key.cpp, lang/cpp/src/keygenerationresult.cpp, lang/cpp/src/keylistresult.cpp, lang/cpp/src/scdgetinfoassuantransaction.cpp, lang/cpp/src/signingresult.cpp, lang/cpp/src/tofuinfo.cpp, lang/cpp/src/trustitem.cpp, lang/cpp/src/verificationresult.cpp, lang/cpp/src/vfsmountresult.cpp, lang/qt/src/dataprovider.cpp, lang/qt/src/defaultkeygenerationjob.cpp, lang/qt/src/gpgme_backend_debug.cpp, lang/qt/src/job.cpp, lang/qt/src/qgpgmeadduseridjob.cpp, lang/qt/src/qgpgmebackend.cpp, lang/qt/src/qgpgmechangeexpiryjob.cpp, lang/qt/src/qgpgmechangeownertrustjob.cpp, lang/qt/src/qgpgmechangepasswdjob.cpp, lang/qt/src/qgpgmedecryptjob.cpp, lang/qt/src/qgpgmedecryptverifyjob.cpp, lang/qt/src/qgpgmedeletejob.cpp, lang/qt/src/qgpgmedownloadjob.cpp, lang/qt/src/qgpgmeencryptjob.cpp, lang/qt/src/qgpgmeexportjob.cpp, lang/qt/src/qgpgmeimportfromkeyserverjob.cpp, lang/qt/src/qgpgmeimportjob.cpp, lang/qt/src/qgpgmekeyformailboxjob.cpp, lang/qt/src/qgpgmekeygenerationjob.cpp, lang/qt/src/qgpgmekeylistjob.cpp, lang/qt/src/qgpgmelistallkeysjob.cpp, lang/qt/src/qgpgmenewcryptoconfig.cpp, lang/qt/src/qgpgmerefreshkeysjob.cpp, lang/qt/src/qgpgmesecretkeyexportjob.cpp, lang/qt/src/qgpgmesignencryptjob.cpp, lang/qt/src/qgpgmesignjob.cpp, lang/qt/src/qgpgmesignkeyjob.cpp, lang/qt/src/qgpgmetofupolicyjob.cpp, lang/qt/src/qgpgmeverifydetachedjob.cpp, lang/qt/src/qgpgmeverifyopaquejob.cpp, lang/qt/src/qgpgmewkspublishjob.cpp, lang/qt/src/threadedjobmixin.cpp, lang/qt/tests/run-keyformailboxjob.cpp, lang/qt/tests/t-encrypt.cpp, lang/qt/tests/t-keylist.cpp, lang/qt/tests/t-keylocate.cpp, lang/qt/tests/t-ownertrust.cpp, lang/qt/tests/t-support.cpp, lang/qt/tests/t-tofuinfo.cpp, lang/qt/tests/t-wkspublish.cpp: Include config.h -- This fixes problems with mismatching definitions. Most notably _FILE_OFFSET_BITS is now always set correctly.
* cpp: Avoid missing returns in non-void functionsAndreas Stieger2016-09-213-0/+4
| | | | | | | | | | | | | * lang/cpp/src/context.cpp (Context::signaturePolicyURL): return nullptr on default (to_tofu_policy_t): add default case for unknown * lang/cpp/src/key.cpp (Key::primaryFingerprint): return nullptr on default * lang/cpp/src/tofuinfo.cpp (GpgME::TofuInfo::policy): add default case for unknown Signed-off-by: Andreas Stieger <[email protected]> Signed-off-by: Andre Heinecke <[email protected]>
* cpp: Add support for gpgme_op_tofu_policyAndre Heinecke2016-09-162-0/+35
| | | | | * src/context.cpp, src/context.h (setTofuPolicy, setTofuPolicyStart): New.
* cpp: Declare sizes of tofu-info enumsAndre Heinecke2016-09-161-2/+2
| | | | | | | | | * lang/cpp/src/tofuinfo.h (Policy, Validity): Declare sizes. -- This is a quick ABI break before the release so that we can easier extend them in the future. All new enums in public API should be declared with a size from now on.
* cpp: Silence use of deprecated function warning.Werner Koch2016-09-161-0/+9
| | | | | | * lang/cpp/src/context.cpp (GpgME): Use pragma to silence wardning. Signed-off-by: Werner Koch <[email protected]>
* core,cpp: Extend the TOFU information.Werner Koch2016-09-072-8/+35
| | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (struct _gpeme_tofu_info): Rename FIRSTSEEN to SIGNFIRST and LASTSEEN to SIGNLAST. Add ENCRFIST and ENCRLAST. * src/keylist.c (parse_tfs_record): Parse to ENCRFIRST and ENCRLAST. * src/verify.c (parse_tofu_stats): Ditto. * tests/run-keylist.c (main): Adjust and print encrypt stats. * tests/run-verify.c (print_result): Ditto. * lang/cpp/src/tofuinfo.h (TofuInfo): Rename firstSeen to signFirst and lastSeen to signLast. Add encrCount, encrFirst and encrLast. * lang/cpp/src/tofuinfo.cpp (encrCount, encrFirst, encrLast): New. -- The latest GnuPG commits have the needed changes but we also allow the use of currently released GnuPG version. Signed-off-by: Werner Koch <[email protected]>
* cpp: Add convenience update function to a keyAndre Heinecke2016-09-052-0/+28
| | | | | | | | | * lang/cpp/src/key.cpp (Key::update): New. * lang/cpp/src/key.h: Update accordingly. -- This function helps if you have an incomplete key or want to make sure all info in a key is complete (e.g. validity / tofuinfo)
* cpp: Add ostream operators for key and uidAndre Heinecke2016-09-052-0/+42
| | | | | | | | | * lang/cpp/src/key.cpp (Key, UserID): Add ostream operator. * lang/cpp/src/key.h: Update accordingly. -- This is helpful debugging / showing the state of a key / uid and tofuinfo.
* cpp: Add WithTofu Keylist ModeAndre Heinecke2016-08-253-1/+6
| | | | | | * lang/cpp/src/context.cpp: Handle WithTofu. * lang/cpp/src/global.h (KeyListMode): Add WithTofu. * lang/cpp/src/util.h (add_to_gpgme_keylist_mode_t): Handle WithTofu.
* Cpp: Change firstSeen / lastSeen return valuesAndre Heinecke2016-08-252-6/+6
| | | | | | * lang/cpp/src/tofuinfo.cpp, lang/cpp/src/tofuinfo.h (TofuInfo::firstSeen, TofuInfo::lastSeen): Change return values to unsigned long and update doc.
* Cpp: Add wrapper for gpgme_get_dirinfoAndre Heinecke2016-08-252-0/+14
| | | | | * lang/cpp/src/context.cpp (dirInfo): New. * lang/cpp/src/global.h (dirInfo): New.
* Cpp: Add support for spawn engineAndre Heinecke2016-08-253-1/+66
| | | | | | | * lang/cpp/src/context.cpp (Context::spawn, Context::spawnAsync): New. * lang/cpp/src/context.h: Add prototypes. (SpawnFlags): New. * lang/cpp/src/global.h (SpawnEngine): Added.
* cpp: Get rid of AssuanResult due to its deprecation.Werner Koch2016-08-246-203/+40
| | | | | | | | | | | | | | * lang/cpp/src/assuanresult.cpp: Remove. * lang/cpp/src/assuanresult.h: Remove. * lang/cpp/src/Makefile.am: Remove these files. * lang/cpp/src/context.cpp: Remove header assuanresult.h (assuanTransact): Change return type to Error. Use gpgme_op_assuan_transact_ext. (startAssuanTransaction): Change return type to Error. (assuanResult): Remove * lang/cpp/src/context.h (assuanResult): Adjust for changes. Signed-off-by: Werner Koch <[email protected]>
* Cpp: Add Key to signatureAndre Heinecke2016-08-242-0/+20
| | | | | * lang/cpp/src/verificationresult.cpp, lang/cpp/src/verificationresult.h (Signature::key): New.
* Cpp: Use fpr field for primaryFingerprintAndre Heinecke2016-08-241-5/+10
| | | | | | | | | | * lang/cpp/src/key.cpp (Key::primaryFingerprint): Return fpr value if available. -- Should not be necessary but we might have an incomplete key without subkeys but the fingerprint already set in gpgme's data type.
* Cpp: Move tofuinfo from signature to useridAndre Heinecke2016-08-236-72/+15
| | | | | | | | | | | | | | * lang/cpp/src/key.cpp (UserID::tofuInfo): New. * lang/cpp/src/key.h: Update accordingly. * lang/cpp/src/tofuinfo.cpp: Remove dropped fields. * lang/cpp/src/tofuinfo.h: Update accordingly. * lang/cpp/src/verificationresult.cpp, lang/cpp/src/verificationresult.h: Remove tofu info. * lang/qt/tests/t-tofuinfo.cpp: Disable for now. -- With be4ff75d7 Tofu info now lives with a UserID Object. While this breaks API it was not yet released.
* Cpp: Fix some pedantic warningsAndre Heinecke2016-08-173-4/+4
| | | | | | | * lang/cpp/src/context.cpp, lang/cpp/src/context.h (Context::getKeysFromRecipients): Remove ignored / invalid const qualifier. * lang/cpp/src/result.h: Don't shadow error function in ctor.
* Cpp: Provide size-hint for seekable and mem dataAndre Heinecke2016-08-121-0/+10
| | | | | | | | | * lang/cpp/src/data.cpp (GpgME::Data::Data): Set size-hint for mem and DataProvider based Data. -- This fixes the case that QGpgME did not have a total value for progress as the size was unknown.
* Cpp: Handle empty recipients consistentlyAndre Heinecke2016-08-102-38/+38
| | | | | | | | | | | | | | * lang/cpp/src/context.cpp (Context::getKeysFromRecipients): New helper. (Context::encrypt, Context::startEncryption, Context::signAndEncrypt) (Context::startCombinedSigningAndEncryption): Use new helper. * lang/cpp/src/context.h (Context::getKeysFromRecipients): Add as private helper. -- bf776ce was incomplete as the code to handle recpients was duplicated four times. This is now unified and constently uses a nullptr instead of an empty array.
* Cpp: Clarify ownership of provider classesAndre Heinecke2016-08-101-0/+14
| | | | | * lang/cpp/src/context.h: Note that the context does not take ownership of providers.
* Cpp: Add support for all EncryptionFlagsAndre Heinecke2016-08-092-1/+26
| | | | | * lang/cpp/src/context.h (EncryptionFlags): Extend. * lang/cpp/src/context.cpp (encryptflags2encryptflags): Ditto.
* Cpp: Fix simple symmetric encryptionAndre Heinecke2016-08-091-1/+2
| | | | | | | | * lang/cpp/src/context.cpp (Context::encrypt): If no recipients are provided encrypt with NULL and not an empty array. -- Sending an empty array leads to an invalid argument error.
* Cpp: Add EngineInfo::Version classAndre Heinecke2016-07-142-0/+61
| | | | | | * lang/cpp/src/engineinfo.cpp (EngineInfo::engineVersion): New. * lang/cpp/src/engineinfo.h (EngineInfo::engineVersion): Declare. (EngineInfo::Version): Small helper to work with versions.