Signed-off-by: Itxaka <itxaka@kairos.io>
This commit is contained in:
Itxaka
2024-05-22 14:30:59 +02:00
parent edf09c4923
commit 0bb8c72097
4 changed files with 40 additions and 20 deletions

View File

@@ -119,12 +119,15 @@ func LuksUnlock(device, mapper, password string) error {
dev, err := luks.Open(device)
if err != nil {
// handle error
fmt.Println("on open")
return err
}
defer dev.Close()
err = dev.Unlock(0, []byte(password), mapper)
if err != nil {
fmt.Println("on unlock")
fmt.Printf("device: %s\nmapper: %s\n", device, mapper)
return err
}
return nil