Merge pull request #169 from quexten/fix/spelling
Fix symmetric crypto key spelling
This commit is contained in:
commit
1feeb102e6
@ -64,17 +64,17 @@ func sync(ctx context.Context, vault *vault.Vault, cfg *config.Config) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
var protectedUserSymetricKey crypto.SymmetricEncryptionKey
|
var protectedUserSymmetricKey crypto.SymmetricEncryptionKey
|
||||||
if vault.Keyring.IsMemguard {
|
if vault.Keyring.IsMemguard {
|
||||||
protectedUserSymetricKey, err = crypto.MemguardSymmetricEncryptionKeyFromBytes(userSymmetricKey)
|
protectedUserSymmetricKey, err = crypto.MemguardSymmetricEncryptionKeyFromBytes(userSymmetricKey)
|
||||||
} else {
|
} else {
|
||||||
protectedUserSymetricKey, err = crypto.MemorySymmetricEncryptionKeyFromBytes(userSymmetricKey)
|
protectedUserSymmetricKey, err = crypto.MemorySymmetricEncryptionKeyFromBytes(userSymmetricKey)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
err = bitwarden.DoFullSync(context.WithValue(ctx, bitwarden.AuthToken{}, token.AccessToken), vault, cfg, &protectedUserSymetricKey, true)
|
err = bitwarden.DoFullSync(context.WithValue(ctx, bitwarden.AuthToken{}, token.AccessToken), vault, cfg, &protectedUserSymmetricKey, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -106,11 +106,11 @@ func handleLogin(msg messages.IPCMessage, cfg *config.Config, vault *vault.Vault
|
|||||||
err = cfg.SetUserSymmetricKey(vault.Keyring.GetAccountKey().Bytes())
|
err = cfg.SetUserSymmetricKey(vault.Keyring.GetAccountKey().Bytes())
|
||||||
err = cfg.SetMasterPasswordHash([]byte(masterpasswordHash))
|
err = cfg.SetMasterPasswordHash([]byte(masterpasswordHash))
|
||||||
err = cfg.SetMasterKey([]byte(masterKey.GetBytes()))
|
err = cfg.SetMasterKey([]byte(masterKey.GetBytes()))
|
||||||
var protectedUserSymetricKey crypto.SymmetricEncryptionKey
|
var protectedUserSymmetricKey crypto.SymmetricEncryptionKey
|
||||||
if vault.Keyring.IsMemguard {
|
if vault.Keyring.IsMemguard {
|
||||||
protectedUserSymetricKey, err = crypto.MemguardSymmetricEncryptionKeyFromBytes(vault.Keyring.GetAccountKey().Bytes())
|
protectedUserSymmetricKey, err = crypto.MemguardSymmetricEncryptionKeyFromBytes(vault.Keyring.GetAccountKey().Bytes())
|
||||||
} else {
|
} else {
|
||||||
protectedUserSymetricKey, err = crypto.MemorySymmetricEncryptionKeyFromBytes(vault.Keyring.GetAccountKey().Bytes())
|
protectedUserSymmetricKey, err = crypto.MemorySymmetricEncryptionKeyFromBytes(vault.Keyring.GetAccountKey().Bytes())
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
defer func() {
|
defer func() {
|
||||||
@ -129,7 +129,7 @@ func handleLogin(msg messages.IPCMessage, cfg *config.Config, vault *vault.Vault
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = bitwarden.DoFullSync(context.WithValue(ctx, bitwarden.AuthToken{}, token.AccessToken), vault, cfg, &protectedUserSymetricKey, false)
|
err = bitwarden.DoFullSync(context.WithValue(ctx, bitwarden.AuthToken{}, token.AccessToken), vault, cfg, &protectedUserSymmetricKey, false)
|
||||||
|
|
||||||
response, err = messages.IPCMessageFromPayload(messages.ActionResponse{
|
response, err = messages.IPCMessageFromPayload(messages.ActionResponse{
|
||||||
Success: true,
|
Success: true,
|
||||||
|
@ -29,9 +29,9 @@ func handleAddSSH(msg messages.IPCMessage, cfg *config.Config, vault *vault.Vaul
|
|||||||
actionsLog.Warn(err.Error())
|
actionsLog.Warn(err.Error())
|
||||||
}
|
}
|
||||||
ctx := context.WithValue(context.TODO(), bitwarden.AuthToken{}, token.AccessToken)
|
ctx := context.WithValue(context.TODO(), bitwarden.AuthToken{}, token.AccessToken)
|
||||||
ciph, err := bitwarden.PostCipher(ctx, cipher, cfg)
|
postedCipher, err := bitwarden.PostCipher(ctx, cipher, cfg)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
vault.AddOrUpdateSecureNote(ciph)
|
vault.AddOrUpdateSecureNote(postedCipher)
|
||||||
} else {
|
} else {
|
||||||
actionsLog.Warn("Error posting ssh key cipher: " + err.Error())
|
actionsLog.Warn("Error posting ssh key cipher: " + err.Error())
|
||||||
}
|
}
|
||||||
|
@ -113,11 +113,11 @@ func (key MemguardSymmetricEncryptionKey) MacKeyBytes() ([]byte, error) {
|
|||||||
return keyBytes, nil
|
return keyBytes, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func MemoryAssymmetricEncryptionKeyFromBytes(key []byte) (MemoryAsymmetricEncryptionKey, error) {
|
func MemoryAsymmetricEncryptionKeyFromBytes(key []byte) (MemoryAsymmetricEncryptionKey, error) {
|
||||||
return MemoryAsymmetricEncryptionKey{key}, nil
|
return MemoryAsymmetricEncryptionKey{key}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func MemguardAssymmetricEncryptionKeyFromBytes(key []byte) (MemguardAsymmetricEncryptionKey, error) {
|
func MemguardAsymmetricEncryptionKeyFromBytes(key []byte) (MemguardAsymmetricEncryptionKey, error) {
|
||||||
k := memguard.NewEnclave(key)
|
k := memguard.NewEnclave(key)
|
||||||
return MemguardAsymmetricEncryptionKey{k}, nil
|
return MemguardAsymmetricEncryptionKey{k}, nil
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ func CreateAuthResponse(ctx context.Context, authRequest AuthRequestData, keyrin
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return AuthRequestResponseData{}, err
|
return AuthRequestResponseData{}, err
|
||||||
}
|
}
|
||||||
requesterKey, err := crypto.MemoryAssymmetricEncryptionKeyFromBytes(publicKey)
|
requesterKey, err := crypto.MemoryAsymmetricEncryptionKeyFromBytes(publicKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return AuthRequestResponseData{}, err
|
return AuthRequestResponseData{}, err
|
||||||
}
|
}
|
||||||
|
@ -16,11 +16,11 @@ func SetPin(useMemguard bool, pin []byte) {
|
|||||||
func GetPin() ([]byte, error) {
|
func GetPin() ([]byte, error) {
|
||||||
approved := biometrics.CheckBiometrics(biometrics.SSHKey)
|
approved := biometrics.CheckBiometrics(biometrics.SSHKey)
|
||||||
if approved {
|
if approved {
|
||||||
bufer, err := cachedPin.Open()
|
buffer, err := cachedPin.Open()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return bufer.Bytes(), nil
|
return buffer.Bytes(), nil
|
||||||
} else {
|
} else {
|
||||||
return nil, errors.New("biometrics not approved")
|
return nil, errors.New("biometrics not approved")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user