From 166329992eec585bea4247dcd6c639966604e340 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Sun, 22 Sep 2024 08:40:45 +0000 Subject: design/68723-crypto-ssh-v2.md: crypto.Signer returns ed25519 keys as value This is now consistent with x509.MarshalPKCS8PrivateKey, see golang/go#51974 Change-Id: Id643ef260facfb38730bc3db30e63555aa3d64a4 GitHub-Last-Rev: 5e5819e13c3c59b5b3d13b2ad6722f526c11aeb0 GitHub-Pull-Request: golang/proposal#53 Reviewed-on: https://go-review.googlesource.com/c/proposal/+/614278 Commit-Queue: Nicola Murino Reviewed-by: Nicola Murino Auto-Submit: Nicola Murino --- design/68723-crypto-ssh-v2.md | 5 +++++ design/68723/ssh.html | 3 +++ 2 files changed, 8 insertions(+) (limited to 'design') diff --git a/design/68723-crypto-ssh-v2.md b/design/68723-crypto-ssh-v2.md index 8827f14..5210f9e 100644 --- a/design/68723-crypto-ssh-v2.md +++ b/design/68723-crypto-ssh-v2.md @@ -391,6 +391,9 @@ type PrivateKeySigner struct { Signer } +// CryptoSigner returns the private key associated with the Signer. It returns a +// *rsa.PrivateKey, an *ecdsa.PrivateKey or an ed25519.PrivateKey (not a pointer). +// Note: in v1 ed25519.PrivateKey was returned as a pointer. func (k *PrivateKeySigner) CryptoSigner() crypto.Signer func ParsePrivateKey(pemBytes []byte) (*PrivateKeySigner, error) @@ -398,6 +401,8 @@ func ParsePrivateKey(pemBytes []byte) (*PrivateKeySigner, error) func ParsePrivateKeyWithPassphrase(pemBytes, passphrase []byte) (*PrivateKeySigner, error) ``` +Differently from v1, `CryptoSigner` returns ed25519.PrivateKey as value and not as pointer, see [golang/go#51974](https://github.com/golang/go/issues/51974). + ### Add MarshalPrivateKeyOptions Instead of passing options as function parameters to `MarshalPrivateKey` add a struct for options. diff --git a/design/68723/ssh.html b/design/68723/ssh.html index ff90f86..47c353a 100644 --- a/design/68723/ssh.html +++ b/design/68723/ssh.html @@ -1965,6 +1965,9 @@ encoded private key and passphrase. It supports the same keys as ssh.ParsePrivateKey.

func (*PrivateKeySigner) CryptoSigner

func (k *PrivateKeySigner) CryptoSigner() crypto.Signer
+

CryptoSigner returns the private key associated with the Signer. It returns a + *rsa.PrivateKey, an *ecdsa.PrivateKey or an ed25519.PrivateKey (not a pointer). + Note: in v1 ed25519.PrivateKey was returned as a pointer.

type PublicKey

type PublicKey interface {
 	// Type returns the key format name, e.g. "ssh-rsa".
-- 
cgit v1.3