Add More Algorithms

This commit is contained in:
Samuel Lorch 2024-03-21 23:12:30 +01:00
parent 7da6aec339
commit 6f4d6e92b7

View file

@ -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)}})
}