Commit Graph

2293 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
8e5fe1da4f Remove config.keyserver 2021-03-01 11:43:13 +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
Daniel Huigens
fa3c36fc87 Remove unused devDependencies 2021-02-28 21:58:30 +01:00
Daniel Huigens
e959602a94 Switch packages installed from git to @openpgp scope 2021-02-28 21:45:21 +01:00
Daniel Huigens
9bb65bd1c3 Update web-stream-tools 2021-02-28 21:25:58 +01:00
Daniel Huigens
9e85f75519 Don't mark async function as returning a Promise explicitly
It seems redundant.
2021-02-28 01:47:48 +01:00
Daniel Huigens
2ba04d9f0a Document parameters of Message.fromText/fromBinary 2021-02-28 01:47:48 +01:00
Daniel Huigens
174086a011 Default to empty filename 2021-02-28 01:47:48 +01:00
Daniel Huigens
21e3ba4653 Clean up JSDocs 2021-02-28 00:32:02 +01:00
Daniel Huigens
e2eadd09e4 Fix documentation of top-level function parameters 2021-02-27 23:37:41 +01:00
Daniel Huigens
a50cb9c6b7 Don't include date in documentation
To reduce diffs for each release.
2021-02-27 22:29:08 +01:00
Daniel Huigens
365a5efb63 5.0.0-0 2021-02-27 01:25:52 +01:00
Daniel Huigens
ab419179bc Remove TextEncoder/TextDecoder polyfills
Also, drop support for Node.js 10.
2021-02-27 01:22:13 +01:00
Daniel Huigens
3a42b45ab7 Remove unused config/localStorage module 2021-02-27 01:22:13 +01:00
Daniel Huigens
636c7cf529 Update documentation 2021-02-27 01:22:13 +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
15ee659c9c
Exit with error on unhandled rejections in Node tests (#1251) 2021-02-26 12:46:41 +01:00
Ali Cherry
2000388a80
Return subkey binding signature in SubKey#verify (#1250)
Also, update TypeScript definitions.
2021-02-25 12:58:54 +01:00
Daniel Huigens
ca248ba1a8 CI: Bump browser test timeout 2021-02-24 23:00:25 +01:00
larabr
95dd81381f
CI: Update browser targets (#1249) 2021-02-24 18:15:57 +01:00
Daniel Huigens
e1307b88d0
Consolidate read* functions (#1236)
Make all `read*` functions accept an options object, so that we can add config
options to them later (for #1166). This is necessary so that we can remove the
global `openpgp.config`, which doesn't work that well when importing
individual functions.

Furthermore, merge `readMessage` and `readArmoredMessage` into one function,
et cetera.
2021-02-17 20:36:33 +01:00
Ali Cherry
9ae0aae7a2
Add options to select encryption/signing key IDs (#1238) 2021-02-17 20:06:31 +01:00
Daniel Huigens
b6edfe646b Lint all tests (#1235) 2021-02-12 23:00:22 +01:00
Daniel Huigens
8f8517702e Remove Travis badge 2021-02-12 21:29:24 +01:00
Daniel Huigens
4bff80bc9c Switch to karma-mocha-reporter 2021-02-12 21:13:39 +01:00
Daniel Huigens
ce983e5a2d Switch from Travis to GitHub Workflows (#1234) 2021-02-12 21:13:19 +01:00
Daniel Huigens
01be7b7ec1
CI: Switch to karma for browser tests (#1233)
This should fix the false positives (failures to detect errors).
2021-02-12 13:29:04 +01:00
larabr
051f5ec8cf
BigInteger: throw if modular inverse doesn't exist (#1228) 2021-02-10 14:23:59 +01:00
larabr
ca092c7cd0 Speed up decryptKey and encryptKey (#1192)
Change `openpgp.decryptKey` and `openpgp.encryptKey` to avoid deep cloning the
original key.
2021-02-09 19:25:20 +01:00
larabr
66c06dab3e Check if any (sub)key is decrypted in Key.prototype.isDecrypted (#1182)
`key.isDecrypted()` now returns true if either the primary key or any subkey
is decrypted.

Additionally, implement `SecretKeyPacket.prototype.makeDummy` for encrypted
keys.
2021-02-09 19:25:20 +01:00
larabr
c23ed58387 Require User IDs to be objects; refactor UserIDPacket (#1187)
- `openpgp.generateKey` now expects `userIds` in object format
  (strings are no longer supported)
- Remove `util.parseUserId` and `util.formatUserId`
- Replace `UserIDPacket#format` with `UserIDPacket.fromObject`
2021-02-09 19:25:20 +01:00
larabr
724775816f Add explicit key type parameter in openpgp.generateKey (#1179)
- Changes `openpgp.generateKey` to accept an explicit `type` parameter,
  instead of inferring its value from the `curve` or `rsaBits` params
- Introduces `config.minRsaBits` to set minimum key size of RSA key generation
2021-02-09 19:25:20 +01:00
larabr
92887a0948 Revert to disabling AEAD encryption by default (#1190) 2021-02-09 19:25:20 +01:00
larabr
801430f969 Revert to generating v4 keys by default (#1189) 2021-02-09 19:25:20 +01:00
larabr
2ee36c2984 Drop inconsistent boolean returns and fix type definitions (#1191)
- Remove the boolean return value of various internal functions that throw on
  error (the returned value was unused in most cases)
- Update and fix type definitions
2021-02-09 19:25:20 +01:00
larabr
89f738da45 Fix EOL in streaming tests 2021-02-09 19:25:20 +01:00
larabr
286d991265 Fix parsing of short P-521 keys and EdDSA, RSA signatures (#1185)
Also, strip leading zeros when serializing MPIs, as per the spec.
2021-02-09 19:25:20 +01:00
larabr
c34dede6de Use \n instead of \r\n for EOL when armoring (#1183) 2021-02-09 19:25:20 +01:00
larabr
4efeac3ad1 Unexport low-level key functions (#1188) 2021-02-09 19:25:20 +01:00
Tom J
c5aa647e31 Add TypeScript definitions (#1186) 2021-02-09 19:25:20 +01:00
Dan Ristea
fe51f97b79 Re-enable linting in CI (#1160) 2021-02-09 19:25:20 +01:00
Daniel Huigens
4c15724caf Appease linter 2021-02-09 19:25:20 +01:00
Daniel Huigens
c2146ce165 Fix CI for older environments 2021-02-09 19:25:20 +01:00
Daniel Huigens
1f1ffedaf4 [v5] Update asmcrypto.js; fix CI (#1178) 2021-02-09 19:25:20 +01:00
Daniel Huigens
2382482090 [v5] Unexport openpgp.util, openpgp.crypto, and low-level types (#1175) 2021-02-09 19:25:20 +01:00
larabr
479d826533 Remove armor comment and version by default (#1170) 2021-02-09 19:25:20 +01:00
Marco
ad7d654f2b Fixed description of generateSessionKey (#1165) 2021-02-09 19:25:20 +01:00
Daniel Huigens
6df714a708 Add openpgp/lightweight to npm build 2021-02-09 19:25:20 +01:00