/*
NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2021 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2022 Sergey Matveev <stargrave@stargrave.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
package main
import (
+ "crypto/ed25519"
"crypto/rand"
+ "encoding/hex"
"encoding/json"
"flag"
"fmt"
"golang.org/x/crypto/blake2b"
"golang.org/x/crypto/nacl/box"
- "go.cypherpunks.ru/nncp/v7"
+ "go.cypherpunks.ru/nncp/v8"
)
func usage() {
func main() {
var (
areaName = flag.String("area", "", "Generate area's keypairs")
+ yggdrasil = flag.Bool("yggdrasil", false, "Generate Yggdrasil keypair")
noComments = flag.Bool("nocomments", false, "Do not include descriptive comments")
version = flag.Bool("version", false, "Print version information")
warranty = flag.Bool("warranty", false, "Print warranty information")
fmt.Println(nncp.VersionGet())
return
}
+
+ if *yggdrasil {
+ pub, prv, err := ed25519.GenerateKey(rand.Reader)
+ if err != nil {
+ log.Fatalln(err)
+ }
+ fmt.Println("Public:", hex.EncodeToString(pub))
+ fmt.Println("Private:", hex.EncodeToString(prv))
+ return
+ }
+
if *areaName != "" {
pub, prv, err := box.GenerateKey(rand.Reader)
if err != nil {
fmt.Println(cfgRaw)
return
}
+
nodeOur, err := nncp.NewNodeGenerate()
if err != nil {
log.Fatalln(err)
# umask: "022"
# Omit progress showing by default
# noprogress: true
- # Do not use .hdr files
+ # Do not use hdr/ files
# nohdr: true
# MultiCast Discovery:
# Interfaces and intervals (in seconds) where to send MCD announcements
# mcd-send: {em0: 60, igb1: 5}
+ # Yggdrasil related aliases:
+ # yggdrasil-aliases: {
+ # myprv: 60bb...27aa
+ # bob-pub: 98de...ac19d
+ # alice-endpoint: tcp://example.com:1234?key=689c...13fb
+ # default-endpoints: tcp://[::1]:2345,alice-endpoint
+ # }
+
# Enable notification email sending
# notify: {
# file: {