From 8e4637492dcb0a6bbb60b4192588888e59044b24 Mon Sep 17 00:00:00 2001 From: Samuel Lorch Date: Wed, 22 Sep 2021 13:09:11 +0200 Subject: [PATCH] Add missing Comments --- README.md | 2 +- api/verify.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 68516de..50ecbf6 100644 --- a/README.md +++ b/README.md @@ -307,7 +307,7 @@ privkey, err := SetupAccount(ctx, rClient, userID, token, "password123") ## Verification -You can Verify that the Server hasen't changed, for that you need to initially setup the Verification and save the returned values. Then you can Verify that the serverkey hasen't changed since you setup the Verification. +You can Verify that the Server hasen't changed, for that you need to initially setup the Verification and save the returned values. Then you can Verify that the serverkey hasen't changed since you setup the Verification. Note this Only Works if the client is not logged in. ```go // Setup the Verification diff --git a/api/verify.go b/api/verify.go index 638ee42..b8d42d4 100644 --- a/api/verify.go +++ b/api/verify.go @@ -20,6 +20,7 @@ type GPGVerify struct { Token string `json:"server_verify_token,omitempty"` } +// SetupServerVerification sets up Server Verification, Only works before login func (c *Client) SetupServerVerification(ctx context.Context) (string, string, error) { serverKey, _, err := c.GetPublicKey(ctx) if err != nil { @@ -41,6 +42,7 @@ func (c *Client) SetupServerVerification(ctx context.Context) (string, string, e return token, encToken, err } +// VerifyServer verifys that the Server is still the same one as during the Setup, Only works before login func (c *Client) VerifyServer(ctx context.Context, token, encToken string) error { privateKeyObj, err := crypto.NewKeyFromArmored(c.userPrivateKey) if err != nil {