Write to file

This commit is contained in:
Joren Schipman 2024-05-01 22:43:19 +02:00
parent 819c74cf80
commit 1a8966cb1f
Signed by untrusted user who does not match committer: Joren
GPG Key ID: 280E33DFBC0F1B55

View File

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