GODT-1940: Fix message encryption

Update liteapi to v0.36.0 to include message encryption fix and fix
compile errors related to update.
This commit is contained in:
Leander Beernaert
2022-10-25 14:57:05 +02:00
committed by James Houlahan
parent afc5307a23
commit 8e34b51c77
4 changed files with 10 additions and 12 deletions

4
go.mod
View File

@ -5,7 +5,7 @@ go 1.18
require ( require (
github.com/0xAX/notificator v0.0.0-20220220101646-ee9b8921e557 github.com/0xAX/notificator v0.0.0-20220220101646-ee9b8921e557
github.com/Masterminds/semver/v3 v3.1.1 github.com/Masterminds/semver/v3 v3.1.1
github.com/ProtonMail/gluon v0.13.1-0.20221024121621-eaf93a0dafd0 github.com/ProtonMail/gluon v0.13.1-0.20221025093924-86bbf0261eb8
github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a
github.com/ProtonMail/go-rfc5322 v0.11.0 github.com/ProtonMail/go-rfc5322 v0.11.0
github.com/ProtonMail/gopenpgp/v2 v2.4.10 github.com/ProtonMail/gopenpgp/v2 v2.4.10
@ -38,7 +38,7 @@ require (
github.com/sirupsen/logrus v1.9.0 github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.8.0 github.com/stretchr/testify v1.8.0
github.com/urfave/cli/v2 v2.20.3 github.com/urfave/cli/v2 v2.20.3
gitlab.protontech.ch/go/liteapi v0.35.1-0.20221024102125-605f4712c351 gitlab.protontech.ch/go/liteapi v0.36.0
go.uber.org/goleak v1.2.0 go.uber.org/goleak v1.2.0
golang.org/x/exp v0.0.0-20220921164117-439092de6870 golang.org/x/exp v0.0.0-20220921164117-439092de6870
golang.org/x/net v0.1.0 golang.org/x/net v0.1.0

8
go.sum
View File

@ -28,8 +28,8 @@ github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf h1:yc9daCCYUefEs
github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf/go.mod h1:o0ESU9p83twszAU8LBeJKFAAMX14tISa0yk4Oo5TOqo= github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf/go.mod h1:o0ESU9p83twszAU8LBeJKFAAMX14tISa0yk4Oo5TOqo=
github.com/ProtonMail/docker-credential-helpers v1.1.0 h1:+kvUIpwWcbtP3WFv5sSvkFn/XLzSqPOB5AAthuk9xPk= github.com/ProtonMail/docker-credential-helpers v1.1.0 h1:+kvUIpwWcbtP3WFv5sSvkFn/XLzSqPOB5AAthuk9xPk=
github.com/ProtonMail/docker-credential-helpers v1.1.0/go.mod h1:mK0aBveCxhnQ756AmaTfXMZDeULvheYVhF/MWMErN5g= github.com/ProtonMail/docker-credential-helpers v1.1.0/go.mod h1:mK0aBveCxhnQ756AmaTfXMZDeULvheYVhF/MWMErN5g=
github.com/ProtonMail/gluon v0.13.1-0.20221024121621-eaf93a0dafd0 h1:f1ncQIwvYCkpbDA2qJGALNKPmLPdwn9c7Gj58tS2PaM= github.com/ProtonMail/gluon v0.13.1-0.20221025093924-86bbf0261eb8 h1:LKyiQdEsAxAocSYUWxSfwlxBwmzJYvO/9td/eAX3oFU=
github.com/ProtonMail/gluon v0.13.1-0.20221024121621-eaf93a0dafd0/go.mod h1:XW/gcr4jErc5bX5yMqkUq3U+AucC2QZHJ5L231k3Nw4= github.com/ProtonMail/gluon v0.13.1-0.20221025093924-86bbf0261eb8/go.mod h1:XW/gcr4jErc5bX5yMqkUq3U+AucC2QZHJ5L231k3Nw4=
github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a h1:D+aZah+k14Gn6kmL7eKxoo/4Dr/lK3ChBcwce2+SQP4= github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a h1:D+aZah+k14Gn6kmL7eKxoo/4Dr/lK3ChBcwce2+SQP4=
github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a/go.mod h1:oTGdE7/DlWIr23G0IKW3OXK9wZ5Hw1GGiaJFccTvZi4= github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a/go.mod h1:oTGdE7/DlWIr23G0IKW3OXK9wZ5Hw1GGiaJFccTvZi4=
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo=
@ -399,8 +399,8 @@ github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsr
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/zclconf/go-cty v1.11.0 h1:726SxLdi2SDnjY+BStqB9J1hNp4+2WlzyXLuimibIe0= github.com/zclconf/go-cty v1.11.0 h1:726SxLdi2SDnjY+BStqB9J1hNp4+2WlzyXLuimibIe0=
github.com/zclconf/go-cty v1.11.0/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA= github.com/zclconf/go-cty v1.11.0/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA=
gitlab.protontech.ch/go/liteapi v0.35.1-0.20221024102125-605f4712c351 h1:0qom9c2XYMdW1J8JAMBgflL0a8SYwloi9tbE8FV2O2A= gitlab.protontech.ch/go/liteapi v0.36.0 h1:x9bODGDHQxPdnzGPBuzTArLdWJ+jTHpWAwGcvmn8Wig=
gitlab.protontech.ch/go/liteapi v0.35.1-0.20221024102125-605f4712c351/go.mod h1:VMv325o/Z3h9c6JL7loDVjXF0mqs4/7JbzhGmABxDj8= gitlab.protontech.ch/go/liteapi v0.36.0/go.mod h1:IM7ADWjgIL2hXopzx0WNamizEuMgM2QZl7QH12FNflk=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=

View File

@ -43,7 +43,7 @@ func TestBridge_Sync(t *testing.T) {
userID, addrID, err := s.CreateUser("imap", "imap@pm.me", password) userID, addrID, err := s.CreateUser("imap", "imap@pm.me", password)
require.NoError(t, err) require.NoError(t, err)
labelID, err := s.CreateLabel(userID, "folder", liteapi.LabelTypeFolder) labelID, err := s.CreateLabel(userID, "folder", "", liteapi.LabelTypeFolder)
require.NoError(t, err) require.NoError(t, err)
withClient(ctx, t, s, "imap", password, func(ctx context.Context, c *liteapi.Client) { withClient(ctx, t, s, "imap", password, func(ctx context.Context, c *liteapi.Client) {

View File

@ -357,11 +357,9 @@ func writeMultipartEncryptedRFC822(header message.Header, body []byte) ([]byte,
return nil, err return nil, err
} }
// If parsed header is empty then either it is malformed or it is missing. // Remove old content type header as it is non-standard. Ensure that messages
// Anyway message could not be considered multipart/mixed anymore since there will be no boundary. // without content type header entries don't become invalid.
if bodyHeader.Len() == 0 { header.Del("Content-Type")
header.Del("Content-Type")
}
entFields := bodyHeader.Fields() entFields := bodyHeader.Fields()