Commit Graph

781 Commits

Author SHA1 Message Date
Ben McGinnes
48e946a96d docs: python bindings howto
* Fixed the groups.py script so it really does what is described (the
  old code had the same result for groups, group_lines and
  group_lists).
* Updated the corresponding example in the doc to match.
2018-05-25 05:50:11 +10:00
Ben McGinnes
9038d30017 doc: python bindings howto
* Fixed org-mode python source indenting.
** Note: nested indented blocks do not indent correctly when exported
   to [X]HTML.
2018-05-25 05:50:11 +10:00
Maximilian Krambach
a4ba80c553 js: adding sign method
--

  * src/gpgmejs.js: method, update in src/permittedOperations
  * basic testing in BrowsertestExtension
2018-05-24 15:16:18 +02:00
Maximilian Krambach
e38b8beb20 Merge branch 'master' into javascript-binding 2018-05-24 14:03:09 +02:00
Maximilian Krambach
f7ed80ff6a js: remove openpgp mode
--

* After discussion, that mode is not required, and can result in
  being quite misleading and a maintenance hassle later on.
2018-05-23 12:56:23 +02:00
Ben McGinnes
3a9e6a8e08 docs and examples: python howto
* Updated the decryption example code in the HOWTO and the
  corresponding decrypt-file.py script to gracefully handle a
  decryption failure.  This error will always be triggered when GPGME
  is used to try to decrypt an old, MDC-less encrypted message or
  file.
2018-05-23 14:43:06 +10:00
Maximilian Krambach
ecad772635 js: transfer encoding changes
--

* Uint8Arrays are not supported for now there are unsolved issues in
  conversion, and they are lower priority

* encrypt gains a new option to indicate that input values are base64
  encoded
* as decrypted values are always base64 encoded, the option base64 will
  not try to decode the result into utf, but leave it as it is
2018-05-22 14:24:16 +02:00
Andre Heinecke
28e3778ce2
cpp: Expose sessionKey and symkeyAlgo
* lang/cpp/decryptionresult.cpp, lang/cpp/decryptionresult.h
(DecryptionResult::symkeyAlgo, DecryptionResult::sessionKey): New.
2018-05-22 12:08:01 +02:00
Maximilian Krambach
6b4caee039 js: Testing lare messages
--

* Some assumption on messages were wrong. Now the tests use more
  reasonable sizes.
* bigString now uses the full utf8-extent, with the exception of
  U+0000. This code gets dropped during the encryption-decryption
  process.
2018-05-14 19:02:49 +02:00
Maximilian Krambach
d1ca90ef75 js: remove non-browser tests
--

* The majority of tests needs to be run in a nativeMessaging context.
  Offering the few tests that don't need this context at two places
  introduces issues with maintainability. All tests now removed can be
  found in ./unittests.js
2018-05-14 16:36:05 +02:00
Maximilian Krambach
987b317468 js: Tests and improvements for openpgp mode
--

* Added openpgp - Mode tests to the browsertest Extension. These tests
  require openpgp, which should not be a hard dependency for the main
  project. Packing openpgpjs into the extension is still TODO

* Fixes:
  - openpgp mode API now correctly handles parameters as an object,
    similar to openpgpjs
  - proper check and parsing of openpgpjs Message Objects
2018-05-14 16:23:24 +02:00
Maximilian Krambach
c92326cc25 js: more testing of nativeMessaging connection
--

* There were some inconsistencies between utf-8, transfer and browsers'
  utf16, which broke characters that were split between individual
  messages. src/Connection now contains a workaround that reassembles
  javascripts' format from passed base64 strings. This needs someone
  more experienced looking.
* Added several new tests which were failing during initial debugging
  of this issue
* reorganized BrowsertestExtension to avoid cluttering.
2018-05-09 19:40:57 +02:00
Maximilian Krambach
5f5bf024a8 Merge branch 'master' into javascript-binding 2018-05-09 16:55:50 +02:00
Maximilian Krambach
cca40627b0 js: more testing
--

* Tests: Under certain circumstances, some data change during
  encrypt-decrypt. Committing the current state so the problem can be
  discussed.

* Fixes:
  - disconnecting the test ports after tests are complete
  - fixed passing of the error message from gpgme-json
2018-05-08 18:33:41 +02:00
Maximilian Krambach
8f3d83e5f0 js: fixing errors found by testing: encrypt/decrypt
--

* Key.js: Error code for wrong parameter in createKey should be
  "PARAM_WRONG"
* Helpers.js: The property openpgpjs-like Objects were checked for in
  toKeyIdArray was not defined.
* src/permittedOperations.js: updated more expectations and assumptions
  for the native API

* new Problems:
  - There seems to be a message size limit of about 21 MB for
    nativeMessaging, much lower than the documented 4GB.
  - Some bytes are lost with random data in an encrypt-decrypt
    roundtrip. The culprit is unclear.
2018-05-07 18:27:25 +02:00
Ben McGinnes
46da79e3de python: key expiration datetime stamp tests
* Changed the expiration date for the generated test key to NYE this
  century, rather than the NYE this millennium as originally suggested
  in job #3815.
* This covers the lifetimes of current users (except, maybe, some very
  healthy millennials) as well as the 32-bit clock end date in 2038;
  without falling foul of OpenPGP's 2106 expiration.
2018-05-05 12:27:17 +10:00
Maximilian Krambach
cf075846fb js: fixing errors found by testing
--

* Key.js: Error code for wrong parameter in createKey should be
  "PARAM_WRONG"

* Helpers.js: The property openpgpjs-like Objects were checked for in
  toKeyIdArray was not defined.

* src/permittedOperations.js: updated more expectations and assumptions
  for the native API
2018-05-04 12:56:59 +02:00
Andre Heinecke
26820ba629
qt: Respect --disable-gpg-test for tests
* lang/qt/Makefile.am: Respect --disable-gpg-test

--
This is similar to the core switch to disable the tests.
2018-05-04 10:03:42 +02:00
Maximilian Krambach
c755287ba8 js: Added browser testing for unit tests
--

* Added unittests to be run inside a Browser. To be able to access
  the non-exposed functions and classes, a testing bundle will be
  created, containing the tests (unittests.js) and the items to be
  tested.
* src/Helpelpers, src/Key, src/Keyring: fixed some errors found
  during testing.
2018-05-03 18:03:22 +02:00
Maximilian Krambach
6f67814eb4 js: changed Key class stub
--

* src/Key.js:
  A Key object cannot offer more than basic functionality outside a
  connection, so it now requires a connection to be present.
2018-05-03 14:12:10 +02:00
Maximilian Krambach
fda7b13f1b js: more testing
--

* Tests: initialization of the two modes, encryption

* gpgme.js: reintroduced message check before calling
  Connection.post()

* gpgmejs_openpgp.js: Fixed openpgp mode not passing keys

* index.js: fixed some confusion in parseconfig()

* Inserted some TODO stubs for missing error handling
2018-04-27 20:03:09 +02:00
Maximilian Krambach
eb7129f319 js: fixed empty operation setter in Message
--

