mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-04-20 19:38:39 +00:00
replace golang.org/x/crypto/openpgp with github.com/ProtonMail/go-crypto/openpgp
This commit is contained in:
committed by
Benj Fassbind
parent
f1649a647b
commit
cfcab13c2a
@@ -13,12 +13,10 @@ import (
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
// TODO: replace crypto/openpgp since it is deprecated
|
||||
// https://github.com/golang/go/issues/44226
|
||||
"golang.org/x/crypto/openpgp" //nolint:staticcheck
|
||||
"golang.org/x/crypto/openpgp/clearsign" //nolint:staticcheck
|
||||
openpgp_errors "golang.org/x/crypto/openpgp/errors" //nolint:staticcheck
|
||||
"golang.org/x/crypto/openpgp/packet" //nolint:staticcheck
|
||||
"github.com/ProtonMail/go-crypto/openpgp"
|
||||
"github.com/ProtonMail/go-crypto/openpgp/clearsign"
|
||||
openpgp_errors "github.com/ProtonMail/go-crypto/openpgp/errors"
|
||||
"github.com/ProtonMail/go-crypto/openpgp/packet"
|
||||
"golang.org/x/term"
|
||||
)
|
||||
|
||||
|
||||
@@ -11,12 +11,10 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
// TODO: replace crypto/openpgp since it is deprecated
|
||||
// https://github.com/golang/go/issues/44226
|
||||
"golang.org/x/crypto/openpgp" //nolint:staticcheck
|
||||
"golang.org/x/crypto/openpgp/armor" //nolint:staticcheck
|
||||
"golang.org/x/crypto/openpgp/errors" //nolint:staticcheck
|
||||
"golang.org/x/crypto/openpgp/packet" //nolint:staticcheck
|
||||
"github.com/ProtonMail/go-crypto/openpgp"
|
||||
"github.com/ProtonMail/go-crypto/openpgp/armor"
|
||||
"github.com/ProtonMail/go-crypto/openpgp/errors"
|
||||
"github.com/ProtonMail/go-crypto/openpgp/packet"
|
||||
)
|
||||
|
||||
// hashForSignature returns a pair of hashes that can be used to verify a
|
||||
@@ -94,12 +92,6 @@ func checkDetachedSignature(keyring openpgp.KeyRing, signed, signature io.Reader
|
||||
sigType = sig.SigType
|
||||
creationTime = sig.CreationTime
|
||||
pubKeyAlgo = sig.PubKeyAlgo
|
||||
case *packet.SignatureV3:
|
||||
issuerKeyID = sig.IssuerKeyId
|
||||
hashFunc = sig.Hash
|
||||
sigType = sig.SigType
|
||||
creationTime = sig.CreationTime
|
||||
pubKeyAlgo = sig.PubKeyAlgo
|
||||
default:
|
||||
return nil, 0, errors.StructuralError("non signature packet found")
|
||||
}
|
||||
@@ -129,8 +121,6 @@ func checkDetachedSignature(keyring openpgp.KeyRing, signed, signature io.Reader
|
||||
switch sig := p.(type) {
|
||||
case *packet.Signature:
|
||||
err = key.PublicKey.VerifySignature(h, sig)
|
||||
case *packet.SignatureV3:
|
||||
err = key.PublicKey.VerifySignatureV3(h, sig)
|
||||
default:
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user