aboutsummaryrefslogtreecommitdiffstats
path: root/lang (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-08-16js: simplify getDefaultKeyMaximilian Krambach1-11/+7
-- * src/Keyring.js: In case no default Key is set in configuration, only Keys reported as having a secret part should be considered for default Keys, avoiding some extra requests.
2018-08-16js: consistently return uppercase fingerprintMaximilian Krambach4-2/+51
-- * src/Key.js: the fingerprint returned by a Key is now always upper case hex, even if the constructor had lower case input. This is to be more consistent with gpgme and to be more readable and reliable in comparisions.
2018-08-13Symmetric exampleBen McGinnes1-2/+2
* lang/python/examples/howto/symcrypt-file.py: *sigh*; passphrase was right the first time, just the error check that wasn't. * I really should stop second guessing myself one of these days ... Signed-off-by: Ben McGinnes <[email protected]>
2018-08-13Symmetric encryption exampleBen McGinnes1-4/+4
* lang/python/examples/howto/symcrypt-file.py: Fixed the error code and the passphrase key word arg.
2018-08-13Symmetric encryption example.Ben McGinnes1-0/+63
* lang/python/examples/howto/symcrypt-file.py: A variation on standard key based encryption.
2018-08-10PEP8 compliance and other code fixesBen McGinnes10-130/+220
* Ran all the .py files in src/ and below through Yapf. * Included some manual edits of core.py, this time successfully making two notorious sections a bit more pythonic than scheming. * Left the module imports as is. * This will be committed if it passes the most essential test: compiling, installing and running it. Signed-off-by: Ben McGinnes <[email protected]>
2018-08-09Link fixesBen McGinnes2-18/+18
* lang/python/README: Fixed links in both versions of the README.
2018-08-08cpp: Fix use after free in gencardkeyinteractorAndre Heinecke1-5/+4
* lang/cpp/src/gpggencardkeyinteractor.cpp (GpgGenCardKeyInteractor::Private::keysize): Change to string. -- The value is only required as string so we can save it this way to avoid the need to convert it for the action command. GnuPG-Bug-Id: T4094
2018-08-06Make GNUPGHOME for tests overridableAndre Heinecke2-2/+4
* lang/python/tests/Makefile.am, lang/qt/tests/Makefile.am, tests/Makefile.am, tests/gpg/Makefile.am, tests/gpgsm/Makefile.am, tests/opassuan/Makefile.am (GNUPGHOME): Make variable explict. -- If the build directory has too long path, gpgme could fail. This is similar to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=847206 In order to fix that, this patch extracts the GNUPGHOME variable to be presented directly in the Makefile and thus overridable by command line option. A build system can then create a symlink to the GNUPGHOME directory in /tmp and use that symlink as the GNUPGHOME directory thus making the path very short. GnuPG-Bug-Id: T4091 Patch provided by vlmarek
2018-08-01js: make init export immutableMaximilian Krambach4-4/+102
-- * src/index.js: The export now uses a freezed Object, which does not allow for simply overwriting the init method by e.g. a third-party library. * BrowsertestExtension: Added some tests trying if decryption of bad data properly fails
2018-07-31js: fix confusion about loop in last commitMaximilian Krambach1-2/+1
-- * The aim is to iterate through the results of the first request (all keys), and then add the propert 'hasSecret' to those that are in the second request (secret Keysring) as well. I messed this up in a recent change, and it escaped testing.
2018-07-31js: Fix Key.hasSecret answerMaximilian Krambach2-5/+7
-- * The comparision result between Keyring and Keyring with secrets was set to the wrong Object which was not returned at all.
2018-07-30js: Making objects inmutableMaximilian Krambach9-24/+47
-- * An Object.freeze should stop any malicious third party from changing objects' methods once the objects are instantiated (see unittest for an approach that would have worked before) - An initialized gpgmejs- object doesn't have a '_Keyring' property anymore (it still has its 'Keyring') - The internal expect='base64' needed to be turned into a method.
2018-07-27js: fix indentaionMaximilian Krambach6-1138/+1150
-- * doing the indentation changes that became neccesary in the last commit.
2018-07-27js: change the write access for js class methodsMaximilian Krambach11-394/+403
-- * src/ [Connection, Error, Key, Keyring, MEssage, Signature, gpgmejs]: Functions and values that are not meant to be overwritten are now moved into their constructors, thus eliminating the possibility of overwrites after initialization. * Key: The mode of use (synchronous cached, or async promises) ivs now determined at initialization of that Key. The property Key.isAsync reflects this state. * unittests: fixed old Key syntax for testing. * Message.js isComplete is now a method and not a getter anymore. * Added some startup tests.
2018-07-27js: clean up test extensionMaximilian Krambach7-453/+417
-- Tests will now run with one instance of gpgmejs each block, which reduces overhead. Readability is (hopefully) improved), some negative tests are added. There is still a performance problem in base64 encoding/decoding, which causes some tests to fail due to time out.
2018-07-24js: include armored Key in import callbackMaximilian Krambach2-3/+32
-- * The import answer now also directly contains the armored Key as Key property, without need to refresh the Key object created in the answer. This allows for direct comparision of input and output. * BrowserTestExtension: added test for that import callback
2018-07-24js: Fix wrong encoding in received error messagesMaximilian Krambach1-1/+2
-- * The libgpg error strings arrive in the browser in a different encoding than used by browsers. Escaping and then decoding it should cover most languages in the supported browsers.
2018-07-24cpp: Add safety checks for key updateAndre Heinecke2-1/+4
* lang/cpp/src/key.cpp (Key::update): Check that the key is not NULL. * lang/cpp/src/verificationresult.cpp (GpgME::Signature::key): Check for fingerprint.
2018-07-22docs: python bindings howtoBen McGinnes1-170/+169
* Fixed and tested the changes necessary for org-mode to correctly parse pythonic (Python 3) indentation. * Updated the source blocks to recommended upper case for BEGIN_SRC and END_SRC. * Tested and confirmed XHTML output matches correct examples. * Tested against pseudo-control output via exporting from org-mode to org-mode and then exporting that to XHTML. Remaining differences appear to be discarding the custom tags used to provide X[HT]ML id elements to each section which does not appear to offer any benefit. * Exporting directly to XHTML or other HTML output should no longer cause problems, but if there are any then the first step should be exporting from org-to-org and then exporting that to XHTML. Tested-by: Ben McGinnes <[email protected]> Signed-off-by: Ben McGinnes <[email protected]>
2018-07-22doc: python bindings howtoBen McGinnes1-624/+623
* Another retrofitting of the HOWTO Python example code, this time following adjustments to python-mode configuration and having trawled through the org-mode mailing lists for clues.
2018-07-22doc: python bindings howtoBen McGinnes1-0/+1
* Added org-mode byline.
2018-07-20js: repair BrowserTextExtension testMaximilian Krambach1-8/+8
-- * the signed message to verify was signed by a wrong test key
2018-07-19cpp: Print origin and last update for key/uidAndre Heinecke1-0/+4
* lang/cpp/src/key.cpp: Print origin and last update in iostream operators.
2018-07-18js: typo in commentMaximilian Krambach1-1/+1
-- * Documentation typo that caused jsdoc to exit with an error
2018-07-18qt: Handle encoding for diagnosticsAndre Heinecke1-1/+53
* lang/qt/src/threadedjobmixin.cpp (fromEncoding) (stringFromGpgOutput): New helpers. (markupDiagnostics): Use it. -- The Problem is that on my western windows system GnuPG gets CP 437 as GetConsoleOutputCP and prints in that codepage. In a W32 GUI Application we get 0 as GetConsoleOutputCP and 1252 with GetACP. The only thing that seemed to somehow match was GetOEMCP but that might just be luck and it might still be broken in other windows languages. This code is also used in Kleopatra so it might make sense to make it public once it is demonstrated that it works on most systems.
2018-07-17js: fix getkeys with locate optionMaximilian Krambach1-2/+4
-- * src/Keyring.js: As locate will not work with the "secret" option, the first message cannot be reused, thus a new one must be created here
2018-07-13python bindings: example scriptsBen McGinnes2-2/+2
* Fixed incorrect mention of output prompt referencing secret keys when the scripts are only for exporting public keys in whole or minimised forms.
2018-07-12js: allow optional Key retrieve pattern to be nullMaximilian Krambach1-2/+2
-- * src/Keyring.js: If the optional "pattern" parameter is not to be used, but another, following parameter is, null is more of a convention in javascript, thus both null and undefined are interpreted as "this parameter is not meant to be set".
2018-07-12js: add with-sec-fprs to getKeysArmoredMaximilian Krambach3-15/+60
-- * Reflects the changes made to gpgme-json in commit 6cc842c9aa76d19448141e5117ac59452d7a1ff3. - getKeysArmored now returns an object with property 'armored' being the exported armored block, and an (optional) array of fingerprint strings for those keys that can be used in sign/encrypt operations as property 'secret_fprs'. With this, extensions such as mailvelope will be able to bulk fetch all necessary key information in one request.
2018-07-10js: documentationMaximilian Krambach11-234/+456
-- * Fixed errors: - src/Message.js post(): Set chunksize to defined default value instead of hardcoded - src/Keys.js: added getHasSecret() to refreshKey operation. * Reviewed and updated the documentation * non-documentation changes which do not affect functionality: - src/Errors: disabled a console.warn that is only useful for debugging - helpers.js: renamed "string" to "value" in isFingerprint and isLongId to avoid confusion - src/Keyring: prepare_sync, search are both explicitly set to false by default
2018-07-10example scripts: python work-aroundsBen McGinnes1-3/+3
* fixed three typos which were guaranteed to break said script.
2018-07-09docs: python bindings howtoBen McGinnes1-1251/+1235
* Complete typographic overhaul. * Removed all section level indentation since it does not affect output formatting, but might affect source code examples. * In text-mode stripped out all tabs which had crept in and replaced them with four spaces. * Updated all code examples (again) to conform with Python-mode. * Bumped version number in preparation for next release of GPG 2.2.9 and corresponding GPGME release.
2018-07-09js: fix verify result reportingMaximilian Krambach3-2/+88
-- * src/Signature.js: searching for overall validity in the "summary" property * BrowsertestExtension: Added two verify tests
2018-07-09js: reduce request spam at getKeys()Maximilian Krambach3-25/+46
-- * Don't make a secret-Key request for each Key retrieved, use one request for all of them instead, and assemble the info later. This should reduce the traffic with large Keyrings. The bulk retrieval for the public armored Keys for each of these Keys is still up to discussion * unittests: disabled assertion for the armored key (as it currently doesn't work) * encryptTest: clarified the mechanism/reason of rejection for Messages >64 MB. This is still a TODO, as this error comes from a different place (the browser itself) and behaves different from the other errors.
2018-07-07python bindings: howto examplesBen McGinnes13-67/+71
* Made sure all example scripts meet PEP8 compliance. * Required fixing approx. a dozen of them in minor ways.
2018-07-05qt: Handle OpenPGP Diagnostic logAndre Heinecke1-5/+27
* lang/qt/src/threadedjobmixin.cpp (_detail::audit_log_as_html): Handle OpenPGP audit log differently.
2018-07-05cpp: Add enum mapping for GPGME_AUDIT_LOG_DIAGAndre Heinecke2-0/+5
* src/context.cpp (to_auditlog_flags): Map DIAG value. * src/context.h (AuditLogFlags): Add it.
2018-07-04js: properly reject pgp message without signatureMaximilian Krambach1-1/+1
-- * A verify at gpgme-json does not fail if there is a valid pgp message that does not include a signature. Instead, the answer will be devoid of signatures. In javascript, the SIG_NO_SIG error should be reported here, but wasn't.
2018-07-04js: Add jsdoc, update webpack-cli dependencyMaximilian Krambach8-78/+123
-- * package.json: - the old webpack-cli version depended on two packages with vulnerabilities, set to minimum version 3.0.8 to fix this (nodesecurity.io/advisories/157, nodesecurity.io/advisories/612) - added License identifier * README: Updated documentation * jsdoc.conf: Added a configuration file for jsdoc * some minor documentation changes, indentations
2018-07-04cpp: Fix memory of DecryptionResult::symkeyAlgoAndre Heinecke1-0/+7
* lang/cpp/src/decryptionresult.cpp (Private, ~Private): strdup the symkey algo.
2018-07-04js: add Key lookupMaximilian Krambach4-4/+33
-- * src/Keyring.js: getKeys() now has the option "search", which will trigger a remote lookup (as configured in gpg) for the string given as pattern. * src/permittedOperations: make use of the new 'locate' option in keylist * DemoExtension: Add a button for lookup, to demonstrate the functionality
2018-07-03js: fixing Key import/export testMaximilian Krambach3-13/+87
-- * BrowserTestExtension: - The KeyImport/Export test had some errors, which have now been fixed - The secret key used for the test examples is now placed more prominently, and a clarification added that decrypt tests will not work if this key is not imported. * permittedOperations.js: typo Thanks to [email protected] for the fixes
2018-07-01python bindings: scheming serpentsBen McGinnes1-69/+17
* Apparently I am wrong and Scheme is the new Python after all. * Non-import related PEP8 compliance must wait for another day, though the other PEP8 fixes remain.
2018-07-01python bindings: gpg.coreBen McGinnes1-27/+79
* Changed id/else statements to a more pythonic form from scheme masquerading as python - sorry Justus, it had to go ;). * With the added bonus of enabling PEP8 compliance in those sections. * Fixed remaining PEP8 compliance issues with the exception of the imports at the beginning of the file (changing those will break the entire module, so we'll cope with it as it is).
2018-06-29python bindings: python 3.7Ben McGinnes4-6/+11
* Bindings confirmed to work with the newly released 3.7.0. * Updated M4 file to reflect this change and correct the Python binary search order (3.7 is not yet given priority, but will still be found first via the more generic python3 executable). * Updated setup.py.in, bindings documentation and README to reflect this.
2018-06-28whitespace police:Ben McGinnes1-2/+2
* There's always one or, in this case, two.
2018-06-28docs: python bindings howtoBen McGinnes1-0/+358
* Updated official doc (the org-mode file) with the instructions on importing and exporting both public and secret keys.
2018-06-28python bindings examplesBen McGinnes1-0/+110
* Added a secret key export variant which saves output as both GPG binary and ASCII armoured, plus saves in $GNUPGHOME and uses multiple methods of determining what that location is.
2018-06-28python bindings examplesBen McGinnes1-0/+73
* Added a key import variant which accesses the SKS keyservers in a RESTful fashion and then imports or attempts to import the response.