add bootstrap config field: pre_lvm_crypt

This commit is contained in:
Mikaël Cluseau
2023-12-17 13:14:09 +01:00
parent 5e39572dc5
commit 827fa62f58
4 changed files with 76 additions and 15 deletions

30
tools/passwd.go Normal file
View File

@ -0,0 +1,30 @@
package main
import (
"bufio"
"fmt"
"log"
"os"
"strings"
"novit.tech/direktil/pkg/bootstrapconfig"
)
func main() {
in := bufio.NewReader(os.Stdin)
read := func() string {
s, err := in.ReadString('\n')
if err != nil {
log.Fatal(err)
}
return strings.TrimSpace(s)
}
seed := read()
pass := read()
hash := bootstrapconfig.PasswordHashFromSeed([]byte(seed), []byte(pass))
fmt.Println(bootstrapconfig.JoinSeedAndHash([]byte(seed), hash))
}