Commit Graph

17 Commits

Author SHA1 Message Date
Maximilian Krambach
6d720137dd js: update decrypt/verify results
--

* src/gpgmejs.js: Decrypt now parses additional optional dec_info
  information, as well as any verify information, if present

* src/permittedOperations: Now decrypt also expect the new return
  object dec_inf (containing info such as is_mime and file_name)
2018-08-21 15:26:17 +02:00
Maximilian Krambach
dd32daad0b js: add and apply eslint rules
--

* mainly spacing, see .eslintrc.json for details
2018-08-20 15:12:01 +02:00
Maximilian Krambach
74684f24c6 js: decode arriving gpg message strings
--

* Arriving strings (i.e. user id names, error messages) are not
  always in javascript encoding. This is an attempt to go through
  the whole gpgme answer (with the exception of payload data) and
  to fix the encoding of these
2018-08-17 19:20:35 +02:00
Maximilian Krambach
622db0d1de js: consistently return uppercase fingerprint
--

* 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-16 11:25:50 +02:00
Maximilian Krambach
68a012deb3 js: make init export immutable
--

* 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-08-01 12:51:12 +02:00
Maximilian Krambach
94ee0988d4 js: change the write access for js class methods
--
* 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-27 20:36:21 +02:00
Maximilian Krambach
b18b96fb36 js: clean up test extension
--

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-27 11:20:33 +02:00
Maximilian Krambach
e154554e9a js: removed config
--

* There is no use for a configuration at the moment, and it seems
  improbable that this use will arise.
2018-06-11 15:10:43 +02:00
Maximilian Krambach
bfd3799d39 js: code cleanup (eslint)
--
* trying to stick to eslint from now on for readability

* As some attribution was lost in previous git confusions, I added my
  name into some of the licence headers
2018-06-06 13:05:53 +02:00
Maximilian Krambach
0356a667c5 js: implement import/delete Key, some fixes
--

* Keyring.js
   - implemented importKey: importing one or more armored public key
     blocks.
   - implemented deleteKey: deleting a public Key from gpg.

* Key.js renamed property Key.armor to Key.armored

* Helpers.js: toKeyIDArray does not complain anymore if there are no
  keys. Not having Keys in e.g. signing keys in encrypt is legitimate
  and common, the complaints were getting spammy

* Errors.js: gpgme_errors now always pass an optional additional
  message, for easier debugging in minified code

* Connection.js: Fix in gpgme-json responses containing objects

* eslintrc.json: Start using eslint. A cleanup to conform to it is not
  done yet

* Added further tests for the new functionality
2018-06-06 11:57:41 +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
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
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
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
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