Commit Graph

448 Commits

Author SHA1 Message Date
Ilya Chesnokov
29d67415e2 Accept @ in User ID names (#930) 2019-07-18 15:45:54 +02:00
Daniel Huigens
5a17648922 Fix error message when reformatting a GNU stripped-key with a passphrase 2019-06-06 16:08:22 +02:00
Daniel Huigens
43441bfe0d openpgp.reformatKey: Fix key preferences for signing subkeys 2019-05-23 17:37:20 +02:00
Wiktor Kwapisiewicz
82799390de
Fix signatures with critical notations
Previously the signature parsing function ignored critical bit on
notations.

This change checks for notations that are marked "critical" but are not
on the known notations list (controlled by config array
`openpgp.config.known_notations`) and triggers parse error if such
a notation have been encountered.

See: #897.
2019-05-16 09:57:58 +02:00
Wiktor Kwapisiewicz
16b12d7f55
Expose all signature notations
Previous implementation used an object to hold notations so if multiple
notations had the same key name only the last one was visible.

After this change notations are exposed as an array of key-value pairs
that can be converted to a map through `new Map(notations)`.

See #897.
2019-05-09 12:12:22 +02:00
Daniel Huigens
ee01883a52
Merge pull request #894 from twiss/dont-throw-verification-errors-workers
Fix one-pass signature verification when using a Worker
2019-05-05 00:01:14 +02:00
Daniel Huigens
df8364930b Fix one-pass signature verification when using a Worker 2019-05-03 18:40:31 +02:00
Daniel Huigens
1090464a70 Throw more informative error when trying to use a key with missing params
E.g. when trying to sign with a GPG stripped key without a valid signing
subkey.
2019-05-03 14:29:43 +02:00
Daniel Huigens
19d14b521b Add test for signing with GNU stripped key 2019-05-03 14:07:10 +02:00
Daniel Huigens
bc756d0ed4 Make key.isDecrypted() and key.encrypt() consistent for gnu-dummy keys 2019-05-03 12:39:28 +02:00
Daniel Huigens
10e10effb6 Support GNU export-secret-subkeys extension 2019-05-03 12:39:28 +02:00
Daniel Huigens
6689f93465 Fix flaky test in Edge 2019-05-02 12:55:08 +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
be1b4df140 Use tweetnacl's Ed25519 implementation 2019-05-02 12:08:08 +02:00
Si Feng
d2c38693f5 Put comment before email when generating UIDs (#892) 2019-05-01 13:12:52 +02:00
Daniel Huigens
7fb2901ede
Fix detached signing of messages created from streams (#887) 2019-04-29 13:45:09 +02:00
Thomas Oberndörfer
038d8466fe Add date parameter to user.verifyAllCertifications and user.verify methods (#871)
Also, in user.verifyCertificate, fix certificate.isExpired check for keys with future creation date.
2019-03-08 17:33:36 +01:00
Daniel Huigens
a9599fea42
Work around go crypto bug in ECDH messages (#869) 2019-03-04 13:53:19 +01:00
Thomas Oberndörfer
b1be7d1202 Fix merging multiple subkey binding signatures (#868) 2019-02-28 10:34:46 -08:00
rash0
3edc6e7501 ++ Add another Domain for HKP server (#855)
* ++ Add another Domain for HKP server

the pgp.mit.edu domain is most of the time down and responds with time out...so i discovered this ubuntu domain for the same database...but its much faster and never falls....i think too much traffic over the bit one :(

* Update hkp.js

* Change HKP server url

* Defined the default HKP server

* Update README.md

Co-Authored-By: rash0 <40761345+rash0@users.noreply.github.com>

* ++ Add revocation certificate test

didn't know if i should use the revocation certificate in the test/key.js file or generate a new one...so i generated a test one and used it...
2019-02-11 11:33:24 +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
625c6ea4b3 Zero-copy transfer buffers from the worker to the main thread 2019-01-09 15:18:56 +01:00
Sanjana Rajan
529973f2a2
Merge branch 'master' into fix/non-primary-non-revoked-sub-user 2018-12-23 17:52:01 +01:00
Sanjana Rajan
1bee091f2a
Merge pull request #815 from twiss/userIds
Make fromUserIds/toUserIds params plural, and accept arrays of User IDs
2018-12-23 17:50:46 +01:00
Daniel Huigens
9691dc9c99 Fix getExpirationTime with capabilities and an expired signing subkey
When the latest subkey with the requested capabilities is expired,
and the primary key has the requested capabilities, return the
primary key expiry instead.

Also, change isExpired/isDataExpired to still return false at the
date returned by getExpirationTime, so that the latter returns the
last date that the key can still be used.
2018-12-21 12:49:22 -05:00
Daniel Huigens
f0f9a5c2a4 Fix key generation tests on Node
The Node tests set the key bit size to 512, which is not big enough
to sign a SHA384 hash + header.
2018-12-17 13:32:27 -05:00
Daniel Huigens
804e91140a Add config values to preferred algorithms 2018-12-17 12:52:30 -05:00
Daniel Huigens
926047f0b3 Default to RFC4880bis-mandated symmetric algos 2018-12-17 12:27:09 -05:00
Daniel Huigens
65772d86b3 Make fromUserIds/toUserIds params plural, and accept arrays of User IDs
Each User ID object is used for the key object at the corresponding index
in the privateKeys/publicKeys arrays.
2018-12-14 16:54:44 +01:00
Kay Lukas
2dbb8582d7 Add testcases 2018-12-10 20:21:55 +01:00
Daniel Huigens
92230d2055 Consider non-expired signatures from expired keys to still be valid 2018-12-10 15:20:11 +01:00
Daniel Huigens
997f3e8e38 Compute signed data based on expected signature type 2018-11-05 17:13:40 +01:00
Sanjana Rajan
67de70fa01
Merge pull request #798 from twiss/seek-bzip
Remove bzip2 compression
2018-11-05 12:58:50 +01:00
Daniel Huigens
08f48bfc2c Switch to seek-bzip 2018-11-05 12:49:53 +01:00
Daniel Huigens
d314a20e0f Don't return keys with an authorized revocation key 2018-11-05 11:47:45 +01:00
Daniel Huigens
8fa3aadea2 Add and require primary key binding signatures on signing keys
Also, fix keyFlags of signing subkeys.

Also, store Issuer Key ID and Embedded Signature in unhashed rather
than hashed subpackets.
2018-11-05 11:47:45 +01:00
Sanjana Rajan
3c45b6f18a
Merge pull request #793 from twiss/signature-errors
Check that one-pass signatures match their corresponding signature
2018-11-01 12:13:02 +01:00
Daniel Huigens
11fd2313a7 Fix unhandled promise rejection when decrypting non-MDC message 2018-11-01 11:46:43 +01:00
Daniel Huigens
13c29b1fc9 Fix decryption with multiple passwords 2018-11-01 11:46:27 +01:00
Daniel Huigens
9c82bf491e Reject signatures[*].verified and signatures[*].signature on read errors
However, don't throw "unhandled promise rejection" when not using these
properties at all, or when they reject before the user has a chance to
handle them.
2018-10-29 11:47:36 +01:00
Daniel Huigens
3751731330 Don't hang when signature packet corresponding to one-pass sig is missing 2018-10-04 22:13:10 +02:00
Daniel Huigens
b3af56b8a3 Ignore third-party revocation signatures
This check was removed in ec22dab.
2018-09-22 23:03:10 +02:00
Daniel Huigens
a1c47ecdea Indicate an error when parsing a key with an authorized revocation key
Since we will ignore revocation signatures from authorized revocation keys,
it is dangerous to use these keys.
2018-09-22 23:03:10 +02:00
Daniel Huigens
5cf61daa19 Check validity of signatures before using them 2018-09-22 23:03:10 +02:00
Daniel Huigens
d8840294cf Make newlines in armored objects consistent
- Don't add an extraneous newline at the end of base64-encoded data
  if it is a multiple of 60 characters long.
- Generate \r\n instead of \n in base64-encoded data.
- Generate one newline instead of two after END PGP PUBLIC KEY BLOCK
  for consistency with the other footers.
2018-09-13 14:32:35 +02: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
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