* src/Message.js Messages failed because they were not assigned
  operations
2018-04-27 10:21:13 +02:00
Maximilian Krambach
f45b926816 js: fixed wrong paths in DemoExtension
--

* Some forgotten internal links after the move to a subdir and cleaning
2018-04-26 17:59:40 +02:00
Maximilian Krambach
1f7b19512c js: created TestExtension and smaller fixes
--

* Extensions:

  - Moved testapplication to Demoextension
  - Created BrowserTestExtension.
    Includes mocha and chai. For running tests that cannot be run
    outside a WebExtension

  Both Extensions can be found zipped in build/extensions after
  running build_extensions.sh

* Code changes:
  - src/Config: Place for the configuration
  - small fixes raised during testing in Keyring.js, Message.js,
  - src/gpgmejs_openpgpjs.js don't offer direct GpgME object to the
    outside, as it only causes confusion
  - index.js init() now checks the config for validity

* Tests:
  - Reordered tests in test/.
  - Input values are now in a separate file which may be of use for
    bulk testing

* moved the build directory from dist to build
2018-04-26 17:13:34 +02:00
Andre Heinecke
6b267c56fd
qt: Fix filename handling in cryptoconfig
* src/qgpgmenewcryptoconfig.cpp (QGpgMENewCryptoConfigEntry::urlValue):
Build url from local file.
(QGpgMENewCryptoConfigEntry::setURLValue): Set native seperated
path.

--
This fixes setting files through cryptoconfig on Windows.
GnuPG-Bug-Id: T3939
2018-04-26 14:11:19 +02:00
Maximilian Krambach
3685913bf5 js: First testing and improvements
--

* Introduced Mocha/chai as testsuite. After development build
  'npm test' should run the unit tests. Functionality exclusive to
  Browsers/WebExtensions cannot be run this way, so some other testing
  is still needed.

  - package.json: Added required development packages
  - .babelrc indirect configuration for mocha. ES6 transpiling
    needs some babel configuration, but mocha has no setting for it.
  - test/mocha.opts Vonfiguration for mocha runs

* Fixed errors:
  - Helpers.js toKeyIdArray; isLongId is now exported
  - Key.js Key constructor failed
  - Message.js will not throw an Error during construction, a new
    message is now created with createMessage, which can return an
    Error or a GPGME_Message object

* Tests:
  - test/Helpers: exports from Helpers.js, GPGME_Error handling
  - test/Message: first init test with bad parameters
2018-04-25 19:45:39 +02:00
Maximilian Krambach
1fb310cabe js: Configuration and Error handling
--

* gpgmejs_openpgpjs
  - unsuported values with no negative consequences can now reject,
    warn or be ignored, according to config.unconsidered_params
  - cleanup of unsupported/supported parameters and TODOS

* A src/index.js init() now accepts a configuration object

* Errors will now be derived from Error, offering more info and a
  stacktrace.

* Fixed Connection.post() timeout triggering on wrong cases

* Added comments in permittedOperations.js, which gpgme interactions
  are still unimplemented and should be added next
2018-04-25 15:59:36 +02:00
Maximilian Krambach
5befa1c975 js: reactivate timeout on connection
--
* A timeout of 5 seconds is activated for functions that do not require
  a pinentry. This definition is written to src/permittedOperations.js
* testapplication.js now alerts the proper error codes and messages.
* src/Errors.js fixed two typos in error handling
2018-04-25 11:32:21 +02:00
Maximilian Krambach
c72adc0096 js: change in Error behaviour
--

* Error objects will now return the error code if defined as error type
  in src/Errors.js, or do a console.log if it is a warning. Errors from
  the native gpgme-json will be marked as GNUPG_ERROR.
2018-04-25 10:54:24 +02:00
Maximilian Krambach
30c47d80a2 js: allow openpgp-like Message objects as Data
--

* src/gpgmejs.js: If a message offers a getText, consider it as the
  message's content
2018-04-25 09:23:38 +02:00
Maximilian Krambach
e2aa8066a9 js: Key object adjustments after discussion
--

* src/aKey.js changed fingerprint to setter (to avoid overwrites)
* src/gpgmejs_openpgpjs.js
  - Added a class GPGME_Key_openpgpmode, which allows for renaming and
    deviation from GPGME.
  - renamed classes *_openPGPCompatibility to *_openpgpmode. They are
    not fully compatible, but only offer a subset of properties. Also,
    the name seems less clunky
2018-04-24 19:29:32 +02:00
Maximilian Krambach
461dd0c8b4 js: change in initialization ancd connection handling
--

* The Connection will now be started before an object is created, to
  better account for failures.
* index.js: now exposes an init(), which returns a Promise of
  configurable <GpgME | gpgmeGpgME_openPGPCompatibility> with an
  established connection.
* TODO: There is currently no way to recover from a "connection lost"
* Connection.js offers Connection.isConnected, which toggles on port
  closing.
2018-04-24 18:44:30 +02:00
Maximilian Krambach
727340b295 js: don't allow message operation changes
--

Once an operation is changed, their set of allowed/required parameters
will change. So we shouldn't set/change the operation later.
2018-04-23 19:15:40 +02:00
Maximilian Krambach
d62f66b1fb js: Key handling stubs, Error handling, refactoring
--

* Error handling: introduced GPGMEJS_Error class that handles errors
  at a more centralized and consistent position
* src/Connection.js:
  The nativeMessaging port now opens per session instead of per
  message. Some methods were added that reflect this change
  - added methods disconnect() and reconnect()
  - added connection status query
* src/gpgmejs.js
  - stub for key deletion
  - error handling
  - high level API for changing connection status
* src/gpgmejs_openpgpjs.js
  - added stubs for Key/Keyring handling according to current
    state of discussion. It is still subject to change
* src/Helpers.js
  - toKeyIdArray creates an array of KeyIds, now accepting
    fingerprints, GPGMEJS_Key objects and openpgp Key objects.
* Key objects (src/Key.js) Querying information about a key
  directly from gnupg. Currently a stub, only the Key.fingerprint is
  functional.
* Keyring queries (src/Keyring.js): Listing and searching keys.
  Currently a stub.
2018-04-23 17:18:46 +02:00
Maximilian Krambach
6ab25e40d9 js: encrypt improvement and decrypt method
* Compatibility class gpgme_openpgpjs offers an API that should accept
  openpgpjs syntax, throwing errors if a parameter is unexpected/not
  implemented
