mirror of
https://github.com/passbolt/go-passbolt-cli.git
synced 2025-05-12 02:58:20 +00:00
Add More Algorithms
This commit is contained in:
parent
7da6aec339
commit
6f4d6e92b7
1 changed files with 6 additions and 0 deletions
|
@ -176,6 +176,10 @@ func GetKeepassEntry(client *api.Client, resource api.Resource, secret api.Secre
|
||||||
alg = otp.AlgorithmSHA1
|
alg = otp.AlgorithmSHA1
|
||||||
case "SHA256":
|
case "SHA256":
|
||||||
alg = otp.AlgorithmSHA256
|
alg = otp.AlgorithmSHA256
|
||||||
|
case "SHA512":
|
||||||
|
alg = otp.AlgorithmSHA512
|
||||||
|
case "MD5":
|
||||||
|
alg = otp.AlgorithmMD5
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("Unsupported TOTP Algorithm: %v ", totpData.Algorithm)
|
return nil, fmt.Errorf("Unsupported TOTP Algorithm: %v ", totpData.Algorithm)
|
||||||
}
|
}
|
||||||
|
@ -201,6 +205,8 @@ func GetKeepassEntry(client *api.Client, resource api.Resource, secret api.Secre
|
||||||
return nil, fmt.Errorf("Generating TOTP Key: %w", err)
|
return nil, fmt.Errorf("Generating TOTP Key: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
totpKey.Secret()
|
||||||
|
|
||||||
entry.Values = append(entry.Values, gokeepasslib.ValueData{Key: "otp", Value: gokeepasslib.V{Content: totpKey.URL(), Protected: w.NewBoolWrapper(true)}})
|
entry.Values = append(entry.Values, gokeepasslib.ValueData{Key: "otp", Value: gokeepasslib.V{Content: totpKey.URL(), Protected: w.NewBoolWrapper(true)}})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue