From 31cf9746d56aad3c5c63084835a38a497f6df04e Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Mon, 4 Sep 2023 17:47:52 +0200 Subject: [PATCH] Fix login-with-device approval --- agent/bitwarden/paswordless.go | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/agent/bitwarden/paswordless.go b/agent/bitwarden/paswordless.go index 6a59647..fdc6036 100644 --- a/agent/bitwarden/paswordless.go +++ b/agent/bitwarden/paswordless.go @@ -63,10 +63,10 @@ func CreateAuthResponse(ctx context.Context, authRequest AuthRequestData, keyrin if err != nil { return authRequestResponse, err } - masterPasswordHash, err := config.GetMasterPasswordHash() - if err != nil { - return authRequestResponse, err - } + //masterPasswordHash, err := config.GetMasterPasswordHash() + //if err != nil { + // return authRequestResponse, err + //} publicKey, err := base64.StdEncoding.DecodeString(authRequest.PublicKey) requesterKey, err := crypto.AssymmetricEncryptionKeyFromBytes(publicKey) @@ -75,16 +75,15 @@ func CreateAuthResponse(ctx context.Context, authRequest AuthRequestData, keyrin if err != nil { panic(err) } - encryptedMasterPasswordHash, err := crypto.EncryptWithAsymmetric(masterPasswordHash, requesterKey) - if err != nil { - panic(err) - } + //encryptedMasterPasswordHash, err := crypto.EncryptWithAsymmetric(masterPasswordHash, requesterKey) + //if err != nil { + // panic(err) + //} err = authenticatedHTTPPut(ctx, config.ConfigFile.ApiUrl+"/auth-requests/"+authRequest.ID, &authRequestResponse, AuthRequestResponseData{ - DeviceIdentifier: config.ConfigFile.DeviceUUID, - Key: string(encryptedUserSymmetricKey), - MasterPasswordHash: string(encryptedMasterPasswordHash), - Requestapproved: true, + DeviceIdentifier: config.ConfigFile.DeviceUUID, + Key: string(encryptedUserSymmetricKey), + Requestapproved: true, }) return authRequestResponse, err }