Commit Graph

25 Commits

Author SHA1 Message Date
Daniel Huigens
4a8fffdfdf Remove KeyRing class
Keyring handling and storage should be handled in the application, as
localStorage may not meet the durability requirements of the
application, for example.
2021-03-01 11:58:10 +01:00
Daniel Huigens
7203e6afb6 Move WKD client to openpgpjs/wkd-client 2021-03-01 01:02:16 +01:00
Daniel Huigens
43f0724aeb Move HKP client to openpgpjs/hkp-client 2021-02-28 22:59:16 +01:00
larabr
7f37a8aaca
Add config parameter to top-level functions (#1241)
Refactor functions to take the configuration as a parameter.

This allows setting a config option for a single function call, whereas
setting `openpgp.config` could lead to concurrency-related issues when
multiple async function calls are made at the same time.

`openpgp.config` is used as default for unset config values in top-level
functions.
`openpgp.config` is used as default config object in low-level functions
(i.e., when calling a low-level function, it may be required to pass
`{ ...openpgp.config, modifiedConfig: modifiedValue }`).

Also,

- remove `config.rsaBlinding`: blinding is now always applied to RSA decryption
- remove `config.debug`: debugging mode can be enabled by setting
  `process.env.NODE_ENV = 'development'`
- remove `config.useNative`: native crypto is always used when available
2021-02-26 20:04:54 +01:00
larabr
8854b097b4 Use native BigInt when available instead of bn.js (#1119)
In the lightweight build, lazily load bn.js only when necessary.

Also, use Uint8Arrays instead of strings in PKCS1 padding functions, and
check that the leading zero is present when decoding EME-PKCS1 padding.
2021-02-09 19:25:20 +01:00
Daniel Huigens
0e33e641af Switch build system to rollup
Also, default to minimized builds.
2021-02-09 19:25:20 +01:00
Ilya Chesnokov
08b7725b8c Create lightweight build that can lazily load indutny/elliptic if needed (#956)
This PR adds four config options to configure whether and how to load
indutny/elliptic: use_indutny_elliptic, external_indutny_elliptic,
indutny_elliptic_path and indutny_elliptic_fetch_options.

Also:

- Use tweetnacl.js instead of indutny/elliptic for curve25519 key generation

- Don't initialize indutny's curve25519, improving performance when using that curve

- Verify NIST signatures using Web Crypto instead of indutny/elliptic when not streaming

- Move KeyPair.sign/verify to ecdsa.js

- Move KeyPair.derive to ecdh.js

- Move keyFromPrivate and keyFromPublic to a new indutnyKey.js file
2019-10-25 16:07:57 +02:00
Daniel Huigens
9b5124d5cd
Switch from Sauce Labs to Browserstack (#965)
* Switch from Sauce Labs to Browserstack

* Don't run all tests on CI
2019-09-16 14:59:06 +02:00
Daniel Huigens
0a5461b8ba Split Sauce Labs JS unit tests into multiple parts for slow browsers
Sauce Labs has a timeout of 5 minutes (including emulator/browser
startup time).
2018-09-10 19:27:13 +02:00
Daniel Huigens
9853d3d830 Streaming encryption (Web) 2018-08-10 14:44:01 +02:00
Wiktor Kwapisiewicz
043e77a6ea
Add Web Key Directory lookup
This change implements Web Key Directory lookup using user's e-mail
address. The target host is the same as the e-mail's domain and the
local-part is hashed with SHA-1 and encoded using Z-Base32 encoding.

Implemented is basic flow of version 06 of OpenPGP Web Key Directory
draft [0].

It was necessary to update node-fetch package to allow returning array
buffers from HTTP responses.

If openpgpjs is used in the browser all keys retrieved from Web Key
Directory should have `Access-Control-Allow-Origin` header set to `*`
(including 404 Not found responses).

[0]: https://datatracker.ietf.org/doc/draft-koch-openpgp-webkey-service/
2018-05-29 21:21:24 +02:00
Mahrud Sayrafi
944dece506
Adds Brainpool Curves + tests + docs 2018-03-18 10:12:29 -07:00
mmso
8808fdb8ed
Fix #607 - Add support for bzip2 de/compression 2018-02-14 14:14:07 +01:00
Mahrud Sayrafi
a4134b9f55
Addresses various review comments by @bartbutler + some cleanups 2018-01-31 17:52:38 -08:00
Mahrud Sayrafi
3129e7c4e3 Adds X25519 tests and updates README.md 2018-01-30 18:35:29 +01:00
Ismael Bejarano
075d7f8e0e Encrypt, decrypt, sign and verify with elliptic curve certificates 2018-01-30 18:30:14 +01:00
Ismael Bejarano
01be192a35 Object identifier type 2018-01-30 18:30:13 +01:00
Tankred Hase
707b3919e1 Move most test high lvl api test code to test/openpgp.js, cleanup 2016-02-10 15:07:05 +07:00
Tankred Hase
128a95ace4 rearrange test order and fix web worker detection 2016-02-10 06:38:35 +07:00
Tankred Hase
a44e1e5024 Write tests for new api: openpgp.generateKey 2016-02-08 19:32:42 +07:00
Tankred Hase
c7a6a88098 Add type validation util functions 2016-02-08 13:36:21 +07:00
Tankred Hase
6634abf326 Add basic HKP lookup and upload support 2015-12-11 13:12:34 +07:00
Thomas Oberndörfer
329c92bc73 OP-01-009 Cleartext Messages Spoofing by Lax Armor Headers parsing (Critical). Add armor header verification. Verify "Hash" header in cleartext signed message. 2014-03-21 15:37:52 +01:00
Robert Nelson
3beb4ac0ad Started porting crypto tests 2014-01-03 08:10:50 -08:00
Robert Nelson
e5e1675615 Port general tests to chai/mocha 2014-01-02 19:47:04 -08:00