* tried to be more generic in methods
* waiting for multiple answers if 'more' is in the answer
* more consistency checking on sending and receiving
* updated the example extension
--
2018-04-20 15:24:13 +02:00
Maximilian Krambach
94f21d9f6b Merge branch 'master' into javascript-binding 2018-04-20 15:23:57 +02:00
Andre Heinecke
d65d632931
cpp: Add origin and last_update to UserID
* NEWS: Mention it.
* lang/cpp/src/key.cpp, lang/cpp/src/key.h (UserID::lastUpdate),
(UserID::origin): New.
(gpgme_origin_to_pp_origin): New helper.
2018-04-19 11:56:15 +02:00
Andre Heinecke
0adaf7bafd
cpp: Add origin and last_update
* NEWS: mention interface change.
* lang/cpp/src/key.cpp (Key::origin, Key::lastUpdate): New.
* lang/cpp/src/key.h (Key::Origin): New enum.
2018-04-19 10:46:34 +02:00
Werner Koch
67b4dafb6d
doc: Update copyright years and change two URLs.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2018-04-18 19:30:50 +02:00
Tobias Mueller
bbfa7c4233
python: Fix crash by leaving struct members intact
* lang/python/setup.py.in: Copy gpgme.h instead of parsing it.
--
The python bindings tried to parse deprecated functions
out of gpgme.h. This fails for the current gpgme.h in
that it removes an entire field in the key sig struct (_obsolete_class).
Hence, the fields were off by an int and the bindings accessed struct
members via the wrong offset. That caused python program to crash.
At least on 32bit platforms, the crash can be easily triggered by
accessing key.uids[0].signatures. On 64bit platforms the compiler
probably aligns the struct so that the missing 4 bytes are not noticed.

With this change, the python bindings will expose all functions
that gpgme exposes, including the deprecated ones.

Credits go to Justus Winter for debugging and identying the issue.

Signed-off-by: Tobias Mueller <muelli@cryptobitch.de>
GnuPG-bug-id: 3892
2018-04-17 10:20:12 +02:00
raimund.renkert@intevation.de
eef3a509fa
js: Initial commit for JavaScript Native Messaging API
--

Note this code misses all the legal boilerplate; please add this as
soon as possible and provide a DCO so we can merge it into master.

I also removed the dist/ directory because that was not source code.
2018-04-10 18:47:59 +02:00
Andre Heinecke
5eb261d602
qt: Add test for resetting config value
* lang/qt/tests/t-config.cpp (CryptoConfigTest::testDefault): New.

