Commit graph

253 commits

Author SHA1 Message Date
wussler
ff2d068b47
Merge pull request #150 from cquintana92/feature/lock-global-pgp-fields
Use a lock to protect global pgp fields from concurrent read/write operations
2021-10-19 10:10:18 +02:00
Carlos Quintana
9ca489189a
Upgrade XCode version to 13.0 in Workflows 2021-10-19 09:54:29 +02:00
Carlos Quintana
2118a0e776
Lint fixes 2021-10-19 09:06:09 +02:00
Carlos Quintana
c406b182bb
Replace Mutex with RWMutex 2021-10-19 08:09:59 +02:00
Carlos Quintana
9f25490f61
Lock global gopenpgp fields 2021-10-18 11:40:58 +02:00
wussler
d1b2846135
Merge pull request #148 from ProtonMail/release-2.2.4
Release v2.2.4
2021-09-29 16:56:40 +02:00
Aron Wussler
190a41c146 Release v2.2.4 2021-09-29 16:48:30 +02:00
marinthiercelin
0465b888d9
Merge pull request #147 from ProtonMail/fix/wrong-verification-time
Fix: use verifyTime in the config time instead of Now()
2021-09-23 17:48:32 +02:00
marin thiercelin
5558d4a177
Fix: use verifyTime in the config time instead of Now()
When decrypting message, we have to use verifyTime in the config
otherwise signatures not valid at verifyTime but valid at Now()
will be seen as valid.
2021-09-23 17:14:19 +02:00
wussler
0b639a2d93
Merge pull request #146 from ProtonMail/generate-compression
Generate keys with compression & release 2.2.3
2021-09-21 14:03:39 +02:00
Aron Wussler
a00c613a03 Bump version numbers 2021-09-21 13:15:16 +02:00
Aron Wussler
dcd95f3e5b Fix linter 2021-09-21 11:34:17 +02:00
Aron Wussler
64c051f0d9 Generate keys with compression & release 2.2.3 2021-09-21 11:20:36 +02:00
wussler
88d66965eb
Merge pull request #143 from ProtonMail/release-2.2.2
Release version 2.2.2
2021-08-04 13:27:03 +02:00
Aron Wussler
af7164439a Release version 2.2.2 2021-08-04 12:15:11 +02:00
wussler
2329c36a25
Merge pull request #142 from ProtonMail/new-key-entity
Add NewKeyFromEntity
2021-08-04 12:13:43 +02:00
Aron Wussler
e0531b779c Add NewKeyFromEntity 2021-08-04 12:04:20 +02:00
wussler
f9295608fa
Merge pull request #136 from ProtonMail/docs-messages
Add documentation for text messages
2021-08-03 21:08:41 +02:00
Aron Wussler
26dd18cf42 Add documentation for messages 2021-08-03 20:55:03 +02:00
wussler
0ead04a4c2
Merge pull request #141 from ProtonMail/docs-dummy
Add changelog for Dummy key changes
2021-07-30 14:56:29 +02:00
Aron Wussler
eb311a801f Add changelog 2021-07-30 14:54:38 +02:00
wussler
a3d8ed70c8
Merge pull request #139 from T4cC0re/master
Disregard GNU dummy subkeys when checking (un)locked state and unlocking a crypto.Key
2021-07-30 14:49:41 +02:00
wussler
abf7e6f86a
Merge branch 'master' into master 2021-07-30 14:39:28 +02:00
wussler
a5fa9e21f3
Merge pull request #97 from ProtonMail/deprecate-check
Deprecate Key#Check()
2021-07-30 14:37:13 +02:00
Aron Wussler
5904ff3d70 Add static malformed key test 2021-07-30 13:01:23 +02:00
Aron Wussler
48d4852e6a Improve readme 2021-07-30 12:28:03 +02:00
Aron Wussler
b50a051c7e Deprecate Key#Check() 2021-07-30 11:20:38 +02:00
wussler
dc08a383a1
Merge pull request #140 from ProtonMail/release-2.2.1
Release version 2.2.1
2021-07-27 14:33:55 +02:00
Aron Wussler
44016a15c4 Release version 2.2.1 2021-07-27 12:55:10 +02:00
Hendrik 'T4cC0re' Meyer
c5a8b1f2f7 Disregard GNU dummy subkeys when checking (un)locked state and unlocking a crypto.Key
Because a GNU dummy key has a `PrivateKey` property, the existing check will
count it as a key to be decrypted. However, a `Decrypt` call on such key will
then yield an error, as it is a dummy key.

This commit addresses this behaviour by summing all valid decrpytable private
keys and returning on their count.
Further, it adapts `Unlock` to ignore any dummy subkey.

Fixes #138
2021-07-18 22:45:18 +02:00
wussler
126388e321
Merge pull request #137 from ProtonMail/feat/explicit-stream-verify
Add a wrapper for explicit verification of decrypted streams.
2021-07-16 13:29:53 +02:00
marin thiercelin
77df8cba3d
Fix signature status when verifying unsigned message
Return `SIGNATURE_NOT_SIGNED` instead of `SIGNATURE_NO_VERIFIER` when
verifying a messages with no embedded signatures.
2021-07-16 12:17:18 +02:00
marin thiercelin
f4ccc63c40
Add a helper to verify stream signatures explicitly
Adds the helper `VerifySignatureExplit()` to get an explicit `SignatureVerificationError`
when verifying a `PlainMessageReader`. This is needed for mobile apps, that
can't cast an error to a signature error.
2021-07-16 12:16:33 +02:00
larabr
cd4adae9f2
Update error messages in passwordDecrypt (#124) 2021-07-05 10:42:18 +02:00
wussler
cba6683c62
Release v2.2.0 (#135) 2021-06-30 17:07:52 +02:00
marinthiercelin
c46ed8ed9e
Add a streaming api to KeyRing and SessionKey (#131)
* barebone streaming functionality

* encryption needs to return a writecloser

* added eof check

* workaround for reader problem with copies

* separate mobile wrappers from main api

* add a clone in the read result to avoid memory corruption

* refactor to reuse code, and fix verification

* have to give the verify key at the start of the decryption

* enfore readAll before signature verification

* streaming api for SessionKey

* add split message stream apis

* name interface params

* fix streaming api so it's supported by go-mobile

* hide internal writeCloser

* fix nil access

* added detached sigs methods

* started unit testing

* unit testing and fixed a bug where key and data packets where inverted

* remove unecessary error wrapping

* figured out closing order and error handling

* add GC calls to mobile writer and reader

* remove debugging values and arrays

* writer with builtin sha256

* unit testing the mobile helpers

* comments and linting

* Typo in error

Co-authored-by: wussler <aron@wussler.it>

* Add GetKeyPacket doc

Co-authored-by: wussler <aron@wussler.it>

* Add rfc reference in comments

Co-authored-by: wussler <aron@wussler.it>

* small improvements

* add compatibility tests with normal methods

* remove unecessary copies in the tests

* update go-crypto to the merged changes commit

* update comments of core internal functions

* remove unused nolint comment

* group message metadata in a struct

* fix comments

* change default values for metadata

* change the mobile reader wrapper to fit the behavior of java

* remove gc calls in the wrappers to avoid performance penalties

* bring back the former Go2MobileReader to be used for ios

* Update crypto/keyring_streaming.go

Co-authored-by: wussler <aron@wussler.it>

* return an error when verifying an embedded sig with no keyring

* Update crypto/sessionkey_streaming.go

Co-authored-by: wussler <aron@wussler.it>

* linter error

* update changelog

* update changelog

Co-authored-by: wussler <aron@wussler.it>
2021-06-30 16:49:30 +02:00
wussler
7380f7391f
Refactor internals of client time (#134) 2021-06-16 17:24:25 +02:00
wussler
039f757e93
Remove monotonic clock (#133) 2021-06-16 14:06:07 +02:00
wussler
0e109ca7ce
Release version 2.1.9 (#132) 2021-05-12 10:08:19 +02:00
Daniel Huigens
9126511a96
Update go-crypto (#129)
* Update go-crypto

* Edit changelog

Co-authored-by: Aron Wussler <aron@wussler.it>
2021-04-28 18:33:14 +02:00
Aron Wussler
38a773b9aa Release version 2.1.8 2021-04-27 17:40:13 +02:00
wussler
c19faed5da
Add methods for embedded signatures using session keys (#128)
* Add methods to sign when using session keys

* Add mobile helpers for explicit decryption

* Add functions to CHANGELOG

* Fix linter
2021-04-27 17:38:25 +02:00
Aditya Wasan
3dd1711707
Add methods to get key capabilities (#125)
* Add methods to get key capabilities

Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>

* Use correct indetity to check for flags

Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>

* Fix lint

Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>

* Remove CanCertify and update CanSign to use SigningKey

Signed-off-by: GitHub <noreply@github.com>

* keyring: implement CanSign and CanEncrypt

Signed-off-by: GitHub <noreply@github.com>

* key/keyring: add tests for key capabilities

Signed-off-by: GitHub <noreply@github.com>

* Apply suggestions from code review

Renames CanSign to CanVerify and adds an extended test for public-only keys to confirm CanVerify is true for them.

Co-authored-by: wussler <aron@wussler.it>

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Co-authored-by: wussler <aron@wussler.it>
2021-04-09 12:32:10 +02:00
wussler
80b9a7aca2
Release 2.1.7 (#123) 2021-03-30 12:06:50 +02:00
wussler
934571ce56
Fix AES tests for helpers (#122) 2021-03-30 11:46:32 +02:00
marinthiercelin
973856d299
Add new attachment processor that uses pre-allocated buffer (#120) 2021-03-29 20:46:47 +02:00
marinthiercelin
b5823b9dee
Update to go 1.16 for mobile builds (#121)
* modified build script to work with updated fork of go-mobile

* changed spacing and added trace for easier debugging

* fixed issue with user input overwritten

* removed mentions of make

* use go 1.16 in builds

* disabled some linters

* updated change log

Co-authored-by: wussler <aron@wussler.it>
2021-03-29 16:29:34 +02:00
wussler
7b16cf94c8
Release 2.1.6 (#119) 2021-03-17 16:54:47 +01:00
Daniel Huigens
32842f4135 Update go-crypto 2021-03-17 14:29:41 +01:00
wussler
ff54225384
Fix various keys issues (#117)
* Fix armouring headers for public keys
* Fix error for session key decryption failure
2021-03-09 19:06:35 +01:00