0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00

Add more trimming

This commit is contained in:
Zack Scholl 2017-10-17 21:57:42 -06:00
parent f29b197783
commit 5e1068961e

View file

@ -78,9 +78,9 @@ func runClient(connectionType string, codePhrase string) {
return return
} }
fmt.Println("\n\ndecrypting...") fmt.Println("\n\ndecrypting...")
log.Debugf("codePhrase: %s", codePhrase) log.Debugf("codePhrase: [%s]", codePhrase)
log.Debugf("filefileSaltIV: %s", fileSalt) log.Debugf("fileSalt: [%s]", fileSalt)
log.Debugf("fileIV: %s", fileIV) log.Debugf("fileIV: [%s]", fileIV)
decrypted, err := Decrypt(encrypted, codePhrase, fileSalt, fileIV) decrypted, err := Decrypt(encrypted, codePhrase, fileSalt, fileIV)
if err != nil { if err != nil {
log.Error(err) log.Error(err)
@ -88,8 +88,8 @@ func runClient(connectionType string, codePhrase string) {
} }
ioutil.WriteFile(fileName, decrypted, 0644) ioutil.WriteFile(fileName, decrypted, 0644)
os.Remove(fileName + ".encrypted") os.Remove(fileName + ".encrypted")
log.Debugf("\n\n\ndownloaded hash: %s", HashBytes(decrypted)) log.Debugf("\n\n\ndownloaded hash: [%s]", HashBytes(decrypted))
log.Debugf("\n\n\nrelayed hash: %s", fileHash) log.Debugf("\n\n\nrelayed hash: [%s]", fileHash)
if fileHash != HashBytes(decrypted) { if fileHash != HashBytes(decrypted) {
fmt.Printf("\nUh oh! %s is corrupted! Sorry, try again.\n", fileName) fmt.Printf("\nUh oh! %s is corrupted! Sorry, try again.\n", fileName)