Commit Graph

1425 Commits

Author SHA1 Message Date
Daniel Huigens
3c224379f6 Remove util.isUserId()
It was not really correct anyway; a user id can just be an email address
without < > brackets.
2018-05-01 13:39:24 +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
Sanjana Rajan
cf3c2790f2 Release new version 2018-04-30 14:58:14 -07:00
Sanjana Rajan
9a5583fd25 clarifying comments 2018-04-30 13:30:48 -07:00
Sanjana Rajan
d562c147f9
Merge pull request #691 from twiss/draft04
Implement RFC4880bis-04
2018-04-30 12:16:20 -07:00
Daniel Huigens
a16d1a6a1d iOS does not support GCM-en/decrypting empty messages 2018-04-30 19:09:48 +02:00
Daniel Huigens
2627755b49 iOS Safari doesn't allow setting Error.message 2018-04-30 16:58:39 +02:00
Daniel Huigens
49c9fb193d Only call webCrypto.generateKey once in tests 2018-04-30 16:58:39 +02:00
Daniel Huigens
8ec01ae07a Reduce duplicate tests 2018-04-30 16:58:38 +02:00
Daniel Huigens
a7fce27424 Safari 8 compatibility 2018-04-30 16:58:37 +02:00
Daniel Huigens
cc1f7a4765 Lower chunk_size_byte to 12 (256KiB)
- In anticipation of streaming decryption
- Firefox 34 does not support chunk_size_byte > 24

256KiB is almost as fast as no chunks (although both of those can be up to
~1.5x slower than optimally using threads for very large message sizes).
The optimal chunk size would be something like:

    max(data.length / navigator.hardwareConcurrency, 128KiB)

But we don't do so currently because

- We don't know the hardwareConcurrency of the decrypting machine
- Smaller chunk sizes are better for streaming decryption
2018-04-30 16:58:36 +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
b8191388cd Bump "old Chrome" version from 38 to 41 2018-04-30 16:58:34 +02:00
Daniel Huigens
48cbb97d19 Bump Sauce Labs timeout 2018-04-30 16:58:33 +02:00
Daniel Huigens
7ce3f5521f Set default draft version to 4 2018-04-30 15:55:38 +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
bbf71d149b Deduplicate OCB encrypt / decrypt 2018-04-30 15:55:37 +02:00
Daniel Huigens
e8adeef278 Implement Issuer Fingerprint subpacket 2018-04-30 15:55:37 +02:00
Daniel Huigens
310d8dd9b9 Fix V5 key fingerprint in ECDH parameters 2018-04-30 15:55:36 +02:00
Daniel Huigens
be62b0cf65 Add algorithm IDs for AEDH and AEDSA 2018-04-30 15:55:36 +02:00
Daniel Huigens
0376f49e01 Deduplicate getPreferredSymAlgo / getPreferredAEADAlgo 2018-04-30 15:55:35 +02:00
Daniel Huigens
4568d080d5 Fix decryption with multiple chunks 2018-04-30 15:55:34 +02:00
Daniel Huigens
485cb17e95 Deduplicate SymEncryptedAEADProtected encrypt / decrypt 2018-04-30 15:55:34 +02:00
Daniel Huigens
343c64eca0 Add tests for signing and verifying messages with trailing spaces 2018-04-30 15:55:33 +02:00
Daniel Huigens
ebeedd3443 Fix removing whitespace from the last line of cleartext signed messages
Also, move normalizing line endings and removing whitespace to util functions
2018-04-30 15:55:33 +02:00
Daniel Huigens
4e204d7331 Update AEAD instructions in README 2018-04-30 15:55:32 +02:00
Daniel Huigens
d7efead337 Update Web Worker selection logic for AEAD 2018-04-30 15:55:32 +02:00
Daniel Huigens
e061df113c Implement GCM mode in the new draft
Also, implement additional data for GCM
2018-04-30 15:55:31 +02:00
Daniel Huigens
d5a7cb3037 Constant-time double() in OCB 2018-04-27 14:06:20 +02:00
Daniel Huigens
69762f95de Code style 2018-04-27 14:06:20 +02:00
Daniel Huigens
51d7860622 Native CMAC 2018-04-27 14:06:19 +02:00
Daniel Huigens
6f2abdc2cf Implement MIME message type (Literal Data Packet format 'm') 2018-04-27 14:06:19 +02:00
Daniel Huigens
3b81088aaf Decouple signature type from data packet type
Instead of creating a text signature for text packets and a binary signature for
binary packets, we determine the signature type based on whether a String or
Uint8Array was originally passed. This is useful for the new MIME data packet
type (implemented in the next commit) which you can pass in either format.

This also partly reverts a22c9e4. Instead of canonicalizing the literal data
packet, we canonicalize the data when signing. This fixes a hypothetical case
where an uncanonicalized text packet has both a text and a binary signature.

This also partly reverts c28f7ad. GPG does not strip trailing whitespace when
creating text signatures of literal data packets.
2018-04-27 14:06:19 +02:00
Daniel Huigens
2f849063f9 Allow reusing EAX/OCB instances with the same key
This is useful for chunked encryption in draft04
2018-04-27 14:06:19 +02:00
Daniel Huigens
e24b46192d Only AEAD-protect when target keys support it 2018-04-27 14:06:18 +02:00
Daniel Huigens
e9a360019c Update table of supported native ECC curves 2018-04-27 14:06:18 +02:00
Daniel Huigens
e44fbbccab Add more OCB tests 2018-04-27 14:06:18 +02:00
Daniel Huigens
28dbbadcff Add config.aead_protect_version option 2018-04-27 14:06:17 +02:00
Daniel Huigens
d5d4c97228 Fix config.use_native 2018-04-27 14:06:17 +02:00
Daniel Huigens
53d6f20b72 Reduce allocations in OCB mode 2018-04-27 14:06:17 +02:00
Daniel Huigens
997ec1c8db Add AEAD feature flags 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
5f97a8c937 Implement preferred AEAD algorithms 2018-04-27 14:06:16 +02:00
Daniel Huigens
93f75f398f Reuse CMAC in EAX mode 2018-04-27 14:06:16 +02:00
Daniel Huigens
627a6ef46e Only calculate AES key schedules once in cipher/aes.js 2018-04-27 14:06:15 +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
Daniel Huigens
ba2b761da4 Implement OCB mode 2018-04-27 14:06:15 +02:00
Daniel Huigens
cc4cc38fe7 Add util.print_debug_hexarray_dump 2018-04-27 14:06:15 +02:00
Daniel Huigens
f40489aa43 Implement getLeftNBits, shiftLeft and shiftRight for Uint8Arrays 2018-04-27 14:06:14 +02:00