--
There is a bug around here somewhere. This test does not show
it :-(
2018-04-04 11:21:53 +02:00
Ben McGinnes
fed024eff1 Merge branch 'master' of ssh+git://playfair.gnupg.org/git/gpgme
* Also fixed a small grammatical error highlighted by a merge conflict
  (in the python bindings howto).
2018-03-30 10:38:31 +11:00
Ben McGinnes
3b91f6af37 example: revoke UID
* Script to revoke a UID on an existing key.
2018-03-29 10:21:52 +11:00
Ben McGinnes
d65864989c docs: python bindings howto
* Added section on revoking UIDs.
2018-03-29 10:16:07 +11:00
Ben McGinnes
56bbfd39ac example: key signing
* Added script for signing or certifying keys.
2018-03-29 09:49:08 +11:00
Ben McGinnes
5a553f5a31 doc: python bindings howto
* Fixed a typo.
2018-03-29 09:22:17 +11:00
Ben McGinnes
2f507b0459 docs python bindings howto
* PEP8 compliance: a collection of minor edits across multiple example
  code snippets.
2018-03-29 07:22:37 +11:00
Ben McGinnes
5cd4193418 example: add user ID
* Added script to add a UID to an existing key.
2018-03-29 06:36:14 +11:00
Ben McGinnes
a2eedef630 doc: python bindings howto
* Fixed some minor PEP8 compliance issues in the key creation examples.
2018-03-27 12:42:06 +11:00
Ben McGinnes
f9159b1d75 example: key creation
* Script to generate a new key with encryption subkey taking input
  from interactive prompts.
* Will also take a passphrase via pinentry and uses passphrase caching
  of five minutes when used in conjunction with the temp homedir
  script.
2018-03-27 12:29:08 +11:00
Ben McGinnes
1b5da37a47 script: temp homedir config
* added passphrase caching of 5 minutes.
2018-03-27 12:16:29 +11:00
Ben McGinnes
5b32efbaf3 doc: python bindings howto
* Testing the addition of a HTML header set in org-mode in order to
  had RSS update links for files.
* This should work with any [X]HTML export from current versions of
  Org-Mode, but if it also works on website generated pages then it'll
  tick off one of the wishlist itmes.
2018-03-25 22:25:52 +11:00
Ben McGinnes
40a9dea5d5 script: temp homedir
* Fixed whitespace.
2018-03-25 11:54:05 +11:00
Ben McGinnes
3b724aae42 doc: python bindings howto
* Added a reference to new script which will setup a temporary homedir
  for a user.
2018-03-25 11:35:11 +11:00
Ben McGinnes
dde1aae312 script: temporary homedir creation
* Script to create a temporary gnupg homedir in the user's directory
  for testing or scripting purposes.
* Creates a hidden directory on POSIX systems with the correct
  permissions (700).
* Creates a gpg.conf in that directory containing the same
  configuration options as used in the "Danger Mouse" example in the
  HOWTO with the correct permissions (600).
2018-03-25 11:26:26 +11:00
Ben McGinnes
22247f658c doc: python bindings howto
* Fixed the plaintext, result and verify_result references in the
  decryption section.
2018-03-25 10:01:14 +11:00
Ben McGinnes
d0bb4ec4ec Merge branch 'master' of ssh+git://playfair.gnupg.org/git/gpgme 2018-03-25 09:44:51 +11:00
Ben McGinnes
e6180f2b36 doc: python bindings howto
* Fixed a minor spelling error and a minor grammatical error.
2018-03-24 06:41:36 +11:00
Werner Koch
c7bb12da52
Merge branch 'json-tool' 2018-03-23 11:31:20 +01:00
Ben McGinnes
65ed4ac825 doc: python bindings howto
* Fixed table.
2018-03-22 10:06:53 +11:00
Ben McGinnes
5722148bac doc and examples: python bindings HOWTO
* Added GPGME Python bindings HOWTO in Australian/British English.
** en-US "translation" still to be done.
* Added several example scripts comprised of the "Basic Functions"
  section of the HOWTO (plus the work-around at the end).
** As these scripts are very basic examples they are released under
   both the GPLv2+ and the LGPLv2.1+ (just like GPGME itself).

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-03-22 06:37:02 +11:00
Ben McGinnes
76055dd5c7 Merge branch 'ben/docs/2018-03' of ssh+git://playfair.gnupg.org/git/gpgme into ben/docs/2018-03 2018-03-22 06:33:16 +11:00
Ben McGinnes
05e5993305 examples: multi-key selection operations
* Temporarily removing multi-key selection based examples.
* There are a few issues with getting the key selections to play
  nicely with gpg.Context().keylist object types.
* Will troubleshoot them separately and restore them when that's
  worked out, but I don't want these more complicated examples to
  delay merging the HOWTO with master.
2018-03-22 06:19:36 +11:00
Ben McGinnes
61a988036b example: group encryption
* Troubleshooting.
2018-03-22 06:18:13 +11:00
Ben McGinnes
7ddff71908 examples: encryption
* Fixed two incorrect Context() objects.
2018-03-22 06:05:10 +11:00
Ben McGinnes
c6a0395f0a example: key selection
* Removed extraneous blank line.
2018-03-22 05:55:53 +11:00
Ben McGinnes
0a0d57fd41 example: key selection
* Similar to group-key-selection.py, but does not use an existing
  group from gpg.conf; instead takes multiple key IDs, fingerprints or
  patterns on the command line and adds them to a keylist object.
2018-03-22 05:52:55 +11:00
Ben McGinnes
0ccc57c951 example: sign and encrypt to group
* Begins to string together some of the simpler examples to do more
  useful things.
* Signs and encrypts a file while encrypting to every key in a group
  specified in the gpg.conf file.
2018-03-22 05:40:02 +11:00
Ben McGinnes
8b401bfc76 example: group key selection
* Example of preparing a keylist object using an existing group line
  from the gpg.conf file.
2018-03-22 05:20:51 +11:00
Ben McGinnes
6c6af9a7b0 example groups work around
* Updated usage so it only references importing the final list of
  lists produced.  Trying to use some of the mid-points can have
  unpredictable results (this is part of the problem with work
  arounds).
2018-03-22 05:07:56 +11:00
Ben McGinnes
a4e3f82765 example: groups
* Added a docstring.
2018-03-22 04:04:05 +11:00
Ben McGinnes
ad6cb4f9b8 example: verify signatures
* Added example for verifying detached signatures against the files
  they're the signatures for.
2018-03-22 03:58:58 +11:00
Ben McGinnes
ae2767eb27 example: verify signed file
* Added example to verify normal and clearsigned files.
2018-03-22 01:50:08 +11:00
Ben McGinnes
e57388a69f doc: python bindings howto
* Fixed minor error in one of the verification examples.
2018-03-22 01:48:41 +11:00
Ben McGinnes
ac6a552c37 example: detach sign file
* Added example to make detached signatures of a file with key selection.
2018-03-22 01:30:32 +11:00
Ben McGinnes
af6cbba18b example: encrypt-sign-file.py
* Adjusted the doc string.
2018-03-22 01:26:43 +11:00
Ben McGinnes
6fa2a34428 examples: doc strings
* Fixed minor errors in two doc strings.
2018-03-22 01:24:52 +11:00
Ben McGinnes
1fdd1f306d example: clear signing
* Added example to clear sign a file with signing key selection.
2018-03-22 01:18:37 +11:00
Ben McGinnes
1d2746433c doc: python bindings howto
* deconstructed and fixed all three signing methods.
2018-03-22 01:12:36 +11:00
Ben McGinnes
0390ede186 example: sign file
* Similar to encrypt file except for signing a file in normal mode.
* Noticed additional changes to be made to the howto to match this,
  but they will have to wait due to a power outage (currently running
  on battery and a mobile connection, but that won't last).
2018-03-21 12:28:03 +11:00
Werner Koch
44f9e80ea9
Merge branch 'master' into json-tool 2018-03-20 11:13:14 +01:00
Ben McGinnes
52e262991f doc: python bindings howto
* Fixed typos in examples.
2018-03-20 14:57:26 +11:00
Ben McGinnes
96d0395bcc example: keycount
* Fixed missing parenthesis.
2018-03-20 14:55:05 +11:00
Ben McGinnes
51258975d7 example: decrypt file
* Decrypts a file taking file names as command line parameters.
2018-03-20 14:32:53 +11:00
Ben McGinnes
29e918171f example: groups work-around
* Added groups selection work around code.
* Intended for use as a module to be imported by other scripts,
  usually with "from groups import group_lists" or "from groups import
  group_lines" or similar.
2018-03-20 14:19:16 +11:00
Ben McGinnes
7221bb6764 example: encrypt file
* Nested encryption in try/except statement in case recipient key is
  untrusted or invalid.
2018-03-20 09:53:27 +11:00
Ben McGinnes
f3fe47e8fd example: sign and encrypt file
* Example to sign and encrypt a file.
* Similar to encrypt-file.py except all keys are considered trusted
  and signs with the default key.
* Also encrypts to the default key.
2018-03-20 09:47:39 +11:00
Ben McGinnes
f0790f224d example: encrypt file
* Fixed typo in second encryption call.
2018-03-20 09:39:48 +11:00
Ben McGinnes
7ab42e79ad example: encrypt file
* Example to encrypt a file to a single key.
* Takes key ID and/or fpr as a CLI parameter.
* Takes path and filename as a CLI parameter.
* Encrypts to specified key only, no signing and writes the output in
  both ASCII armoured and GPG binary formats with output filenames
  based on input filename.
2018-03-20 09:25:34 +11:00
Ben McGinnes
cfbdcb7fb3 example: python bindings key count
* Added script wo count the number of keys in both the public and
  secret key stores.
2018-03-20 08:55:01 +11:00
Ben McGinnes
b30ebf8972 doc: python bindings examples
* Explicitly stated that all this code is released under the GPLv2+
  and the LGPLv2.1+.
2018-03-20 08:39:49 +11:00
Ben McGinnes
8f7672ad1b doc: python bindings example README
* Added the same license as used with the HOWTO.
* Since these examples are so basic, they'll be dual licensed the same
  as GPGME itself (otherwise it would slip too dangerously against the
  need for permissive licensing of crypto libraries).
2018-03-20 08:31:53 +11:00
Ben McGinnes
6950a63e63 docs: python bindings examples
* Added reference to location where all the examples included in the
  HOWTO will be available as executable scripts.
* Included a short README file in that location.
2018-03-20 08:26:57 +11:00
Ben McGinnes
3e0f68fdff example: python bindings encryption
* Since we don't want to encourage accessing the low level functions
  (e.g. op_encrypt), but since this example can still be useful to
  understand, renaming it and will add new encryption examples to
  match the instructions in the HOWTO.
2018-03-20 08:07:22 +11:00
Ben McGinnes
d5f6dec048 doc: python bindings howto
* Slight python-gnupg clarification.  See also this thread:
  https://lists.gnupg.org/pipermail/gnupg-devel/2018-March/033528.html
2018-03-19 15:03:00 +11:00
Ben McGinnes
0fb8a5d45c doc: python bindings howto
* Adjusted the python-gnupg so the comments regarding insecure
  invocation of commands via subprocess (shell=True) were a major
  historical issue and not a a current issue.
* Not including Vinay Sajip's requested change to say it is now secure
  since no audit of the current code base has been performed and my
  last major inspection of that code was around the time I first
  ported PyME to Python 3 in 2015.
2018-03-19 13:09:46 +11:00
Ben McGinnes
bf67cf433f doc: python bindings todo list
* Checked off several points of howto coverage as completed.
* Reorganised to move S/MIME coverage to its own separate group of tasks.
* Noted only revocation remains for howto completion.
2018-03-19 12:46:41 +11:00
Ben McGinnes
1779d7b9d6 doc: python bindings howto
* deconstructing multi-recipient encryption.
2018-03-19 10:39:53 +11:00
Ben McGinnes
64c5886132 doc: python bindings howto
* Replaced the single encryption methods with one main way (i.e. cut
  the low level stuff involving SEEK_SET instructions).
2018-03-19 10:00:44 +11:00
Ben McGinnes
4811ff7b6c doc: python bindings howto
* moved single encrytion examples up to the first ones, pending merge
  and major cut.
* This is basically just to make future checks of revisions a little easier.
2018-03-19 08:49:17 +11:00
Ben McGinnes
82c5af225f doc: python bindings howto
* Stripped decryption example to the bare bones as suggested by Justus.
2018-03-19 08:43:36 +11:00
Ben McGinnes
b549f69d05 doc: python bindings howto
* Made the changes suggested by Jakub Wilk on gnupg-devel.
* Still need to make the far more comprehensive changes suggested by Justus.
2018-03-17 03:46:02 +11:00
Werner Koch
d2b31d8c10
json: Add framework for the gpgme-json tool
* src/gpgme-json.c: New.
* src/Makefile.am (bin_PROGRAMS): Add gpgme-json.
(gpgme_json_SOURCES, gpgme_json_LDADD): New.

Signed-off-by: Werner Koch <wk@gnupg.org>
2018-03-16 13:55:48 +01:00
Ben McGinnes
431897a4c4 doc: python bindings howto
* Added clarification on why it's not on PyPI.
2018-03-16 03:52:58 +11:00
Andre Heinecke
ad95288d3b
cpp: Expose skipped_v3_keys
* lang/cpp/src/importresult.cpp,
 lang/cpp/src/importresult.h (ImportResult::numV3KeysSkipped): New.

--
GnuPG-Bug-Id: T3776
2018-03-15 16:23:18 +01:00
Ben McGinnes
22e2445bee doc: python bindings howto
* fixed custom_id for decryption so the XHTML validates.
2018-03-16 01:48:56 +11:00
Ben McGinnes
94a95ac123 doc: python bindings howto
* Promoted final encryption example so that it will appear as heading
  6.1.3 when exported to HTML or PDF.
2018-03-16 01:34:22 +11:00
Ben McGinnes
3d0c7a2202 doc: python bindings howto
* Fixed a minor typographic error.
* Bumped version number in preparation for merge with master.
* While there are probably a few more things worthy of being added
  (mainly how to revoke things), this document is essentially ready
  for publication now.

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-03-15 16:13:34 +11:00
Ben McGinnes
961aea212e doc: python bindings howto
* Added key signing.
2018-03-15 15:51:01 +11:00
Ben McGinnes
7ac65b1083 doc: python bindings howto
* Added a new user ID for Danger Mouse.
* Removed the empty entry for key preferences since that is handled
  through gpg.conf and/or editing the key directly.
2018-03-15 15:16:23 +11:00
Ben McGinnes
9e3e4a835c doc: python bindings howto
* Spell checking and fixing the few errors.
2018-03-15 14:59:36 +11:00
Ben McGinnes
b02d9d0a7b doc: python bindings howto
* Added an encryption subkey to Danger Mouse's primary key.
2018-03-15 14:43:44 +11:00
Ben McGinnes
5432e5f9d1 doc: python bindings howto
* generated a new primary key for Danger Mouse in an alternative homedir.
2018-03-15 14:01:30 +11:00
Ben McGinnes
5d1dd2abe5 doc: python bindings howto
* Added sections for key generation and key editing.
2018-03-15 12:27:45 +11:00
Ben McGinnes
1d05e6aa4e doc: python bindings howto
* Added c.get_key instructions and examples.
2018-03-15 12:14:29 +11:00
Ben McGinnes
b35aaef7a3 doc: python bindings howto
* Added text for verifying signatures.
2018-03-15 11:18:02 +11:00
Ben McGinnes
6bc12a0eeb doc: python bindings howto
* Added 4 signature verification methods and partial text for them.
2018-03-15 07:20:31 +11:00
Ben McGinnes
e5c85fba25 doc: python bindings howto
* Added description for detached signatures.
2018-03-15 04:07:57 +11:00
Ben McGinnes
ada059b071 doc: python bindings howto
* Fixed multiple sample code examples of writing output to a file.
* Added the description of detached signatures.
2018-03-15 03:51:51 +11:00
Ben McGinnes
ef27f3781a doc: python bindings todo
* minor phrasing fix.
2018-03-14 20:40:50 +11:00
Ben McGinnes
423fdcd465 doc: python bindings howto
* Added recommended method of single encryption with description.
2018-03-14 20:36:30 +11:00
Ben McGinnes
a71205dc3b doc: python binding howto
* Clarified which English dialects this is written in.
* Translating to American can happen *after* it's done.
** The Yank version would probably want to change some of the examples
   anyway.
* Began the description for normal/default signing.
2018-03-14 02:40:41 +11:00
Ben McGinnes
a10dcb4f13 doc: python bindings howto
* Added a section on key selection.
* Included recommendation for using fingerprint when selecting one
  specific key.
* Also included the most ironically amusing example of multiple key
  selection in a GPG guide.  Hey, it's public data ... (heh).
2018-03-14 02:21:44 +11:00
Ben McGinnes
952b6042f7 doc: python bindings howto
* Added explanation of the ascendance of Python 3 over Python 2 in the
  guide to the intro.
* Expanded key selection description so people know what not to
  include regarding key IDs with this key selection method.
2018-03-14 01:41:21 +11:00
Ben McGinnes
c92da2c7eb doc: python bindings howto
* Added key selection for specifying signing key or keys.
2018-03-13 19:20:44 +11:00
Ben McGinnes
e489ddd08a doc: python bindings howto
* During the course of working out the updated signature methods,
  determined that key selection (including counting) will beed to be
  presented before the basic functions.
* Moved "working with keys" up.
2018-03-13 18:32:30 +11:00
Ben McGinnes
f29bda8d71 doc: python bindings howto
* Signatures have changed as a result of the recent update from Justus.
* Sample code updated.
* Text to follow later.
2018-03-13 15:03:11 +11:00
Ben McGinnes
c27a7a3f99 doc: python bindings howto
* Added text description for the decryption example.
2018-03-13 11:50:38 +11:00
Ben McGinnes
f81adeba99 doc: python bindings howto
* Added a miscellaneous work-arounds section at the end.
* Included code in said miscellaneous section for accessing the groups
  specified in a gpg.conf file.
* It's a bit ugly since it does require subprocess (but not call,
  Popen or shell access and only accesses one command).
2018-03-13 08:26:22 +11:00
Ben McGinnes
36dfbdffea doc: python bindings howto
* Fixed a spelling error in the key counting text.
2018-03-13 07:49:42 +11:00
Ben McGinnes
484e9a6229 doc: python bindings howto
* updated multi-encryption final example to be complete.
* second example shows most likely method of reading plaintext.
* updated example filenames to stick with running gag
  (i.e. secret_plans.txt).
2018-03-13 07:42:04 +11:00
Ben McGinnes
a8f48b6f57 doc: python bindings howto
* error corrections.
* multiple typesetting fixes only required due to certain archaic
  eccentricities of LaTeX.
* a couple of minor python PEP8 compliance corrections.
2018-03-13 06:09:53 +11:00
Ben McGinnes
83b1336cee doc: python bindings howto
* Fixed an error in the encryption try/except statement.
2018-03-13 05:42:50 +11:00
Ben McGinnes
0e1300ce77 doc: python bindings howto
* Added a more complicated encryption example with a few variations on
  the encryption method to account for untrusted recipient keys,
  signing or not signing, including or excluding default keys and so
  on.
2018-03-13 04:55:44 +11:00
Ben McGinnes
7ebc5a3570 doc: python bindings howto
* Switched from links to some external docs to using footnotes where
  necessary.
* Ideally the howto should be as stand alone as possible.
* Also it makes it difficult to convert to another format for
  proof-reading if there are links that the conversion can't find.
2018-03-13 00:33:11 +11:00
Ben McGinnes
172baaf4d3 doc: python bindings HOWTO
* Added instructions and code to count the number of public and secret
  keys available since it was quick and easy.
2018-03-09 20:45:14 +11:00
Ben McGinnes
f2c1e8d8d5 doc: python TODO list
* Slightly tweaked one heading to make it clear it wasn't a duplicate.
2018-03-09 20:44:02 +11:00
Ben McGinnes
0168646394 doc: python bindings howto
* Wrote the text description explaining each step in the most basic
  encryption operation.
* Will need to include additional examples for encrypting to multiple
  recipients using Context().encrypt instead of Context().op_encrypt.
2018-03-09 16:49:05 +11:00
Ben McGinnes
93252df9dc doc: python bindings TODO list
* Updated to reflect the most recent work on the HOWTO for the Python
  bindings.
2018-03-09 15:27:40 +11:00
Ben McGinnes
ab81c2d868 doc: python bindings howto
* Added example for verifying both detached and "in-line" signatures.
2018-03-09 15:22:24 +11:00
Ben McGinnes
fa4927146b docs: python bindings howto update.
* Added all four signing code examples that are most likely to be
  used: armoured, clearsigned, detached armoured and detached binary.
* May remove some examples and just discuss the differences, but it
  depends on the way the text is filled out.
2018-03-09 07:53:57 +11:00
Ben McGinnes
c767a4a359 doc: python bindings howto update
* Added example of decryption.
* included some quick notes for myself regarding aspects to explain
  when I flesh out the explanatory text.
2018-03-09 05:25:49 +11:00
Ben McGinnes
75463d5895 doc: Basic operation of the python bindings
* Added sample code for encrypting some text to a single key.
* Basically I'm just lifting existing production code and changing the
  key IDs from mine to "0x12345678DEADBEEF" for these first few
  examples.
* I'll fill in the text description after.
* Note: due to my regional location, I might split some tasks into
  more commits in order to be sure no work gets lost in case of
  emergency (or to put it another way: I know Telstra too well to
  trust them).
2018-03-09 04:42:41 +11:00
Ben McGinnes
a98f2c556f doc-howto: fundamental aspects of GPGME vs Python
* Added a section for those pythonistas who are too used to web
  programming.  Stressed that it's not simply not RESTful, it's not
  even REST-like.
* Letting me move on to drawing a very loose parallel between a
  session and a context.  The differences should become obvious in the
  subsequent sections.
2018-03-08 15:23:05 +11:00
Ben McGinnes
e8adab68f8 doc: Added multiple TODOs for inclusion in the HOWTO
* Some instructions to include are fairly obvious; as with encryption,
  decryption and signature verification.
* Some are a little less obvious.
* This includes the requests received to specifically include subkey
  management (adding and revoking subkeys on a primary key that's
  being retained.
* Added the UID equivalents to the list, as well as key selection
  matters (and may or may not include something for handling group
  lines since that involves wrapping a CLI binary).
* Key control documentation and examples requested by Mike Ingle of
  confidantmail.org.
2018-03-08 14:13:00 +11:00
Ben McGinnes
47d401d159 GPL compatible license for documentation
* Added the same, slightly modified GPL based license that is used in
  other parts of GnuPG.
2018-03-07 21:27:54 +11:00
Ben McGinnes
8a76deb11e HOWTO update
* removed one bit of whitespace.
* Marked up references to gpgme.h.
* Fixed one spelling error.
* Removed py2.6 from python search order since even if it is
  supported, it shouldn't be encouraged.
2018-03-07 20:12:26 +11:00
Ben McGinnes
5215d58ae2 GPGME Python bindings HOWTO
* Started work on the GPGME Python bindings HOWTO.
* 1,050 words to begin with at approx. 7.5KB.
* Got as far as installation.
* Includes instruction not to use PyPI for this.
2018-03-07 20:05:21 +11:00
Ben McGinnes
8f2c0f4534 TODO - HOWTO
* Added suv-entry for the new HOWTO being started and, since it has
  been started, checked it off.
2018-03-07 19:13:37 +11:00
Ben McGinnes
d4778bb23d TODO
* Slightly expanded the list.
2018-03-07 17:56:54 +11:00
Ben McGinnes
c58f61e922 WS removal
* Whitespace removal.
2018-02-26 14:09:38 +11:00
Ben McGinnes
8da63fdee5 Merge branch 'ben/python-docs-01'
* Documentation and the first brush strokes towards the future.

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-02-26 14:04:23 +11:00
Ben McGinnes
6f2e2e0f15 LaTeX headers
* Set LaTeX headers to enable ligatures and a 12pt font by default.
* Paper size left for regional defaults.
* Using XeLaTeX for easier font control.
* Using default LaTeX font of Latin Main, but that's easy enough to change.
2018-02-26 13:51:23 +11:00
Ben McGinnes
272a8e778a Renaming ad infinitum ...
* Dropped the .txt from the end of the file ...
2018-02-20 03:13:42 +11:00
Ben McGinnes
c82b17c6ce Text conversion
* Exported from Org Mode to UTF-8 text.
* Removed my name from just under the title.
2018-02-20 03:11:50 +11:00
Ben McGinnes
ea481d4bb9 Title fix
* Fixed title.
2018-02-20 03:11:02 +11:00
Ben McGinnes
1ae3ead2cd Conflict with Phabricator files
* The developers of Phabricator, the web front-end on dev.gnupg.org
  have not implemented renderers for Markdown, Org-Mode or any other
  common markdown like language.
* They also refuse to do so.
* Instead they re-invented the wheel and implemented their own version
  of Markdown-like thing which is incompatible with everything else.
  It is called Remarkup.
* The developers of Phabricator and Remarkup have refused to provide
  conversion tools to move files to/from any format to/from Remarkup.
* They expect everyone to learn their new favourite pet project.
* Remarkup may or may not display Org Mode files, but if so then it is
  likely to only want to do so as plain text.
* There is an unaffiliated and unofficial project to convert Github
  Markdown to Remarkup via Pandoc.  This might be adapted for our use,
  but requires testing.
* Until then exporting from Org Mode to UTF-8 text is likely the least
  worst plan.
* Which means renaming this file to README.org first.
2018-02-20 02:51:02 +11:00
Ben McGinnes
fe4f3edd70 Schizophrenic file types
* Removed Markdown style heading underlining.
* Removed in-line file type declaration (which is not correctly parsed
  by the web interface on dev.gnupg.org).
2018-02-20 02:45:44 +11:00
Andre Heinecke
7f9d5c6cd2
cpp: Add shorthand for key locate
* lang/cpp/src/key.cpp (Key::locate): New static helper.
* lang/cpp/src/key.h: Update accordingly.
2018-02-16 13:00:49 +01:00
Ben McGinnes
fb16eaa685 History path
* Fixed a typo in a filepath reference.
* Moved conjecture regarding the first version of Python used to a
  footnote.
2018-02-16 19:15:32 +11:00
Ben McGinnes
2b092bf235 Merge branch 'master' of /Users/ben/dev/hgit/mine/gnupg/gpgme/master into ben/python-docs-01 2018-02-16 02:04:57 +11:00
Ben McGinnes
6f15d82140 LaTeX margins
* Added LaTeX header for 1 inch margins in the quite likely event that
  all PDF output ultimately uses LaTeX.
2018-02-16 01:26:20 +11:00
Ben McGinnes
235d899a5f TODO Documentation
* Checked off the decision to stick with Org Mode.
2018-02-15 21:30:32 +11:00
Ben McGinnes
40da502292 TODO
* Beginning to turn the first part of this into something kind of like
  an actual TODO list as Org Mode uses it (maybe).
2018-02-15 21:28:07 +11:00
NIIBE Yutaka
b5ec21b9ba tests: Makefile portability.
* tests/gpg/Makefile.am: Don't use "export" directive.
* tests/gpgsm/Makefile.am: Ditto.
* lang/qt/tests/Makefile.am: Ditto.
* lang/python/tests/Makefile.am: Ditto.

--

GnuPG-bug-id: 3056
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2018-02-15 11:14:49 +09:00
NIIBE Yutaka
c9a351f5af build: More Makefile fix.
* lang/python/tests/Makefile.am: Avoid target with '/'.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2018-02-15 10:27:59 +09:00
Ben McGinnes
3c3b149996 Short History
* Fixed or updated the most fundamental errors.
* Also included some details on which modules are available on PyPI,
  as well as what happened to the PyME commit log.
2018-02-15 04:19:15 +11:00
Ben McGinnes
7c662d22a8 Subsectioned history
* Split the main parts down into subsections.
* Still need to cull the incorrect stuff towards the end and add more
  recent changes.
2018-02-15 01:03:12 +11:00
Ben McGinnes
a1bc710c5f History
* Reshaping the history file to fit Org Mode's structuring for docs.
* Also said history needs to be a bit more clear (it was kind of
  unfinished).
2018-02-14 22:44:27 +11:00
Ben McGinnes
fccd2ea387 TODO
* Updated TODO.
* The entirety of the old TODO has been replaced with either more
  relevant tasks or goals for the examples and a more measured
  approach to the docs and why, in this project, Org Mode trumps reST,
  even though it's Python through and through.
2018-02-14 22:28:50 +11:00
Ben McGinnes
487ed9337e TODO
* Removed reST version of file.
2018-02-14 21:25:45 +11:00
Ben McGinnes
c4fa421619 TODO
* Converted document from reST to org-mode.
2018-02-14 21:24:54 +11:00
Ben McGinnes
1d48b04cfb Short History
* Removed reST version.
2018-02-14 21:23:04 +11:00
Ben McGinnes
d86fd7c54c Short History
* Converted document from reST to org-mode.
2018-02-14 21:21:58 +11:00
Andre Heinecke
7e27a0ff64
cpp: Add SpawnShowWindow flag
* lang/cpp/src/context.h (SpawnShowWindow): New.
2018-02-09 16:11:40 +01:00
Andre Heinecke
5a5b0d4996
cpp: Add conveniance Data::toString
* lang/cpp/src/data.h, lang/cpp/src/data.cpp: Add Data::toString.

--
I'm lazy and like to waste memory.
2018-02-09 16:11:03 +01:00
Andre Heinecke
b61d0fbb74
qt: Don't use QDateTime::toSecsSinceEpoch
* lang/qt/src/qgpgmequickjob.cpp (addSubkeyWorker)
(createWorker): Use toMSecsSinceEpoch instead toSecsSinceEpoch.

--
toSecsSinceEpoch was only introduced in Qt 5.8.
2017-12-11 17:08:38 +01:00
Andre Heinecke
7b5182f288
Spelling fixes for comments and doc
--
Patch provided by ka7 in dev.gnupg.org

Differential D423
2017-12-08 05:59:11 +01:00
Andre Heinecke
1458adaea4
cpp: Fix handling of lsig promotion
* src/gpgsignkeyeditinteractor.cpp (SignKeyState): Add second
CONFIRM state.
(makeTable): Properly handle local_promote_okay.
(action): Handle CONFIRM2.

--
This fixes changing a local signature to a "public" signature.

GnuPG-Bug-Id: T1649
2017-12-07 16:21:01 +01:00
Tobias Mueller
3cf9aedc92
python: Default whence argument for Data() to SEEK_SET.
* lang/python/gpgme.i: copied signature from gpgme.h and defaulted the
value to SEEK_SET.
* lang/python/tests/t-data.py: Added a test for no second argument
--

Having to import the os package when wanting to read a Data object is a
slight annoyance. With SWIG, we can define default parameters. This
change defaults the whence argument to SEEK_SET which is how StringIO
and BytesIO behave.

Signed-off-by: Tobias Mueller <muelli@cryptobitch.de>
2017-12-04 08:10:06 +01:00
Andre Heinecke
7d1ac5d61d
qt: Add job for quick commands
* lang/qt/src/qgpgmequickjob.cpp,
lang/qt/src/qgpgmequickjob.h,
lang/qt/src/quickjob.h: New.
* lang/qt/src/Makefile.am,
lang/qt/src/protocol.h,
lang/qt/src/protocol_p.h,
lang/qt/src/job.cpp: Update accordingly.

--
Keeping it in line with the Job for everything pattern.
Although it's reduced to one job for four commands as
the commands all behave the same.
2017-12-01 14:35:11 +01:00
Andre Heinecke
8e2d6c28a5
cpp: Wrap create_key and create_subkey
* lang/cpp/src/context.cpp,
lang/cpp/src/context.h (Context::startCreateKey)
(Context::createKey, Context::createSubkey)
(Context::startCreateSubkey): New.
2017-12-01 13:21:34 +01:00
NIIBE Yutaka
c441fb7313 tests: Make portability fix.
* lang/python/tests/Makefile.am: Distinguish target and path.
* tests/gpg/Makefile.am: Ditto.
* tests/gpgsm/Makefile.am: Ditto.

--

GNU Make is powerful enough to match path to target (and vice versa),
but BSD make is not.

GnuPG-bug-id: 3056
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-11-21 15:35:10 +09:00
Andre Heinecke
56b27b21d5
qt: Fix IODeviceDataProvider with Process
* lang/qt/src/dataprovider.cpp (blocking_read): Keep
reading if process is not atEnd.

--
This fixes a regression in Kleopatra that uses this dataprovider
to chain the gpgtar process to the encryption / signing.
2017-11-14 14:28:32 +01:00
Andre Heinecke
bd5d470cef
qt: Add test for version info
* lang/qt/tests/t-various.cpp (TestVarious::testVersion): New.

--
If it's not tested it does not work ;-)
2017-09-04 11:25:34 +02:00
Andre Heinecke
58d7bcead3
cpp: Fix version info comparison
* lang/cpp/src/engineinfo.h (EngineInfo::Version::operator<):
Fix logic.
* lang/cpp/src/engineinfo.h (EngineInfo::Version::operator>):
New.
* NEWS: Mention added API

--
This fixes a logic error that 2.2.0 < 2.1.19 would return true.
2017-09-04 11:23:56 +02:00
Alon Bar-Lev
57c1259308
python: Support parallel build in tests
* lang/python/tests/Makefile.am: Depend xcheck with all which was lost
due to the check hack.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
2017-08-21 10:55:10 +02:00
Justus Winter
70c8be9efe
python: Improve keylist test.
* lang/python/tests/t-keylist.py: Check a keylist matching no keys.

Signed-off-by: Justus Winter <justus@g10code.com>
2017-08-21 10:54:10 +02:00
Andre Heinecke
c7be41a5f8
cpp: Fix Key::isDeVs for subkeys
* lang/cpp/src/key.cpp (Key::isDeVs): Check all subkeys.

--
Previosly only the primary key was checked and not all subkeys.
2017-07-26 15:07:55 +02:00
Justus Winter
1e68f93dc5
python: Improve error handling.
* NEWS: Update.
* lang/python/src/core.py (Context.__read__): New helper function.
(Context.encrypt): Attach partial results to exceptions.
(Context.decrypt): Likewise.
(Context.sign): Likewise.
(Context.verify): Likewise.
* lang/python/src/errors.py (GpgError): Move the core of GPGMEError to
this class, add a nicer interface for it.  This makes the errors
thrown by this library more uniform, and allows us to track the
underlying error in synthesized high-level errors.
(GPGMEError): Simplify.
(...): Make sure to call the parent classes' constructor in all other
classes.
--

Attach partial results to errors.  Some operations return results even
though they signal an error.  Of course this information must be taken
with a grain of salt.  But often, this information is useful for
diagnostic uses or to give the user feedback.  Since the normal
control flow is disrupted by the exception, the callee can no longer
return results, hence we attach them to the exception objects.

GnuPG-bug-id: 3271
Signed-off-by: Justus Winter <justus@g10code.com>
2017-07-11 12:28:39 +02:00
Andre Heinecke
fe79eb8de3
Add isDeVs to ostream operator
* lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/verificationresult.cpp: Extend ostream operator
to include isDeVs.
2017-07-10 17:27:24 +02:00
Andre Heinecke
3b9123b4c6
Fix some shadow warnings
--
Warnings in headers hurt downstream.
2017-07-10 17:26:46 +02:00
Andre Heinecke
5c53c70260
cpp: Fix CMake config library name for GPGME
* lang/cpp/src/GpgmeppConfig.cmake.in.in: The link library
is of course also dynamic.

--
GnuPG-Bug-Id: T3181
2017-06-12 15:25:33 +02:00
Justus Winter
05fa2a9c77
Add flag 'is_de_vs' to decryption results and signatures.
* NEWS: Update.
* lang/cpp/src/decryptionresult.cpp (DecryptionResult::isDeVs): New
function.
* lang/cpp/src/decryptionresult.h (DecryptionResult::isDeVs): New
prototype.
* lang/cpp/src/verificationresult.cpp (Signature::isDeVs): New
function.
* lang/cpp/src/verificationresult.h (Signature::isDeVs): New
prototype.
* lang/python/src/results.py (DecryptResult): Turn field 'is_de_vs'
into a boolean.
(Signature): Likewise.
* src/decrypt.c (_gpgme_decrypt_status_handler): Handle the new
compliance status line.
* src/verify.c (_gpgme_verify_status_handler): Likewise.
* src/gpgme.h.in (gpgme_status_code_t): Add new status codes for the
new status lines.
* src/keylist.c (parse_pub_field18): Move function to 'util.h'.
(keylist_colon_handler): Adapt callsites.
* src/status-table.c (status_table): Add new status lines.
* src/util.h (PARSE_COMPLIANCE_FLAGS): New macro.  This used to be
'parse_pub_field18', but turned into a macro to make it polymorphic.
--

When decrypting data and verifying signatures, report whether the
operations are in compliance with the criteria for data classified as
VS-NfD.  This information can the be presented to the user.

GnuPG-bug-id: 3059
Signed-off-by: Justus Winter <justus@g10code.com>
2017-06-01 14:16:11 +02:00
Justus Winter
84a203e60b
python: Fix build in certain cases.
* lang/python/setup.py.in: Prepend the Python build dir to the list of
include directories so that it takes precedence over any other include
directory.
--
Fixes the build in case an older 'gpgme.h' is installed and is picked
up by the compiler when compiling the Python module.

Signed-off-by: Justus Winter <justus@g10code.com>
2017-05-18 12:22:29 +02:00
Justus Winter
6b4dd3b929
python: Fix test environment creation.
* lang/python/tests/Makefile.am (pubring-stamp): Do not depend on the
configuration files, this can trigger superfluous rebuilds.

Signed-off-by: Justus Winter <justus@g10code.com>
2017-05-10 16:19:52 +02:00
Justus Winter
a226eca846
tests: Make sure to kill all previously running daemons.
* lang/python/tests/Makefile.am: Kill all previously running daemons
before creating the private key store.
* lang/qt/tests/Makefile.am: Likewise.
* tests/gpg/Makefile.am: Likewise.
* tests/gpgsm/Makefile.am: Likewise.
--

Now that the daemons sockets are no longer created in the GNUPGHOME,
we cannot rely on cleaning the build directory to make sure they are
shut down.  Therefore, we explicitly kill any running daemons when
creating the test environment.

Signed-off-by: Justus Winter <justus@g10code.com>
2017-05-10 15:52:12 +02:00
Justus Winter
15adff073b
tests: Harmonize test suites.
* lang/python/tests/Makefile.am: Create test environment as part of
'make all'.
* tests/gpg/Makefile.am: Make sure the private keystore is created
first.
* tests/gpgsm/Makefile.am: Create test environment as part of
'make all'.  Make sure the private keystore is created
first.

Signed-off-by: Justus Winter <justus@g10code.com>
2017-05-10 15:49:54 +02:00
Justus Winter
093b5497b7
qt: Stop agent on clean.
* lang/qt/tests/Makefile.am (clean-local): Stop agent.

Signed-off-by: Justus Winter <justus@g10code.com>
2017-05-10 15:23:56 +02:00