Commit Graph

258 Commits

Author SHA1 Message Date
Daniel Huigens
eb72d4dd63 Don't use asmcrypto's streaming API when not necessary
Optimization for Firefox
2018-08-10 14:46:26 +02:00
Daniel Huigens
ddda6a0b16 Implement cancellation by manually linking together input and output streams 2018-08-10 14:46:24 +02:00
Daniel Huigens
de2971d84a Use TransformStreams 2018-08-10 14:46:24 +02:00
Daniel Huigens
1effe19c1d Allow simultaneously reading data and waiting for signature verification
This makes openpgp.{decrypt,verify}().signatures a Promise when passing a
stream or when asStream=true
2018-08-10 14:46:22 +02:00
Daniel Huigens
56ec5b3a8d Don't keep extra copies of streams in memory 2018-08-10 14:46:22 +02:00
Daniel Huigens
ade2627bca Streaming verify one-pass signatures 2018-08-10 14:44:01 +02:00
Daniel Huigens
802e1b8d94 Transfer Streams to Workers
Also, add a "asStream" parameter to high-level functions to control
whether the return value is a Stream; defaulting to whether the
parameter passed was a Stream.
2018-08-10 14:44:01 +02:00
Daniel Huigens
37014ecf30 Pass more tests
- Allow leading spaces in headers (since we were already accepting
leading spaces everywhere else in the armored text).
- Read ReadableStreams before passing them to a Worker
2018-08-10 14:44:01 +02:00
Daniel Huigens
db39e616ca Replace stream.tee() with stream.clone()
Also some other fixes to pass more tests.
2018-08-10 14:44:01 +02:00
Daniel Huigens
16ba26c298 Streaming AEAD 2018-08-10 14:44:01 +02:00
Daniel Huigens
4ada3fa590 Don't mutate prototypes of Uint8Array, ReadableStream and ReadableStreamDefaultWriter 2018-08-10 14:44:01 +02:00
Daniel Huigens
403bdc5346 Streaming decryption (Web) 2018-08-10 14:44:01 +02:00
Daniel Huigens
9853d3d830 Streaming encryption (Web) 2018-08-10 14:44:01 +02:00
Daniel Huigens
3fd0fa8f68 Various key revocation fixes 2018-07-13 17:45:09 +02:00
Daniel Huigens
1ed7943bf9 Create openpgp.revokeKey 2018-07-11 17:57:31 +02:00
Daniel Huigens
fe3c1b4f31 Add fromUserId / toUserId parameters to openpgp.encrypt and sign
To select the user whose algorithm preferences, expiration time etc to use.
2018-05-01 13:39:23 +02:00
Daniel Huigens
6c2fec3450 Parse user IDs
Also, support comments when creating user IDs
2018-05-01 13:39:23 +02:00
Daniel Huigens
2627755b49 iOS Safari doesn't allow setting Error.message 2018-04-30 16:58:39 +02:00
Daniel Huigens
550b758d57 Fall back to asm for CTR and CBC in old Safari 2018-04-30 16:58:35 +02:00
Daniel Huigens
04651e359a Rename enums.aead.gcm to experimental_gcm
So that (1) if the spec ever defines GCM differently than we do, we have a
clean upgrade path and (2) it makes it clear that it's experimental.
2018-04-30 15:55:37 +02:00
Daniel Huigens
d7efead337 Update Web Worker selection logic for AEAD 2018-04-30 15:55:32 +02:00
Daniel Huigens
6f2abdc2cf Implement MIME message type (Literal Data Packet format 'm') 2018-04-27 14:06:19 +02:00
Daniel Huigens
5f97a8c937 Implement preferred AEAD algorithms 2018-04-27 14:06:16 +02:00
Daniel Huigens
5d43b44e50 Log swallowed errors in debug mode 2018-04-27 14:06:14 +02:00
KAYLukas
187cc6b05a Support compression in the WebWorker 2018-04-18 18:08:36 +02:00
Sanjana Rajan
2bd540026f add multiple passphrase options to key encrypt and decrypt 2018-04-16 12:52:17 -07:00
Sanjana Rajan
24119f4fb1 keygen update 2018-04-15 12:38:18 -07:00
Sanjana Rajan
a22c9e4770 WIP text signatures 2018-03-22 16:10:21 -07:00
Sanjana Rajan
6fe73033a4 docs 2018-03-19 19:11:20 -07:00
Sanjana Rajan
eb96d44298 add date parameter to generateKey function 2018-03-19 18:55:15 -07:00
Mahrud Sayrafi
944dece506
Adds Brainpool Curves + tests + docs 2018-03-18 10:12:29 -07:00
Mahrud Sayrafi
96c9cd0d73
Fixes dead links in the documentation 2018-03-13 00:13:04 -07:00
Mahrud Sayrafi
08da24de27
documentation fixes 2018-03-08 10:55:58 -08:00
Mahrud Sayrafi
73a240df6c Simplifies (Key|User|SubKey).isRevoked, API changes in key.js
For User s/revocationCertifications/revocationSignatures/g
For Key/SubKey s/revocationSignature/revocationSignatures/g is now an array.
2018-03-08 10:01:54 +01:00
Bart Butler
1cd9018346 some cleanup 2018-03-06 10:04:33 -08:00
Bart Butler
2bb5db2cf4 multiple web workers 2018-03-05 21:36:53 -08:00
Bart Butler
f57888fe55 change all calls of getRandomBytes and getRandomBN to be async 2018-03-05 16:31:56 -08:00
Mahrud Sayrafi
605021af3b
Various quickfixes and cleanups 2018-02-22 00:37:42 -08:00
KAYLukas
6b4d44dbb1 Fix browser tests 2018-02-19 22:12:24 +01:00
KAYLukas
071fc35f38 Check created time to be valid and discard milliseconds from date objects 2018-02-17 11:28:04 +01:00
KAYLukas
6ca8bc2180 Add timeparameter for verification and remove verify_expired_keys 2018-02-16 17:20:48 +01:00
KAYLukas
7e66ea20db Add timeparameter to signing and encryption 2018-02-16 17:20:48 +01:00
BafS
b672f1936a Use let and const ES6 features.
Remove var, for let or const if possible, clean some syntax, enforce one var per declaration and semicolons
2018-02-13 23:33:09 +01:00
BafS
de6ffc2f76 Remove 'user strict'
'use strict' is unnecessary inside modules because module code is always strict mode code. Ref: https://www.ecma-international.org/ecma-262/6.0/#sec-strict-mode-code
2018-02-13 23:33:09 +01:00
Bart Butler
8873ed0ff1
Update openpgp.js
doc fix
2018-02-13 11:01:09 -08:00
mmso
9f7466ef45
Add compression support for the encrypt function 2018-02-13 15:08:41 +01:00
Sanjana Rajan
62015c2c8d useWildcard -> wildcard 2018-02-12 19:31:47 +01:00
Sanjana Rajan
989ad5077e cleanup, docs 2018-02-12 13:40:23 +01:00
Sanjana Rajan
7365ffc9b7 wildcard implementation 2018-02-12 09:47:51 +01:00
Sanjana Rajan
e5e49901a7 change var names 2018-02-12 09:47:51 +01:00
Sanjana Rajan
18e46ed6cf gracefully handle reformatting keys with no subkey packets 2018-02-09 16:18:27 +01:00
Bart Butler
c2a7ea2a20
Merge pull request #593 from laurinenas/inform-user-invalid-numBits-size
Add a console error when numBits param too low
2018-02-08 10:51:21 -08:00
Mahrud Sayrafi
b2e39ccaf9
Documentation and cleanups 2018-02-07 03:25:28 -08:00
Bart Butler
602bbb707d rename decryptSessionKey to decryptSessionKeys, return only unique session keys 2018-02-06 21:25:49 -08:00
Bart Butler
bdf1ce8d64 add some more polyfills for old browsers 2018-02-06 10:56:29 -08:00
Bart Butler
89f86d83d5 fix obsolete browser tests, add some polyfills 2018-02-05 22:17:41 -08:00
Mahrud Sayrafi
a4134b9f55
Addresses various review comments by @bartbutler + some cleanups 2018-01-31 17:52:38 -08:00
Mahrud Sayrafi
d97bc064ea
Cleanups and doc fixes 2018-01-31 12:24:21 -08:00
Mahrud Sayrafi
bf00fbd3ea added ECC curve options to docs 2018-01-30 18:36:38 +01:00
Mahrud Sayrafi
35f18444b0 keygen and sign/verify with ed25519 works 2018-01-30 18:34:54 +01:00
Mahrud Sayrafi
21ae66c604 encrypt/decrypt/sign/verify will always return promises
Note: publicKeyEncryptedSessionKey uses promises, symEncryptedSessionKey does not
2018-01-30 18:33:55 +01:00
Mahrud Sayrafi
1a714cec73 ECC with async/await is 'Done, without errors.' 2018-01-30 18:33:55 +01:00
Mahrud Sayrafi
11a2d0070b ESLint is happy! 2018-01-30 18:31:30 +01:00
Mahrud Sayrafi
6886cd648a elliptic/curves.js uses native code for genkey and sign/verify; sign/verify use async/await 2018-01-30 18:31:07 +01:00
Sanjana Rajan
fdcfcf3a54 refactor formatUserIds 2018-01-30 18:30:15 +01:00
Ismael Bejarano
f87e759cb0 Create key from provided material 2018-01-30 18:30:14 +01:00
Ismael Bejarano
a5d9e6d09e Generation of keys for elliptic curves 2018-01-30 18:30:14 +01:00
Bart Butler
1682787152 deal with empty encrypted data correctly 2017-12-22 13:26:53 -08:00
Bart Butler
81a59b76b1 do not echo data back to caller for detached signing 2017-12-05 11:44:01 -08:00
Sanjana Rajan
135bd3d46a doc update 2017-12-02 11:48:14 -08:00
Sanjana Rajan
6189cd4568 returnSessionKey flag in encrypt function 2017-12-02 11:04:29 -08:00
Sanjana Rajan
7e03410bc9 allow sessionKey param in top level encrypt 2017-12-01 21:25:43 -08:00
Bart Butler
7a9c3b0ddd remove stack trace concatenation (non-standard), modify error message only 2017-11-27 19:06:25 -08:00
Bart Butler
617c1c9ee9 include error message in stack trace for Safari/Firefox 2017-11-27 16:50:18 -08:00
Bart Butler
49695ff50c Error object cannot be used with structured clone, pass stack 2017-11-27 15:44:04 -08:00
Justin Chase
a5a913419b Also concat stacks 2017-11-25 10:45:58 -06:00
Justin Chase
567d212204 Dont join stacks 2017-11-24 16:16:42 -06:00
Justin Chase
bf6c2b9319 Added a test verifying innerError 2017-11-24 16:12:37 -06:00
Andrius Laurinėnas
1d287cd9a9 Add a console error when numBits param too low 2017-10-13 19:50:48 +03:00
Sanjana Rajan
95c5e3af01 use message obj when signing uint8 array 2017-07-08 13:25:24 +02:00
Sanjana Rajan
d061af1fc3 style fixes 2017-07-06 16:29:25 +02:00
Sanjana Rajan
28e5f5d3f4 allow cleartext msg data to be string or byte array 2017-07-04 14:15:39 -07:00
Bart Butler
5fb23ac833 use web worker for reformatKey 2017-03-29 16:27:16 -07:00
Sanjana Rajan
16c6d2f162 signatureInput -> signature 2017-03-23 13:01:12 -07:00
Sanjana Rajan
d04c09687d spacing 2017-03-23 11:16:16 -07:00
Sanjana Rajan
79160abcc9 allow signature as input in high level encrypt 2017-03-22 17:04:21 -07:00
Sanjana Rajan
af211f63c0 update README to demonstrate detached signature use, some documentation fixes 2017-03-17 16:54:34 -07:00
Sanjana Rajan
e4621fc688 initialize publicKeys to empty array, test case where signed message is decrypted without public keys to verify 2017-03-15 17:44:43 -07:00
Sanjana Rajan
4ec07672a7 return signature object inside verification object 2017-03-10 10:38:59 -08:00
Sanjana Rajan
da9e3c6264 small fixes 2017-03-07 19:10:33 -08:00
Sanjana Rajan
43355e079f add detached sig option to upper level functions 2017-03-07 13:59:18 -08:00
Sanjana Rajan
11e1040a30 remove extra input param 2017-01-31 14:18:13 -08:00
Sanjana Rajan
a902c421eb add upper level refactorKey function 2017-01-31 14:14:27 -08:00
David Janes
c223b88829 implement keyExpirationTime 2017-01-24 16:54:52 -05:00
Sanjana Rajan
d65d629264 trim name 2016-12-15 10:39:29 -08:00
Sanjana Rajan
d058523e9e clearer syntax 2016-12-15 10:01:50 -08:00
Sanjana Rajan
109f8a5d20 don't allow leading spaces in user id 2016-12-14 12:38:01 -08:00
Tankred Hase
969e39dcf2 Rename useAEAD --> nativeAEAD 2016-03-24 13:49:26 +08:00
Tankred Hase
f4fc274f14 Fix: use worker for CFB w/ webcrypto support 2016-03-24 13:24:18 +08:00
Tankred Hase
979f212305 Cleanup Promise code 2016-03-24 09:29:41 +08:00