Skip to content

Commit

Permalink
Add type of ed25519 key for TUF (#1677)
Browse files Browse the repository at this point in the history
Without this, MarshalPublicKeyToDER returns an error since the type of
the key is []uint8 rather than ed25519.PublicKey.

Signed-off-by: Hayden Blauzvern <[email protected]>
  • Loading branch information
haydentherapper authored Sep 12, 2023
1 parent f88ce12 commit ceef5a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/pki/tuf/tuf.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package tuf

import (
"crypto/ed25519"
"crypto/sha256"
"crypto/x509"
"encoding/hex"
Expand Down Expand Up @@ -210,7 +211,7 @@ func (k PublicKey) Identities() ([]identity.Identity, error) {
})
case data.KeyTypeEd25519:
// key is stored as a 32-byte string
pub := []byte(verifier.Public())
pub := ed25519.PublicKey(verifier.Public())
pkixKey, err := cryptoutils.MarshalPublicKeyToDER(pub)
if err != nil {
return nil, err
Expand Down

0 comments on commit ceef5a5

Please sign in to comment.