Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump github.com/go-piv/piv-go from 1.11.0 to 2.0.0+incompatible #3849

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cmd/cosign/cli/pivcli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"os"
"strings"

"github.com/go-piv/piv-go/piv"
"github.com/go-piv/piv-go/v2/piv"
"github.com/manifoldco/promptui"

"github.com/sigstore/cosign/v2/pkg/cosign/pivkey"
Expand All @@ -46,7 +46,7 @@ func SetManagementKeyCmd(_ context.Context, oldKey, newKey string, randomKey boo
if err != nil {
return err
}
var newBytes *[24]byte
var newBytes *[]byte
if randomKey {
if !Confirm("Resetting management key to random value. You must factory reset the device to change this value") {
return nil
Expand Down Expand Up @@ -286,14 +286,14 @@ func ResetKeyCmd(ctx context.Context) error {
return yk.Reset()
}

func keyBytes(s string) (*[24]byte, error) {
func keyBytes(s string) (*[]byte, error) {
if s == "" {
return &piv.DefaultManagementKey, nil
}
if len(s) > 24 {
return nil, errors.New("key too long, must be <24 characters")
}
ret := [24]byte{}
ret := []byte{}
copy(ret[:], s)
return &ret, nil
}
Expand All @@ -312,8 +312,8 @@ var Confirm = func(p string) bool {
return strings.ToLower(result) == "y"
}

func randomManagementKey() (*[24]byte, error) {
var newKeyBytes [24]byte
func randomManagementKey() (*[]byte, error) {
var newKeyBytes []byte
n, err := io.ReadFull(rand.Reader, newKeyBytes[:])
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/go-openapi/runtime v0.28.0
github.com/go-openapi/strfmt v0.23.0
github.com/go-openapi/swag v0.23.0
github.com/go-piv/piv-go v1.11.0
github.com/go-piv/piv-go/v2 v2.2.0
github.com/google/certificate-transparency-go v1.2.1
github.com/google/go-cmp v0.6.0
github.com/google/go-containerregistry v0.20.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+Gr
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
github.com/go-openapi/validate v0.24.0 h1:LdfDKwNbpB6Vn40xhTdNZAnfLECL81w+VX3BumrGD58=
github.com/go-openapi/validate v0.24.0/go.mod h1:iyeX1sEufmv3nPbBdX3ieNviWnOZaJ1+zquzJEf2BAQ=
github.com/go-piv/piv-go v1.11.0 h1:5vAaCdRTFSIW4PeqMbnsDlUZ7odMYWnHBDGdmtU/Zhg=
github.com/go-piv/piv-go v1.11.0/go.mod h1:NZ2zmjVkfFaL/CF8cVQ/pXdXtuj110zEKGdJM6fJZZM=
github.com/go-piv/piv-go/v2 v2.2.0 h1:kOcyd7+JiKLF1BtGUO6vg7XlDJLhchinoMuksOpWBEI=
github.com/go-piv/piv-go/v2 v2.2.0/go.mod h1:ShZi74nnrWNQEdWzRUd/3cSig3uNOcEZp+EWl0oewnI=
github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI=
github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow=
github.com/go-rod/rod v0.116.2 h1:A5t2Ky2A+5eD/ZJQr1EfsQSe5rms5Xof/qj296e+ZqA=
Expand Down
6 changes: 3 additions & 3 deletions pkg/cosign/pivkey/pivkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"os"
"syscall"

"github.com/go-piv/piv-go/piv"
"github.com/go-piv/piv-go/v2/piv"
"golang.org/x/term"

"github.com/sigstore/sigstore/pkg/signature"
Expand Down Expand Up @@ -113,7 +113,7 @@ func (k *Key) GetAttestationCertificate() (*x509.Certificate, error) {
return k.card.AttestationCertificate()
}

func (k *Key) SetManagementKey(old, new [24]byte) error {
func (k *Key) SetManagementKey(old, new []byte) error {
if k.card == nil {
return KeyNotInitialized
}
Expand Down Expand Up @@ -153,7 +153,7 @@ func (k *Key) Unblock(puk, newPIN string) error {
return k.card.Unblock(puk, newPIN)
}

func (k *Key) GenerateKey(mgmtKey [24]byte, slot piv.Slot, opts piv.Key) (crypto.PublicKey, error) {
func (k *Key) GenerateKey(mgmtKey []byte, slot piv.Slot, opts piv.Key) (crypto.PublicKey, error) {
if k.card == nil {
return nil, KeyNotInitialized
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cosign/pivkey/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package pivkey

import (
"github.com/go-piv/piv-go/piv"
"github.com/go-piv/piv-go/v2/piv"
)

func SlotForName(slotName string) *piv.Slot {
Expand Down
Loading