Commit Graph

105 Commits

Author SHA1 Message Date
shrimp b11846dbb3 Update API endpoint and version, set User-Agent
Helps with:
https://github.com/emersion/hydroxide/issues/179
2022-06-23 20:02:07 +02:00
yulqen 9ef1b1c30b
Fix for issue #213 - EncToken exception (#214) 2022-05-06 19:24:30 +02:00
Simon Ser 3c52837053 Check private key token signatures 2021-11-23 12:33:33 +01:00
Simon Ser 5eadb35c67 Extract address key passphrases from encrypted token 2021-11-23 12:22:44 +01:00
Simon Ser 9aeff319ba Upgrade dependencies
github.com/ProtonMail/go-crypto contains breaking changes.
2021-11-23 11:14:04 +01:00
Simon Ser 4c7fd88d57 protonmail: mark more Message fields as json omitempty
Setting an empty ExternalID results in an e-mail with:

    Message-Id: <>
2021-07-30 15:32:37 +02:00
proletarius101 0df2e43d8d imports: change the crypto lib to new import path 2021-04-08 11:13:32 +02:00
Simon Ser 5dc0d0b2e8
protonmail: update calendar endpoints
They are now under the /calendar/v1 prefix.
2020-10-13 17:29:16 +02:00
Simon Ser ea188ff133
protonmail: add Client.GetConversation 2020-09-14 12:46:22 +02:00
Simon Ser 0e0fb0c38e
protonmail: introduce Timestamp 2020-09-14 12:09:50 +02:00
Daniel Bertalan fe6f0a620f protonmail: make SRP modulus signature failures fatal
In 93c8007, SRP signature errors were made non-fatal because many
users got the following error:

    openpgp: unsupported feature: public key algorithm 22

This is because Protonmail started signing these messages with an
EDDSA key, an algorithm which the Go OpenPGP library does not
support. The switch to github.com/protonmail/crypto introduces this
algorithm, so messages that haven't been tampered with should pass
the verification.
2020-07-02 12:23:44 +02:00
Daniel Bertalan 06f6d5b8e9 protonmail: verify SRP modulus signatures
Code follows how the official proton-bridge is doing it.
2020-07-02 12:23:44 +02:00
Daniel Bertalan c483823b5c Use Protonmail fork of golang.org/x/crypto
Adds support for ed25519 (termed State-of-the-art by PM) private
keys. SRP modulus signature verification segfaults, so I commented
it out.
2020-07-02 12:23:44 +02:00
Simon Ser 0b790847d9
protonmail: add ListCalendars, ListCalendarEvents 2020-03-12 01:23:24 +01:00
Simon Ser 1557b45d88
imap: add support for multiple Reply-To fields 2020-03-09 10:08:47 +01:00
Simon Ser d97056a61a
protonmail: add Client.Debug
This prints HTTP requests and responses.
2020-03-07 18:12:53 +01:00
Simon Ser 4ede51e2b0
protonmail: fix "invalid refresh token" errors
The UID is now provided as a header field.

