mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-08 15:02:18 -04:00
cryptsetup: unify code (#2043)
* Add common backend for interacting with cryptsetup * Use common cryptsetup backend in bootstrapper * Use common cryptsetup backend in disk-mapper * Use common cryptsetup backend in csi lib --------- Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
f52c6752e2
commit
ac1128d07f
34 changed files with 1061 additions and 1307 deletions
39
internal/cryptsetup/cryptsetup_cross.go
Normal file
39
internal/cryptsetup/cryptsetup_cross.go
Normal file
|
@ -0,0 +1,39 @@
|
|||
//go:build !linux || !cgo
|
||||
|
||||
/*
|
||||
Copyright (c) Edgeless Systems GmbH
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
package cryptsetup
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
const (
|
||||
// ReadWriteQueueBypass is a flag to disable the write and read workqueues for a crypt device.
|
||||
ReadWriteQueueBypass = cryptActivateNoReadWorkqueue | cryptActivateNoWriteWorkqueue
|
||||
cryptActivateNoReadWorkqueue = 0x1000000
|
||||
cryptActivateNoWriteWorkqueue = 0x2000000
|
||||
wipeFlags = 0x10 | 0x1000
|
||||
wipePattern = 0
|
||||
)
|
||||
|
||||
var errCGONotSupported = errors.New("using cryptsetup requires building with CGO")
|
||||
|
||||
func format(_ cryptDevice, _ bool) error {
|
||||
return errCGONotSupported
|
||||
}
|
||||
|
||||
func initByDevicePath(_ string) (cryptDevice, error) {
|
||||
return nil, errCGONotSupported
|
||||
}
|
||||
|
||||
func initByName(_ string) (cryptDevice, error) {
|
||||
return nil, errCGONotSupported
|
||||
}
|
||||
|
||||
func loadLUKS2(_ cryptDevice) error {
|
||||
return errCGONotSupported
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue