Commit graph

38 commits

Author SHA1 Message Date
Lysann Tranvouez
b7873e6d72 move functions around 2026-03-11 14:11:37 +01:00
Lysann Tranvouez
84eaf4ad7d PGPInterface can encrypt with multiple keys, PGPAgent can encrypt with all keys 2026-03-11 14:11:07 +01:00
Lysann Tranvouez
8d4f3af475 decryption: GopenPGPInterface tries to identify decryption key from message metadata
So the system can have multiple private keys, and the caller doesn't
need to specify a specific one regardless.

Ideally: If there are several matches we could also take into account
which keys have already been unlocked (or passthrases saved in
keychain). Right now it only grabs the first match.
2026-03-11 13:41:59 +01:00
Lysann Tranvouez
2ae751044c decryption: always request key passphrase based on key ID 2026-03-11 13:32:21 +01:00
Lysann Tranvouez
d136175d93 add detailed API tests checking how calls to PGPAgent propagate to the underlying interface
this is refactoring support, so that we can notice changes in how the
underlying APIs are called, and make changes intentionally when needed,
instead of accidentally.
2026-03-11 11:36:36 +01:00
Lysann Tranvouez
60999c7eab more tests: entity fetching + erase 2026-03-09 22:56:27 +01:00
Mingshen Sun
c5d9d258d8
Use createPGPMessage instead of CryptoNewPGPMessage to support ASCII-armored password with YubiKey (#658) 2024-11-30 11:29:27 -08:00
Danny Mösch
d9bd0f3014
Update SwiftLint and SwiftFormat (#613)
* Update Swift version used by SwiftFormat

* Update SwiftLint version

* Rely on new virtual 'all' rule in SwiftLint

* Enable SwiftLint rule 'direct_return' rule and fix all violations

* Enable SwiftLint rule 'shorthand_optional_binding' rule and fix all violations

* Enable SwiftLint rule 'blanket_disable_command' rule and fix all violations
2023-04-23 13:01:37 -07:00
Danny Moesch
819371f55e
Remove unused elements (#530) 2021-12-30 22:35:17 -08:00
Danny Moesch
cdedff0d4d
Use SwiftFormat version 0.49.x and enable some new rules (#527) 2021-12-27 17:57:11 -08:00
Danny Moesch
93954f3bec Use ProtonMail's GopenPGP library
This allows for a simpler setup and the usage of a recent version of Go. The library provides a build script which creates an XCFramework containing binaries for multiple target architectures. The gnu-dummy.patch is taken from mssun/gopenpgp. The forks are not needed anymore.
2021-06-20 12:30:14 +02:00
Danny Moesch
3f75591484 Use SwiftLint version 0.43.x 2021-03-07 16:42:08 -08:00
Danny Moesch
1454693308 Remove redundant 'else' blocks 2021-01-31 20:16:57 -08:00
Danny Moesch
ad4ed9419e Format code with SwiftFormat 2021-01-31 20:16:57 -08:00
Mingshen Sun
011762c4bd
Fix decryption issue when key without passphrase set 2021-01-10 15:01:21 -08:00
Mingshen Sun
1e1d6f0f44
Fix passphrase issue 2021-01-07 22:35:45 -08:00
Mingshen Sun
a62792bd11
Add ignore .gpg-id switch default ON 2021-01-07 21:58:38 -08:00
Danny Moesch
49c6b25611 Use SwiftFormat version 0.47.x 2020-11-09 10:13:05 -08:00
Danny Moesch
e8389eb262 Enable SwiftLint rule 'identifier_name' and handle all violations 2020-09-20 17:25:50 -07:00
Danny Moesch
56b7b24fce Move Crypto functionality back to passKit 2020-09-06 17:59:55 -07:00
Mingshen Sun
a92940e610
Add beta distrubution channel 2020-07-19 18:25:21 -07:00
Danny Moesch
4c2693e2c7 Name classes/structs consistently 2020-04-19 13:42:41 -07:00
Mingshen Sun
072f824158
No need to select key for encryption if there only one imported key 2020-04-18 23:21:50 -07:00
Mingshen Sun
fcc8961e46
Fix fail-safe mechanism for other decryption scenarios 2020-04-18 22:42:25 -07:00
Mingshen Sun
3e114daca1
Implement fail-safe mechanism if key id is not found 2020-04-17 23:56:14 -07:00
Mingshen Sun
0cae6af60d
Check existence of PGP keys before encrypt/decrypt 2020-04-14 20:20:16 -07:00
Mingshen Sun
eb6e854d92 Change logic of passphrass for multikeys 2020-04-13 21:23:23 -07:00
Mingshen Sun
e9c5b63c4b Refactor logic of request PGP key passphrase 2020-04-13 21:23:23 -07:00
Mingshen Sun
b7ee00815c Partially implement multikeys support (decryption) 2020-04-13 21:23:23 -07:00
Mingshen Sun
84b1c07f64 Update to gopengpg v2.0.0 2020-04-12 20:15:49 -07:00
Danny Moesch
a2edf41d33 Update SwiftyUserDefaults to current version 5.0.0 2020-01-01 19:03:04 -08:00
Danny Moesch
01ac9d38df Adapt code to changed API of GopenPGP 2019-11-08 14:05:25 -08:00
Danny Moesch
44cb864642 Wrap GopenPGP errors into more understandable app errors 2019-10-20 11:35:52 -07:00
Yishi Lin
e4630e950d Init PGPAgent while getting keyID 2019-10-02 11:04:10 +08:00
Yishi Lin
e0c32003e3 Cleanup and fix the erase logic
Explicitly uninit PGP agent during erasing all data.
2019-10-01 00:40:37 +08:00
Yishi Lin
e332b1f3be Do not forget pgp passphrase on decryption error #296 2019-09-30 02:05:01 +08:00
Yishi Lin
6b00d4911b Fix a decryption bug 2019-09-30 00:12:54 +08:00
Danny Moesch
730542d5bb Separate encryption/decryption logic for different frameworks used 2019-09-15 00:32:18 -07:00