Commit Graph

11 Commits

Author SHA1 Message Date
Maximilian Krambach
67b6fa5a29 js: reduce request spam at getKeys()
--

* 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-09 11:24:46 +02:00
Maximilian Krambach
c072675f3f js: change chunksize handling and decoding
--

* the nativeApp now sends all data in one base64-encoded string, which
  needs reassembly, but in a much easier way now.

* there are some new performance problems now, especially with
  decrypting data
2018-06-08 17:54:58 +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
53ce2b94bc js: Keyring listing keys
--

* implementing Keyring methods:

  - Keyring.getKeys: has an additional option that retrieves the armor
    and secret state once at the beginning. This is power hungry, but
    allows for Keys to be used directly (without querying gpgme-json
    each call)
  * permittedOperations.js: reflect recent changes in the native
    counterpart, adding more options
  * Key: adding two methods for retrieving the armored Key block and
    for finding out if the Key includes a secret subkey.
2018-05-28 17:26:56 +02:00
Maximilian Krambach
d4adbf453d js: Treat a connection as a gpgme Context
--

* After an operation a connection should be disconnected again.
  The "end of operation" is now assumed to be either an error as
  answer, or a message not including a "more"

* GPGME, GPGME_Key, GPGME_Keyring don't require a connection
  anymore
* Message.js: The Message.post() method will open a connection as
  required
2018-05-28 16:52:50 +02:00
Maximilian Krambach
7a73d88aba js: implement Key handling (1)
--

* Keys can now be queried for information. Onne version queries gnug
  directly (asynchronous Promise in javascript terms), the cached
  version refreshes on demand.

* Small fixes:
  src/Connection.js joins answers that stay json properly now
2018-05-25 19:02:18 +02:00
Maximilian Krambach
eff27d6387 js: use version operation for connection checks
--

* src/Connection.js: isConnected was renamed to checkConnection, that
  returns a promise with either version information or Boolean
* Connection checks have been adapted to reflect that checkConnection
  returns a Promise
* BrowsertestExtension: tests/signTest.js was missing from my last
  commit
2018-05-25 11:53:24 +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
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
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