mirror of
https://github.com/passbolt/go-passbolt.git
synced 2025-09-13 14:29:09 +00:00
store userprivatekey in clients as crypto.key instead of armor
This commit is contained in:
parent
c7a0de783d
commit
118dd9624b
4 changed files with 21 additions and 67 deletions
|
@ -5,7 +5,6 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/ProtonMail/gopenpgp/v3/crypto"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
|
@ -44,15 +43,10 @@ func (c *Client) SetupServerVerification(ctx context.Context) (string, string, e
|
|||
|
||||
// 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 {
|
||||
return fmt.Errorf("Parsing User Private Key: %w", err)
|
||||
}
|
||||
|
||||
data := GPGVerifyContainer{
|
||||
Req: GPGVerify{
|
||||
Token: encToken,
|
||||
KeyID: privateKeyObj.GetFingerprint(),
|
||||
KeyID: c.userPrivateKey.GetFingerprint(),
|
||||
},
|
||||
}
|
||||
raw, _, err := c.DoCustomRequestAndReturnRawResponse(ctx, "POST", "/auth/verify.json", "v2", data, nil)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue