Daniel Huigens
6a607c7567
Rename SymEncryptedAEADProtectedDataPacket to AEADEncryptedDataPacket
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
0e33e641af
Switch build system to rollup
...
Also, default to minimized builds.
2021-02-09 19:25:20 +01:00
Ilya Chesnokov
6e648b1cbc
Rename enums to use camelCase ( #1093 )
2021-02-09 19:25:20 +01:00
Ilya Chesnokov
e16807505f
Switch util function names to camelCase ( #1091 )
2021-02-09 19:25:20 +01:00
Ilya Chesnokov
d415bc2546
Rename config option names to camelCase ( #1088 )
2021-02-09 19:25:20 +01:00
larabr
8823603396
Remove worker ( #1072 )
2021-02-09 19:25:20 +01:00
larabr
5ad19c8da8
Generate ECC keys by default ( #1065 )
...
Also, remove the deprecated numBits options of generateKey in favor of rsaBits.
2021-02-09 19:25:20 +01:00
Daniel Huigens
2bc24f354b
Return only one key in key.read[Armored], add readAll[Armored]
2021-02-09 19:25:20 +01:00
Daniel Huigens
3817cca3c6
Throw on unarmored messages with garbage data appended
2021-02-09 19:25:20 +01:00
Daniel Huigens
76a8f11780
Don't mutate key in openpgp.encryptKey/decryptKey
2021-02-09 19:25:20 +01:00
Daniel Huigens
9394fec1f4
Throw in openpgp.initWorker if worker failed to load
2021-02-09 19:25:20 +01:00
Daniel Huigens
ef7c38860b
Don't unnecessarily return objects in top-level functions
...
openpgp.encrypt, sign, encryptSessionKey, encryptKey and decryptKey now
return their result directly without wrapping it in a "result" object.
Also, remove the `detached` and `returnSessionKey` options of
openpgp.encrypt.
2021-02-09 19:25:20 +01:00
Daniel Huigens
3a84442b5f
Don't use native streams in old Edge
2021-02-09 19:25:20 +01:00
Daniel Huigens
2fffc76060
Don't overwrite Web Streams Polyfill to globals
...
Instead, use the ponyfill that's now included in web-stream-tools.
Also, convert back to native ReadableStream when we used the ponyfill.
2021-02-09 19:25:20 +01:00
Daniel Huigens
95eb43a3c2
Return data
instead of message
in encryptSessionKey
...
Add `armor=true/false` parameter to decide whether `data` is an armored
String or an unarmored Uint8Array.
2021-02-09 19:25:20 +01:00
Daniel Huigens
08d6b276e3
Return data as string in openpgp.verify by default
...
Add format='utf8'/'binary' param to openpgp.verify in order to be able
to return binary data instead.
2021-02-09 19:25:20 +01:00
Daniel Huigens
7225251af8
Return Uint8Array(Stream) instead of object when armor = false
2021-02-09 19:25:20 +01:00
larabr
38ec5314d4
Fix ElGamal param range and PKCS1 decoding ( #1169 )
...
* Fix ElGamal sampling range
* Stricter PKCS1 decoding
2021-01-20 14:09:52 +01:00
larabr
cc1bdcbae8
Allow decryption with revoked keys ( #1135 )
...
However, when decrypting session keys, check that the public key
algorithm matches that of the decryption key.
2020-08-18 15:49:27 +02:00
larabr
14f244a80f
Fix decryption tests
2020-07-17 15:14:21 +02:00
larabr
00c5f38689
Cipher-specific key validation ( #1116 )
...
Also, check binding signatures for decryption keys.
Also, do not always fallback on Web Crypto ECC errors.
2020-07-13 19:57:33 +02:00
Daniel Huigens
5d71ae8691
Fix normalizing \n after \r\n
...
Broken in c4a7455
.
2020-04-22 19:09:50 +02:00
Daniel Huigens
8c3bcd1f21
Reject signatures using insecure hash algorithms
...
Also, switch from returning false to throwing errors in most verify*()
functions, as well as in `await signatures[*].verified`, in order to be
able to show more informative error messages.
2020-02-25 15:06:15 +01:00
Daniel Huigens
dc9660f2ae
Add tests with old and new Blowfish encrypted messages
2020-02-02 16:51:56 +01:00
Daniel Huigens
6ae6012786
Terminate workers in openpgp.destroyWorker()
2020-01-24 17:57:39 +01:00
Daniel Huigens
2cc3262149
Fix test failing on high-core-count systems due to AEAD concurrency
2019-10-15 18:38:02 +02:00
Daniel Huigens
fbbeaa3cd9
Rename numBits
and bits
to rsaBits
( #970 )
...
Keep supporting the old names as well though in `openpgp.generateKey`
and `getAlgorithmInfo`, but not in `openpgp.key.generate` (as it is
recommended that developers use `openpgp.generateKey` instead, and
it now throws when using `numBits` instead of `rsaBits`, so there's
no risk of silent key security downgrade).
The old names are now deprecated, and might be removed in v5.
2019-09-18 13:40:44 +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
a184ef6ec4
Remove support for the previous draft00 AEAD
2019-08-12 17:46:37 +02:00
Daniel Huigens
80c535eeb7
Separate config option to use V5 keys from AEAD config option
2019-08-12 17:46:37 +02:00
Daniel Huigens
735d6d088f
Implement V5 signatures
2019-08-12 17:46:37 +02:00
Daniel Huigens
9166d6737c
Don't babelify ES6 in unit tests when testing in modern browsers
2019-07-19 19:06:19 +02:00
Daniel Huigens
10cbd307c3
Add test for throwing on armor modifications
2019-07-19 19:05:26 +02:00
Daniel Huigens
34e6eacb2f
Don't attempt to use workers if they fail to load
2019-05-02 12:08:08 +02:00
Daniel Huigens
a9599fea42
Work around go crypto bug in ECDH messages ( #869 )
2019-03-04 13:53:19 +01:00
Daniel Huigens
1dd168e7a2
Fix ECDH message encryption for some session keys
2019-02-05 13:46:59 +01:00
Daniel Huigens
d91b064e14
Optimize util.removeTrailingSpaces ( #848 )
...
Backtracking regexes have pathological worst-case performance when
a long line contains a large amount of whitespace not followed by
a newline, since the regex engine will attempt to match the regex
at each whitespace character, read ahead to the non-whitespace non-
newline, declare no match, and try again at the next whitespace.
E.g. try running
util.removeTrailingSpaces(new Array(1e6).join(' ') + 'a').length
which would hang V8.
2019-01-27 00:22:47 +00:00
Daniel Huigens
77055f6dfe
Don't zero-copy transfer buffers in Safari 11.1 and Chrome < 56
...
See https://bugs.webkit.org/show_bug.cgi?id=184254
and https://bugs.chromium.org/p/chromium/issues/detail?id=334408 .
2019-01-15 20:16:59 +01:00
Daniel Huigens
fe69cb882d
Zero-copy transfer buffers when passing streams to workers
2019-01-09 15:18:59 +01:00
Daniel Huigens
08f48bfc2c
Switch to seek-bzip
2018-11-05 12:49:53 +01:00
Daniel Huigens
13c29b1fc9
Fix decryption with multiple passwords
2018-11-01 11:46:27 +01: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
d1626a7a51
Disable some tests on Sauce Labs
...
Since we still run the full test suite on Node.js, this would
only no longer catch bugs which are specific to
- Browser non-draft04 GCM (and don't manifest in draft04 GCM,
and don't manifest in Node.js non-draft04 GCM)
- Browser OCB (which is not natively implemented in the browser)
- Browser V5 Keys
2018-08-14 17:24:40 +02:00
Daniel Huigens
9bf7bbf45e
Don't generate a new key for each encryption mode in tests
2018-08-14 17:24:39 +02:00
Daniel Huigens
67b067b1da
Remove duplicate tests
...
Many tests would run for every encryption mode, or for both V4 and V5 keys,
without there being any difference between the different test runs.
`grunt coverage` before and after this commit reports almost identical
statistics, providing some confidence that no code coverage was lost.
2018-08-14 17:24:39 +02:00
Daniel Huigens
8c7e4386af
Fix stream-reading zero-length (partial) packets
2018-08-14 17:19:54 +02:00
Daniel Huigens
052fa444be
Support Node streams
2018-08-14 17:19:54 +02:00
Daniel Huigens
0ddff3ae7d
Rename asStream
to streaming
...
Also, break up `postProcess`.
2018-08-14 17:19:51 +02:00
Daniel Huigens
b35b167e63
Add openpgp.cleartext.fromText
...
For symmetry with message.fromText
2018-08-14 16:35:41 +02:00