From 67ab59ec48de2ea3efec6e62bfdb5465ec5ae3fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Mon, 1 Apr 2024 11:45:29 -0700 Subject: [PATCH] get recipient in a non-dumb way --- cmd/agedit/cli.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/cmd/agedit/cli.go b/cmd/agedit/cli.go index 9b94da9..c563c8c 100644 --- a/cmd/agedit/cli.go +++ b/cmd/agedit/cli.go @@ -242,15 +242,9 @@ func action(ctx *cli.Context) error { // get recipients from specified identities for _, id := range identities { - // TODO: figure out how age actually intends for - // TODO: a recpient to be retrieved from an age.Identity - // TODO: beccause this is stupid and I hate it - actual_id, err := age.ParseX25519Identity(fmt.Sprint(id)) - if err != nil { - return fmt.Errorf("couldn't get recipient? %v", err) + if actual_id, ok := id.(*age.X25519Identity); ok { + recipients = append(recipients, actual_id.Recipient()) } - - recipients = append(recipients, actual_id.Recipient()) } // try to decrypt the file