-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeProposalProposal-AcceptedProposal-CryptoProposal related to crypto packages or other security issuesProposal related to crypto packages or other security issues
Milestone
Description
The public keys in the x/crypto/ssh
package implement the following interface:
type CryptoPublicKey interface {
CryptoPublicKey() crypto.PublicKey
}
These methods return the underlying key for RSA, ECDSA, Ed25519, and DSA public keys. However, the ecdsa-sk and ed25519-sk keys do not implement that interface, forcing a user to unmarshal the serialized data to a struct to be able to get the underlying keys.
As the skECDSAPublicKey
and skEd25519PublicKey
already contain the key, the implementation would look like this:
func (k *skECDSAPublicKey) CryptoPublicKey() crypto.PublicKey {
return &k.PublicKey
}
func (k *skEd25519PublicKey) CryptoPublicKey() crypto.PublicKey {
return k.PublicKey
}
To be consistent with the rest of the CryptoPublicKey implementations, these methods will return the actual key, instead of a copy of it.
haydentherapper
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeProposalProposal-AcceptedProposal-CryptoProposal related to crypto packages or other security issuesProposal related to crypto packages or other security issues