Commit Graph

2146 Commits

Author SHA1 Message Date
larabr
479d826533 Remove armor comment and version by default () 2021-02-09 19:25:20 +01:00
Marco
ad7d654f2b Fixed description of generateSessionKey () 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
Daniel Huigens
86238e714e Remove unused functions in tests
These functions are unused since e83bc4b4.
2021-02-09 19:25:20 +01:00
Dan Ristea
331a0c27a9 Store named signature parameters ()
Also, remove the now-unnecessary MPI type.
2021-02-09 19:25:20 +01:00
Dan Ristea
d5dd247b2c Store named session key parameters ()
Change session key parameter handling to mirror key parameters.
Parameters are stored as an object rather than an array. MPIs are
always stored as Uint8Arrays.
2021-02-09 19:25:20 +01:00
Dan Ristea
400ae63c5e Fix minor JSDoc and style issues () 2021-02-09 19:25:20 +01:00
Daniel Huigens
a620fc0276 Don't use unexported low-level functions in tests 2021-02-09 19:25:20 +01:00
Daniel Huigens
b3e08fdc26 Don't export default objects / namespaces
Import individual functions, instead.
2021-02-09 19:25:20 +01:00
Daniel Huigens
f276e1ef51 Export key, message, signature, cleartext functions and classes directly
Instead of as modules.

Replace *.read with read*, *.readArmored with readArmored*, etc.
Replace cleartext.readArmored with readArmoredCleartextMessage.
Replace message.fromText with Message.fromText, etc.
2021-02-09 19:25:20 +01:00
larabr
3a75eadaa0 Store named key params in key objects ()
- Store private and public params separately and by name in objects,
  instead of as an array

- Do not keep params in MPI form, but convert them to Uint8Arrays when
  generating/parsing the key

- Modify low-level crypto functions to always accept and return
  Uint8Arrays instead of BigIntegers

- Move PKCS1 padding to lower level functions
2021-02-09 19:25:20 +01:00
larabr
8854b097b4 Use native BigInt when available instead of bn.js ()
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
Wiktor Kwapisiewicz
fe2949f16d Allow parsing keys without User IDs () 2021-02-09 19:25:20 +01:00
larabr
8d67af729a Use higher level functions in key validation tests ()
Use `key.keyPacket.validate` instead of `crypto.publicKey.validateParams`, see
https://github.com/openpgpjs/openpgpjs/pull/1116#discussion_r447781386.

Also, `key.decrypt` now only throws on error, no other value is returned.

Also, fix typo (rebase error) that caused tests to fail in Safari for p521.
2021-02-09 19:25:20 +01:00
Dan Ristea
10aa1aa5cb JSdoc types & ESLint fixes () 2021-02-09 19:25:20 +01:00
larabr
f6ee6e959e Finish merging key validation 2021-02-09 19:25:20 +01:00
Dan Ristea
b9afd26912 Fix comments on symmetric- and public-key encrypted session keys () 2021-02-09 19:25:20 +01:00
Daniel Huigens
6a607c7567 Rename SymEncryptedAEADProtectedDataPacket to AEADEncryptedDataPacket 2021-02-09 19:25:20 +01:00
Daniel Huigens
17fc32ba51 Appease linter 2021-02-09 19:25:20 +01:00
Daniel Huigens
aea7aa953a Use ES6 classes 2021-02-09 19:25:20 +01:00
Daniel Huigens
fb3d23427d Allow dead code elimination 2021-02-09 19:25:20 +01:00
Daniel Huigens
c20b75252b Add --build-only parameter to filter build outputs
Also, don't generate test bundle by default, but provide
`npm run build-test` instead.
2021-02-09 19:25:20 +01:00
Daniel Huigens
6a3d04ade6 Only produce source maps for minified dist builds 2021-02-09 19:25:20 +01:00
Daniel Huigens
6516602d7b Add shortcut to import 'openpgp/lightweight' 2021-02-09 19:25:20 +01:00
Daniel Huigens
8457639004 CI: for lightweight build, only run tests tagged 'lightweight' 2021-02-09 19:25:20 +01:00
Daniel Huigens
f3b16386dc Use dynamic import in lightweight build
Instead of dynamically loading a <script> tag.

This also removes the non-module lightweight build.
2021-02-09 19:25:20 +01:00
Daniel Huigens
7dbd393071 Remove src and test directory from npm package 2021-02-09 19:25:20 +01:00
Daniel Huigens
f936abec9d Bump Browserstack test to iOS 12 2021-02-09 19:25:20 +01:00
Daniel Huigens
4edd85be69 Drop Node.js 8 support and Travis test
It should still work, but we can no longer test it
because rollup requires Node.js 10+.

Also, remove "allowed failures".
2021-02-09 19:25:20 +01:00
Daniel Huigens
4f77990859 Polyfill globalThis 2021-02-09 19:25:20 +01:00
Daniel Huigens
89923dad17 Remove bower.json 2021-02-09 19:25:20 +01:00
Daniel Huigens
175eac5670 Remove compat polyfills 2021-02-09 19:25:20 +01:00
Daniel Huigens
ed9a029fcf Replace release.sh with npm version scripts 2021-02-09 19:25:20 +01:00
Daniel Huigens
defa1283cb Link to source code on GitHub from documentation
Instead of including the entire source code in the documentation.
2021-02-09 19:25:20 +01:00
Daniel Huigens
0c5598a0fc Replace remaining grunt tasks with npm scripts 2021-02-09 19:25:20 +01:00
Daniel Huigens
cde282d4f1 Replace 'global' with 'globalThis' 2021-02-09 19:25:20 +01:00
Daniel Huigens
5b148089c3 Switch to ES8 build of asmcrypto.js 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
Daniel Huigens
c48070def6 Remove default export 2021-02-09 19:25:20 +01:00
Daniel Huigens
bdad8e3eec Remove dist folder from GitHub 2021-02-09 19:25:20 +01:00
Daniel Huigens
064e813f3f Build OpenPGP.js on local npm install 2021-02-09 19:25:20 +01:00
Ilya Chesnokov
6e648b1cbc Rename enums to use camelCase () 2021-02-09 19:25:20 +01:00
Daniel Huigens
ad33660da8 Fix lightweight build and browserstack test () 2021-02-09 19:25:20 +01:00
Ilya Chesnokov
e16807505f Switch util function names to camelCase () 2021-02-09 19:25:20 +01:00
Ilya Chesnokov
d415bc2546 Rename config option names to camelCase () 2021-02-09 19:25:20 +01:00
Daniel Huigens
63b6d215e3 Allow key.validate() to pass if it has a GNU dummy primary key
A valid signing subkey is required, in this case.
2021-02-09 19:25:20 +01:00
larabr
8823603396 Remove worker () 2021-02-09 19:25:20 +01:00
larabr
85d0358d45 Remove 3DES and CAST5 from default preferred symmetric algorithms () 2021-02-09 19:25:20 +01:00
larabr
20950e5df5 Remove SHA-1 from default preferred hash algorithms ()
Also, remove SHA-1 from the (unused) KDF params constructor defaults.
2021-02-09 19:25:20 +01:00
larabr
5ad19c8da8 Generate ECC keys by default ()
Also, remove the deprecated numBits options of generateKey in favor of rsaBits.
2021-02-09 19:25:20 +01:00