]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cypherpunks.ru/nncp/cmd/nncp-bundle/main.go
AEAD encryption mode and new encrypted packet format
[nncp.git] / src / cypherpunks.ru / nncp / cmd / nncp-bundle / main.go
index 33d269c79800eafe47c063afd80f763d54b498a2..553a6d11a15afa325a0d69ba09c9933b57e968c1 100644 (file)
@@ -236,7 +236,7 @@ func main() {
                                ctx.LogD("nncp-bundle", sds, "Bad packet structure")
                                continue
                        }
-                       if pktEnc.Magic != nncp.MagicNNCPEv3 {
+                       if pktEnc.Magic != nncp.MagicNNCPEv4 {
                                ctx.LogD("nncp-bundle", sds, "Bad packet magic number")
                                continue
                        }
@@ -367,7 +367,9 @@ func main() {
                                        if err = bufTmp.Flush(); err != nil {
                                                log.Fatalln("Error during flushing:", err)
                                        }
-                                       tmp.Sync()
+                                       if err = tmp.Sync(); err != nil {
+                                               log.Fatalln("Error during syncing:", err)
+                                       }
                                        tmp.Close()
                                        if err = os.MkdirAll(selfPath, os.FileMode(0700)); err != nil {
                                                log.Fatalln("Error during mkdir:", err)