Commit Graph

61 Commits

Author SHA1 Message Date
Daniel Huigens
fb3d23427d Allow dead code elimination 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
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
Ilya Chesnokov
6e7f399eb3 Use Web Crypto & Node crypto for RSA signing and verifying (#999)
Also, when generating RSA keys in JS, generate them with p < q, as per
the spec.

Also, when generating RSA keys using Web Crypto or Node crypto, swap the
generated p and q around, so that will satisfy p < q in most browsers
(but not old Microsoft Edge, 50% of the time) and so that we can use the
generated u coefficient (p^-1 mod q in OpenPGP, q^-1 mod p in RFC3447).

Then, when signing and verifying, swap p and q again, so that the key
hopefully satisfies Safari's requirement that p > q, and so that we can
keep using u again.
2019-11-18 14:59:01 +01:00
Daniel Huigens
9bb1710a9f Remove unused writeOldHeader function 2019-08-12 17:46:37 +02:00
Daniel Huigens
562783df01 Fix armor checksum mismatch error message with allow_unauthenticated_stream 2019-07-19 19:06:19 +02:00
Daniel Huigens
237db2c7f3 Fix armor checksum errors being ignored when not streaming 2019-07-19 19:05:26 +02:00
Daniel Huigens
a291a803fb Fix reading indeterminate-length packets in IE11
Broken in 5dcaf85.
2019-02-25 04:41:58 +01:00
Daniel Huigens
cd6eadd6e0 Fix reading empty partial body part (again)
Broken in 5dcaf85.
2019-02-25 04:34:28 +01:00
Daniel Huigens
5dcaf85f5a Optimize reading large messages with lots of tiny partial body parts (#864)
* Fix pako decompression

* Optimize base64-decoding

* Don't stream-parse packets when not stream-reading data
2019-02-21 08:33:55 -08:00
Daniel Huigens
dc722770d0 Don't process armored message data line per line
This cuts down on the overhead of streaming by reducing the amount
of calls to reader.read() and writer.write().
2018-09-03 18:23:38 +02:00
Daniel Huigens
8c7e4386af Fix stream-reading zero-length (partial) packets 2018-08-14 17:19:54 +02:00
Daniel Huigens
52c4fa9639 Move streams library to a separate package 2018-08-14 16:35:40 +02:00
Daniel Huigens
ca537e439d Comments & code style 2018-08-14 16:35:38 +02:00
Daniel Huigens
0db32bea39 Backpressure and cancellation in sign/verify 2018-08-10 14:46:28 +02:00
Daniel Huigens
589b666ac7 Don't clone stream in packet.parse() 2018-08-10 14:46:24 +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
51c897b073 Cancelling 2018-08-10 14:46:23 +02:00
Daniel Huigens
9c1c28bc59 Add option to read unauthenticated data from stream 2018-08-10 14:46:23 +02:00
Daniel Huigens
4bbbdaee9f Rename stream.subarray() to stream.slice()
Also, support ReadableStream[String] in stream.* and reader.* functions
2018-08-10 14:46:22 +02:00
Daniel Huigens
ead3ddd706 Streaming decrypt old-format packets 2018-08-10 14:44:01 +02:00
Daniel Huigens
9fcc075f0b Streaming decrypt non-partial-length-encoded packets 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
70f0e1d2f5 Finish streaming armoring 2018-08-10 14:44:01 +02:00
Daniel Huigens
0372bf78f1 Make (de)armoring and packet reading asynchronous 2018-08-10 14:44:01 +02:00
Daniel Huigens
403bdc5346 Streaming decryption (Web) 2018-08-10 14:44:01 +02:00
Daniel Huigens
b4f5976242 Writing partial lengths 2018-08-10 14:44:01 +02:00
Daniel Huigens
c6ba83c4a3 Allow configuring openpgp in unit tests using query params (e.g. ?debug=true&use_native=false) 2018-04-27 14:06:15 +02:00
Mahrud Sayrafi
4ded3f9d58
Documentation improvements in src/packet 2018-03-09 08:01:06 -08:00
Mahrud Sayrafi
a5e7562066
Many documentation improvements; more to come 2018-03-08 19:27:57 -08:00
Mahrud Sayrafi
08da24de27
documentation fixes 2018-03-08 10:55:58 -08: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
Alax Villmann
0989015ed2 V3 header generation was concat()-ing non-Uint8 arrays 2017-01-09 10:30:31 -08:00
Tankred Hase
70ac662073 Refactor src/packet/*.js to use import & export 2016-02-05 14:44:22 +07:00
Tankred Hase
90a7457b71 Refactor most src files to strict mode, delint 2016-02-04 00:37:00 +07:00
Bart Butler
b4916e29a3 binary strings to typed arrays in most places 2016-02-03 20:24:54 +07:00
Tankred Hase
562831d6dc Merge pull request #245 from inovari/master
Bugfix in packet_length calculation
2014-10-02 00:24:23 +02:00
Tankred Hase
bbe174828f Upgrade license to LGPL version 3.0 or later. 2014-09-30 18:16:58 +02:00
inovari
91ccbeed80 Bugfix in packet_length calculation
One of the bitshifts used to construct tmplen (lines 230-231) was inconsistent with the other expressions:

(input[mypos2++].charCodeAt() << 8)

causing following error:

TypeError: Cannot call method 'charCodeAt' of undefined
    at Object.module.exports.read (/home/scott/dev/keystone/fetch/node_modules/openpgp/src/packet/packet.js:231:16)

Corrected to 

(input.charCodeAt(mypos2++) << 8)
2014-07-16 15:37:06 -04:00
Thomas Oberndörfer
1a4c504bc7 Fix packet partial body length 2014-02-27 13:01:47 +01:00
Robert Nelson
9f4e6e7ebb Add files missed in last commit 2014-01-09 02:47:57 -08:00
Robert Nelson
0c6b345ba8 Refactor classes 2014-01-05 10:13:25 -08:00
Robert Nelson
dba6f379e8 Fix all the lint noise, mostly semicolons, duplicate var definitions and ==0 2014-01-02 12:24:10 -08:00
Robert Nelson
17ad1f5fed More documentation fixes 2013-12-26 22:49:37 -08:00
Robert Nelson
e891d81e17 Merge upstream/devel changes 2013-12-22 13:01:24 -08:00
Robert Nelson
8923813580 Fix jsdoc generation and make keyring multiple instance.
Add jsdoc @module definitions.

Fix references to old class names.

Make keyring a multiple instance module.

Eliminate unit test dependency on running npm test.
2013-12-22 12:39:11 -08:00
Thomas Oberndörfer
1ca90a980c Support multiple keys per ASCII armored block. Unify error handling: replace print_error function
with exceptions. The idea is to use exceptions internally, but catch them in the high level API
functions and return errors as implemented in openpgp.key.readArmored.
2013-12-17 16:09:52 +01:00
Robert Nelson
f0c2427895 Array indexing on strings is nonstandard and doesn't work on IE 2013-12-05 20:03:08 -08:00
seancolyer
7abaa43497 Initial gruntfile support. Forcing a standardized style. 2013-10-08 22:33:36 -04:00