From 6f4d6e92b78daef860f17eca335d470b81c8a3e0 Mon Sep 17 00:00:00 2001 From: Samuel Lorch Date: Thu, 21 Mar 2024 23:12:30 +0100 Subject: [PATCH] Add More Algorithms --- keepass/export.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/keepass/export.go b/keepass/export.go index 365043a..07172e2 100644 --- a/keepass/export.go +++ b/keepass/export.go @@ -176,6 +176,10 @@ func GetKeepassEntry(client *api.Client, resource api.Resource, secret api.Secre alg = otp.AlgorithmSHA1 case "SHA256": alg = otp.AlgorithmSHA256 + case "SHA512": + alg = otp.AlgorithmSHA512 + case "MD5": + alg = otp.AlgorithmMD5 default: 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) } + totpKey.Secret() + entry.Values = append(entry.Values, gokeepasslib.ValueData{Key: "otp", Value: gokeepasslib.V{Content: totpKey.URL(), Protected: w.NewBoolWrapper(true)}}) }