Skip to content

Commit a896ae4

Browse files
authored
Merge pull request #211 from ProtonMail/upgrade-go-crypto
Upgrade go crypto and adapt SEIPD
2 parents 2adafdb + 47534e9 commit a896ae4

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

crypto/sessionkey.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,15 @@ func encryptStreamWithSessionKey(
239239
signEntity *openpgp.Entity,
240240
config *packet.Config,
241241
) (encryptWriter, signWriter io.WriteCloser, err error) {
242-
encryptWriter, err = packet.SerializeSymmetricallyEncrypted(dataPacketWriter, config.Cipher(), sk.Key, config)
242+
encryptWriter, err = packet.SerializeSymmetricallyEncrypted(
243+
dataPacketWriter,
244+
config.Cipher(),
245+
config.AEAD() != nil,
246+
packet.CipherSuite{Cipher: config.Cipher(), Mode: config.AEAD().Mode()},
247+
sk.Key,
248+
config,
249+
)
250+
243251
if err != nil {
244252
return nil, nil, errors.Wrap(err, "gopenpgp: unable to encrypt")
245253
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/ProtonMail/gopenpgp/v2
33
go 1.15
44

55
require (
6-
github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4
6+
github.com/ProtonMail/go-crypto v0.0.0-20230124153114-0acdc8ae009b
77
github.com/ProtonMail/go-mime v0.0.0-20221031134845-8fd9bc37cf08
88
github.com/davecgh/go-spew v1.1.1 // indirect
99
github.com/pkg/errors v0.9.1

go.sum

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=
12
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
2-
github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4 h1:ra2OtmuW0AE5csawV4YXMNGNQQXvLRps3z2Z59OPO+I=
3-
github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4/go.mod h1:UBYPn8k0D56RtnR8RFQMjmh4KrZzWJ5o7Z9SYjossQ8=
3+
github.com/ProtonMail/go-crypto v0.0.0-20230124153114-0acdc8ae009b h1:1DHH9haxfhaVM8owXQjLdn7UP4AkDfzSdiRoLdcSCqE=
4+
github.com/ProtonMail/go-crypto v0.0.0-20230124153114-0acdc8ae009b/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g=
45
github.com/ProtonMail/go-mime v0.0.0-20221031134845-8fd9bc37cf08 h1:dS7r5z4iGS0qCjM7UwWdsEMzQesUQbGcXdSm2/tWboA=
56
github.com/ProtonMail/go-mime v0.0.0-20221031134845-8fd9bc37cf08/go.mod h1:qRZgbeASl2a9OwmsV85aWwRqic0NHPh+9ewGAzb4cgM=
67
github.com/ProtonMail/go-mobile v0.0.0-20210326110230-f181c70e4e2b h1:XVeh08xp93T+xK6rzpCSQTZ+LwEo+ASHvOifrQ5ZgEE=

0 commit comments

Comments
 (0)