From 9e33febe3f467d43b9bd2a1a152be0f1edbe85f6 Mon Sep 17 00:00:00 2001 From: Tnze Date: Wed, 7 Dec 2022 11:52:47 +0800 Subject: [PATCH] Squashed commit of the following: commit 1f029f560d96e4c273fbbc6e85cde23956967521 Author: Tnze Date: Wed Dec 7 11:42:39 2022 +0800 Adjust struct field name commit 3216cc964c87880cfe3d76492a6ad399cb5660e8 Author: patyhank Date: Wed Dec 7 11:25:28 2022 +0800 Change PublicKeySignature to V2 commit 3308bd67b29f7734344d83503d41960934f84086 Author: patyhank Date: Wed Dec 7 11:19:20 2022 +0800 Change PublicKeySignature to V2 --- yggdrasil/user/user.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/yggdrasil/user/user.go b/yggdrasil/user/user.go index b062ea2..913fe5a 100644 --- a/yggdrasil/user/user.go +++ b/yggdrasil/user/user.go @@ -22,9 +22,10 @@ type KeyPairResp struct { PrivateKey string `json:"privateKey"` PublicKey string `json:"publicKey"` } `json:"keyPair"` - PublicKeySignature string `json:"publicKeySignature"` - ExpiresAt time.Time `json:"expiresAt"` - RefreshedAfter time.Time `json:"refreshedAfter"` + PublicKeySignature string `json:"publicKeySignature"` + PublicKeySignatureV2 string `json:"publicKeySignatureV2"` + ExpiresAt time.Time `json:"expiresAt"` + RefreshedAfter time.Time `json:"refreshedAfter"` } func (k KeyPairResp) WriteTo(w io.Writer) (int64, error) { @@ -32,7 +33,7 @@ func (k KeyPairResp) WriteTo(w io.Writer) (int64, error) { if block == nil { return 0, errors.New("pem decode error: no data is found") } - signature, err := base64.StdEncoding.DecodeString(k.PublicKeySignature) + signature, err := base64.StdEncoding.DecodeString(k.PublicKeySignatureV2) if err != nil { return 0, err }