Commit Graph

81 Commits

Author SHA1 Message Date
Daniel Huigens
4bdc5e92ab Add --compat option
Without it, the generated build is for recent versions of
Chrome, Firefox, Safari and Edge.

With it, the generated build is for IE11+.
2018-08-14 17:24:41 +02:00
Daniel Huigens
d844b8b06c Add minimum AEAD buffer size
This enables parallelism for streaming AEAD chunked encryption.

The reason we can't do so at the very end of the pipe chain
(e.g., in `readToEnd`) is because requests for increased
buffering (i.e. `desiredSize > 1`) do not propagate backwards,
only requests for backpressure (i.e. `desiredSize <= 0`) do.
2018-08-14 16:35:39 +02:00
Daniel Huigens
d2ba6b3c6c Wait for data to be read before resolving signatures 2018-08-10 14:46:28 +02:00
Daniel Huigens
4d82d25559 Pass more tests
We now use streams internally in more places.
2018-08-10 14:46:26 +02:00
Daniel Huigens
ade2627bca Streaming verify one-pass signatures 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
0372bf78f1 Make (de)armoring and packet reading asynchronous 2018-08-10 14:44:01 +02:00
Daniel Huigens
9302fdcc56 Don't cache literal.getBytes() when signing with textMode=false
This partially reverts bcfb9c0.
2018-08-10 14:44:01 +02:00
Wiktor Kwapisiewicz
19e3c344fd
Fix verification of User Attributes
This change corrects verification of certifications over User Attributes
(such as photos).

Before this change the code did not differentiate between User IDs and
User Attributes as both of them were stored in `data.userid` [0] and
incorrectly used the User ID constant (0xB4) for both cases.

This change fixes the bug by storing User IDs in `userId` property and
User Attributes in `userAttribute` property. The check for property
existence has been modified to avoid comparisons with `undefined` as the
`User` class sets `null` for not assigned packets instead of
`undefined`.

Only data structures for signing and verification were modified and not
the properties used in the `User` class.

[0]: 11b2d2de3c/src/key.js (L872)
2018-07-24 13:03:46 +02:00
Wiktor Kwapisiewicz
0099c373d2
Fix reading signersUserId packet in signatures
This bug caused all signersUserIds strings to be prefixed with `"null"`
string. Changed to use only the last value for this packet type.

Previous implementation probably assumed that there will be more than one
signersUserId packet but I haven't been able to generate such signature
using gpg (only last user id was embedded). Moreover signature
serialization function `write_all_sub_packets` writes only one value of
this packet as a UTF-8 string.
2018-06-27 12:17:19 +02:00
Maximilian Krambach
4beb31333e change some variable names in tests to camelCase 2018-06-04 12:33:01 +02:00
Maximilian Krambach
1eb3902a96 Run tests with randomly generated strings 2018-05-17 12:40:30 +02:00
Sanjana Rajan
33d5b158f8 fix #706 - if ignore_mdc_error is set to false then MDC is required for all symmetrically encrypted data 2018-05-15 00:04:58 -07:00
Daniel Huigens
310d8dd9b9 Fix V5 key fingerprint in ECDH parameters 2018-04-30 15:55:36 +02:00
Daniel Huigens
28dbbadcff Add config.aead_protect_version option 2018-04-27 14:06:17 +02:00
Daniel Huigens
f225f994ec Add AEAD-OCB test vector 2018-04-27 14:06:16 +02:00
Daniel Huigens
5f891d28d6 Switch cipher/aes.js to Uint8Arrays 2018-04-27 14:06:14 +02:00
Daniel Huigens
c2f898279b Implement version 5 Secret-Key Packet Format 2018-04-27 14:06:14 +02:00
Daniel Huigens
17ad654d60 Implement version 5 Symmetric-Key Encrypted Session Key packet 2018-04-27 14:06:13 +02:00
Daniel Huigens
7b3f51c0d4 Implement AEAD Encrypted Data Packet 2018-04-25 20:12:10 +02:00
Mahrud Sayrafi
6fefe22c09 Finished fixing key.js; fixes async tests 2018-03-08 10:01:55 +01: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
f57888fe55 change all calls of getRandomBytes and getRandomBN to be async 2018-03-05 16:31:56 -08:00
Mahrud Sayrafi
3b912d2fae
Cleaning mpi.js; TODO: store MPI.data as Uint8Array instead of BN
Also improved asynchronousity in packet tests
2018-02-22 14:51:57 -08:00
Mahrud Sayrafi
1812166a53
RSA using asmcrypto with asmcrypto bignum 2018-02-22 00:37:42 -08:00
Mahrud Sayrafi
e1d85ba682
ElGamal and MPI use bn.js; TODO: RSA Key Generation 2018-02-22 00:37:42 -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
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
Sanjana Rajan
cdc7004b96 refactor mpi, generalize mpi to params to account for non-mpi algorithm-specific data 2018-01-30 18:30:15 +01:00
Bart Butler
318d86e5e9 do not use arrow syntax for tests (old node/browser versions) 2017-11-28 10:18:26 -08:00
Sanjana Rajan
e2c15fe558 don't use done inside promises 2017-11-27 22:17:13 -08:00
Tankred Hase
453a9cee07 Use web worker for encrypt/decrypt if no native gcm 2016-03-23 21:17:36 +08:00
Tankred Hase
8f8218e9de Cleanup and test AEAD protected packet 2016-03-22 17:45:19 +08:00
Tankred Hase
25131e0df9 Added unit tests for util.getTransferables 2016-02-10 12:52:13 +07:00
Tankred Hase
2aa8b143bd Ignore MDC error in unit test for symmetrically encrypted packet 2016-02-03 20:24:54 +07:00
Bart Butler
b4916e29a3 binary strings to typed arrays in most places 2016-02-03 20:24:54 +07:00
Tankred Hase
d707164857 Fix unit tests on Safari, Closes openpgpjs/openpgpjs#399 2016-02-03 19:33:08 +07:00
Tankred Hase
f729efa873 Use dist/openpgp instead of src/index because of future ES6 transpilation under node 2016-01-23 07:05:59 +07:00
evilaliv3
af4a9ba6ad Revert few of the changes done in a4598f3bd4 2016-01-22 23:47:11 +01:00
Thomas Oberndörfer
d0297e1b81 Test cases for MDC error 2016-01-07 15:35:47 +01:00
Tankred Hase
7f2573c77d Refactor complete public api to use promises 2014-10-01 19:12:39 +02:00
Tankred Hase
cbe4a17ccb Refactor key generation to use callback
* TODO: reactive native web crypto in rsa.js:142
* TODO: generate publicExponent Uint8Array from argument E in rsa.js:148
* TODO: signing with generated web crypto key fails with "Could not find valid key packet for signing in key"
2014-09-30 18:22:17 +02:00
Thomas Oberndörfer
a4598f3bd4 Generate openpgp.js without source map. New source map target is openpgp_debug.js. Change dependency of workers: openpgp.worker.js -> openpgp.js, openpgp.worker.min.js -> openpgp.min.js. Remove openpgp.js with maps from unittests-bundle.js 2014-03-31 16:09:23 +02:00
Tankred Hase
bf46ff3c9d fix tests 2014-01-10 20:46:31 +01:00
Robert Nelson
92adbff398 Changed comparison in window check 2014-01-09 08:22:57 -08:00