Closes: https://github.com/emersion/hydroxide/issues/81
2020-03-07 18:09:50 +01:00
Dmitry Valter ea106494fe Fix Attachment Error 15212
Change AttachmentKeys format from ID:Key to ID:{Algorithm,Key}.
2020-03-02 11:59:24 +01:00
Simon Ser cffd3cd13a
protonmail: add Client.ListLabels 2020-01-29 14:39:30 +01:00
Harley Lang f7b1ac9d6e Increased MaxSpace int size (#80)
* Increased MaxSpace int size

This change prevents errors when python smtplib calls hydroxide.

* Updated UsedSpace to int64

To prevent errors when numbers exceed 32 bit capacity.
2020-01-04 18:33:23 +01:00
Simon Ser 897ec17f53
go fmt 2019-12-09 12:27:16 +01:00
Simon Ser 80e0fa6f3e
Fix 2FA support
The 2FA information is now returned after the /auth request instead of
the /auth/info one.

Closes: https://github.com/emersion/hydroxide/issues/76
2019-12-08 12:14:41 +01:00
Simon Ser db983eed89
protonmail: fix "invalid input" error on /auth/refresh
It seems like we were just missing a valid RedirectURI.

References: https://github.com/emersion/hydroxide/issues/70
2019-11-14 09:12:34 +01:00
Simon Ser cc03e059b9
Save key salts after auth
The key salts endpoint can only be accessed right after authentication, it's
blocked after auth refresh.

Closes: https://github.com/emersion/hydroxide/issues/68
2019-08-31 17:43:49 +03:00
Simon Ser 4c2066d28f
protonmail: log failed requests 2019-08-31 17:35:27 +03:00
Simon Ser 75984c4ff4
protonmail: fix /auth/refresh, remove Client{ID,Secret}
ClientID and ClientSecret are no longer used.

Closes: https://github.com/emersion/hydroxide/issues/68
2019-08-31 16:19:54 +03:00
Simon Ser 41b720f09f
protonmail: AccessToken isn't encrypted anymore
Closes: https://github.com/emersion/hydroxide/issues/67
2019-08-14 23:01:39 +03:00
Simon Ser fef10d24fd
protonmail: update AuthInfo struct 2019-08-14 22:33:31 +03:00
Simon Ser fbf85fecaa
Add preliminary support for imports 2019-07-30 20:51:46 +03:00
Simon Ser ba96d886d8
protonmail: skip keys we can't read
Updates https://github.com/emersion/hydroxide/issues/46
2019-04-14 21:10:06 +03:00
Simon Ser fc1618d086
protonmail: improve errors 2019-04-14 19:07:03 +03:00
Simon Ser ff4f1f7876
protonmail: fix typo in filename 2019-04-14 19:05:58 +03:00
Simon Ser 139f3921e7
protonmail: make auth errors more verbose 2019-04-13 14:03:12 +03:00
Simon Ser 93c8007937
protonmail: make SRP modulus signature failures a warning
Temporarily make signature errors non-fatal because the Go OpenPGP library is
missing some features we need:

    openpgp: unsupported feature: public key algorithm 22

This doesn't really weaken our security since we weren't checking the signature
key anyway. To completely fix this issue, we need to upstream the required
key algorithm.

Fixes https://github.com/emersion/hydroxide/issues/46
2019-04-13 13:58:21 +03:00
emersion ee861e4175
Make it clear that failing to unlock a key isn't fatal 2018-11-24 16:51:23 +01:00
emersion 0b3c3ddde5
Address review comments 2018-10-28 16:52:57 +01:00
Brandon McDonnell 7b92deb6ac
protonmail: Do not duplicate primary account key in keyring.
Probably not worth the extra overhead the way I did it, but neater.
2018-10-28 16:19:30 +01:00
Brandon McDonnell c610c633a8
protonmail: Fetch and decrypt all account keys. 2018-10-28 16:19:26 +01:00
emersion 47ee090a70
go fmt 2018-10-21 14:07:46 +02:00
emersion 905b9e170b
protonmail: add cipherFunctionString 2018-10-21 14:05:26 +02:00
emersion 0248c4c722
protonmail: remove unused types for now 2018-10-21 12:27:04 +02:00
emersion d76f081114
protonmail: remove User.Addresses, add Client.ListAddresses 2018-10-21 12:24:56 +02:00
emersion 6bd8ce1b6e
go fmt 2018-10-21 12:15:20 +02:00
Brandon McDonnell 49160bcd3e protonmail: Fix typo in MessageBodyKey struct. 2018-10-20 22:31:53 +00:00
Brandon McDonnell 05ad63560f protonmail: Re-use local request variable in GetCurrentUser(). 2018-10-20 22:13:08 +00:00
Brandon McDonnell deb4662abb protonmail: Define struct MessageBodyKey. 2018-10-20 22:13:02 +00:00
Brandon McDonnell 71f1167182 protonmail: Change API endpoint for SendMessage. 2018-10-20 14:50:11 +00:00
Brandon McDonnell 9a6f7187a5 protonmail: Update MessagePackageSet BodyKey for new API. 2018-10-20 14:50:07 +00:00
Brandon McDonnell ba4caffa08 protonmail: Fetch user addresses using new API. 2018-10-20 14:49:56 +00:00
Adam Pioterek a4bd5e7dc9
PM API: read field in messages name changed to unread 2018-10-19 17:51:01 +02:00