From 1a8966cb1f81ce2405e4687332b4e6a15cf810d7 Mon Sep 17 00:00:00 2001 From: Joren Schipman Date: Wed, 1 May 2024 22:43:19 +0200 Subject: [PATCH] Write to file --- rsaserver.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rsaserver.go b/rsaserver.go index 9ef60d4..3b2606c 100644 --- a/rsaserver.go +++ b/rsaserver.go @@ -182,10 +182,13 @@ func decryptKeyIV(ed string, privateKey *rsa.PrivateKey) ([]byte, error) { func handleDecrypted(decryptedDataB []byte, uidB []byte){ data, _ := base64.StdEncoding.DecodeString(strings.TrimSpace(string(decryptedDataB))) + + fileType, err := magic.Lookup(data) if err != nil { if err == magic.ErrUnknown { fmt.Println("File type is unknown") + fileType.Extension = "unk" }else{ panic(err) }