+ return nil
+ }
+
+ if area.Prv == nil {
+ ctx.LogD("rx-area-no-prv", les, func(les LEs) string {
+ return logMsg(les) + ": no private key for decoding"
+ })
+ } else {
+ signatureVerify := true
+ if _, senderKnown := ctx.Neigh[*pktEnc.Sender]; !senderKnown {
+ if !area.AllowUnknown {
+ err = errors.New("unknown sender")
+ ctx.LogE(
+ "rx-area-unknown",
+ append(les, LE{"Sender", pktEnc.Sender}),
+ err,
+ func(les LEs) string {
+ return logMsg(les) + ": sender: " + pktEnc.Sender.String()
+ },
+ )
+ return err
+ }
+ signatureVerify = false
+ }
+ areaNodeOur := NodeOur{Id: new(NodeId), ExchPrv: new([32]byte)}
+ copy(areaNodeOur.Id[:], area.Id[:])
+ copy(areaNodeOur.ExchPrv[:], area.Prv[:])
+ areaNode := Node{
+ Id: new(NodeId),
+ Name: area.Name,
+ Incoming: area.Incoming,
+ Exec: area.Exec,
+ }
+ copy(areaNode.Id[:], area.Id[:])
+ pktName := fmt.Sprintf(
+ "area/%s/%s",
+ Base32Codec.EncodeToString(areaId[:]), msgHash,
+ )
+
+ pipeR, pipeW := io.Pipe()
+ errs := make(chan error, 1)
+ go func() {
+ errs <- jobProcess(
+ ctx,
+ pipeR,
+ pktName,
+ les,
+ &areaNode,
+ nice,
+ uint64(pktSizeWithoutEnc(int64(pktSize))),
+ "",
+ decompressor,
+ dryRun, doSeen, noFile, noFreq, noExec, noTrns, noArea, noACK,
+ )
+ }()
+ _, _, _, err = PktEncRead(
+ &areaNodeOur,
+ ctx.Neigh,
+ fullPipeR,
+ pipeW,
+ signatureVerify,
+ nil,
+ )
+ if err != nil {
+ ctx.LogE("rx-area-pkt-enc-read2", les, err, logMsg)
+ pipeW.CloseWithError(err)
+ <-errs
+ return err
+ }
+ pipeW.Close()
+ if err = <-errs; err != nil {
+ return err
+ }
+ }
+
+ if !dryRun && jobPath != "" {
+ if err = os.MkdirAll(seenDir, os.FileMode(0777)); err != nil {
+ ctx.LogE("rx-area-mkdir", les, err, logMsg)
+ return err
+ }
+ if fd, err := os.Create(seenPath); err == nil {
+ fd.Close()
+ if err = DirSync(seenDir); err != nil {
+ ctx.LogE("rx-area-dirsync", les, err, logMsg)
+ return err