Skip to content

Commit a1b7c72

Browse files
committed
Replace golang.org/x/crypto/openpgp with github.com/ProtonMail/go-crypto/openpgp
x/crypto/openpgp now contains a stronger deprecation warning: > // Deprecated: this package is unsafe by design, and has numerous known security > // issues. It is not maintained, and should not be used. and points at github.com/ProtonMail/go-crypto/openpgp , so use that one. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
1 parent 26be494 commit a1b7c72

5 files changed

Lines changed: 12 additions & 6 deletions

File tree

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module github.com/containers/ocicrypt
33
go 1.25.0
44

55
require (
6+
github.com/ProtonMail/go-crypto v1.4.1
67
github.com/go-jose/go-jose/v4 v4.1.4
78
github.com/miekg/pkcs11 v1.1.2
89
github.com/opencontainers/go-digest v1.0.0
@@ -12,15 +13,16 @@ require (
1213
github.com/stefanberger/go-pkcs11uri v0.0.0-20230803200340-78284954bff6
1314
github.com/stretchr/testify v1.11.1
1415
go.yaml.in/yaml/v3 v3.0.4
15-
golang.org/x/crypto v0.53.0
1616
golang.org/x/term v0.44.0
1717
google.golang.org/grpc v1.82.0
1818
google.golang.org/protobuf v1.36.11
1919
)
2020

2121
require (
22+
github.com/cloudflare/circl v1.6.2 // indirect
2223
github.com/davecgh/go-spew v1.1.1 // indirect
2324
github.com/pmezard/go-difflib v1.0.0 // indirect
25+
golang.org/x/crypto v0.53.0 // indirect
2426
golang.org/x/net v0.55.0 // indirect
2527
golang.org/x/sys v0.46.0 // indirect
2628
golang.org/x/text v0.38.0 // indirect

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
github.com/ProtonMail/go-crypto v1.4.1 h1:9RfcZHqEQUvP8RzecWEUafnZVtEvrBVL9BiF67IQOfM=
2+
github.com/ProtonMail/go-crypto v1.4.1/go.mod h1:e1OaTyu5SYVrO9gKOEhTc+5UcXtTUa+P3uLudwcgPqo=
13
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
24
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
5+
github.com/cloudflare/circl v1.6.2 h1:hL7VBpHHKzrV5WTfHCaBsgx/HGbBYlgrwvNXEVDYYsQ=
6+
github.com/cloudflare/circl v1.6.2/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4=
37
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
48
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
59
github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA=

gpgvault.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import (
2121
"fmt"
2222
"os"
2323

24-
"golang.org/x/crypto/openpgp"
25-
"golang.org/x/crypto/openpgp/packet"
24+
"github.com/ProtonMail/go-crypto/openpgp"
25+
"github.com/ProtonMail/go-crypto/openpgp/packet"
2626
)
2727

2828
// GPGVault defines an interface for wrapping multiple secret key rings

keywrap/pgp/keywrapper_gpg.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ import (
2828
"strconv"
2929
"strings"
3030

31+
"github.com/ProtonMail/go-crypto/openpgp"
32+
"github.com/ProtonMail/go-crypto/openpgp/packet"
3133
"github.com/containers/ocicrypt/config"
3234
"github.com/containers/ocicrypt/keywrap"
33-
"golang.org/x/crypto/openpgp"
34-
"golang.org/x/crypto/openpgp/packet"
3535
)
3636

3737
type gpgKeyWrapper struct {

utils/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ import (
2525
"fmt"
2626
"strings"
2727

28+
"github.com/ProtonMail/go-crypto/openpgp"
2829
"github.com/containers/ocicrypt/config/pkcs11config"
2930
"github.com/containers/ocicrypt/crypto/pkcs11"
3031
"github.com/go-jose/go-jose/v4"
3132
"go.yaml.in/yaml/v3"
32-
"golang.org/x/crypto/openpgp"
3333
)
3434

3535
// parseJWKPrivateKey parses the input byte array as a JWK and makes sure it's a private key

0 commit comments

Comments
 (0)