mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-08 01:05:16 -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
|
@ -13,7 +13,7 @@ import (
|
|||
"math"
|
||||
"testing"
|
||||
|
||||
"github.com/edgelesssys/constellation/v2/disk-mapper/internal/mapper"
|
||||
"github.com/edgelesssys/constellation/v2/disk-mapper/internal/diskencryption"
|
||||
"github.com/edgelesssys/constellation/v2/internal/logger"
|
||||
"github.com/martinjungblut/go-cryptsetup"
|
||||
"go.uber.org/zap/zapcore"
|
||||
|
@ -39,11 +39,11 @@ func BenchmarkMapper(b *testing.B) {
|
|||
}
|
||||
|
||||
passphrase := "benchmark"
|
||||
mapper, err := mapper.New(testPath, logger.New(logger.PlainLog, zapcore.InfoLevel))
|
||||
mapper, free, err := diskencryption.New(testPath, logger.New(logger.PlainLog, zapcore.InfoLevel))
|
||||
if err != nil {
|
||||
b.Fatal("Failed to create mapper:", err)
|
||||
}
|
||||
defer mapper.Close()
|
||||
defer free()
|
||||
|
||||
if err := mapper.FormatDisk(passphrase); err != nil {
|
||||
b.Fatal("Failed to format disk:", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue