mirror of https://github.com/schollz/croc.git
Starting to implement streaming cipher
This commit is contained in:
parent
1727a156db
commit
a6927a3143
11
connect.go
11
connect.go
|
@ -1,7 +1,6 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
@ -370,7 +369,15 @@ func (c *Connection) sendFile(id int, connection net.Conn) {
|
|||
connection.Write([]byte(fillString(strconv.FormatInt(int64(chunkSize), 10), 10)))
|
||||
|
||||
sendBuffer := make([]byte, BUFFERSIZE)
|
||||
file := bytes.NewBuffer(c.File.bytes)
|
||||
|
||||
// open encrypted file
|
||||
file, err := os.Open(c.File.Name + ".enc")
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
chunkI := 0
|
||||
if !c.Debug {
|
||||
c.bars[id] = uiprogress.AddBar(chunksPerWorker).AppendCompleted().PrependElapsed()
|
||||
|
|
|
@ -45,5 +45,4 @@ func TestEncryptFiles(t *testing.T) {
|
|||
}
|
||||
os.Remove("temp.dec")
|
||||
os.Remove("temp.enc")
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue