Skip to content

define encryption_key and encryption_password same time #499

@guazhangRH

Description

@guazhangRH
      vars:
        storage_safe_mode: false
        storage_pools:
          - name: foo
            type: lvm
            disks: "{{ unused_disks }}"
            volumes:
              - name: test1
                mount_point: "{{ mount_location }}"
                size: 4g
                encryption: true
                encryption_key: "{{ storage_test_key_file.path }}"
                encryption_luks_version: luks2
                encryption_key_size: 256
                encryption_cipher: "{{ __luks_cipher }}"
                encryption_password: yabbadabbadoo

# cryptsetup luksDump /dev/mapper/foo-test1 
LUKS header information
Version:       	2
Epoch:         	4
Metadata area: 	16384 [bytes]
Keyslots area: 	16744448 [bytes]
UUID:          	4bda8802-8d8f-4c09-a25e-9339f7ac4aa4
Label:         	(no label)
Subsystem:     	(no subsystem)
Flags:       	(no flags)

Data segments:
  0: crypt
	offset: 16777216 [bytes]
	length: (whole device)
	cipher: aes-xts-plain64
	sector: 512 [bytes]

Keyslots:
  0: luks2
	Key:        256 bits
	Priority:   normal
	Cipher:     aes-xts-plain64
	Cipher key: 256 bits
	PBKDF:      argon2id
	Time cost:  4
	Memory:     1019850
	Threads:    4
	Salt:       fd 28 27 64 29 a4 45 02 b8 ff cc 36 e5 5e da 00 
	            20 3e 34 65 5e b4 7f c8 9f d7 57 76 2a fa df 35 
	AF stripes: 4000
	AF hash:    sha256
	Area offset:32768 [bytes]
	Area length:131072 [bytes]
	Digest ID:  0
  1: luks2
	Key:        256 bits
	Priority:   normal
	Cipher:     aes-xts-plain64
	Cipher key: 256 bits
	PBKDF:      argon2id
	Time cost:  4
	Memory:     1048576
	Threads:    4
	Salt:       53 55 fd 2c 3b 9f f6 09 1f 9d 5e 88 9c 16 32 09 
	            ba 6b 47 96 c3 f8 e9 a8 4a 03 35 6a 97 b5 f2 3c 
	AF stripes: 4000
	AF hash:    sha256
	Area offset:163840 [bytes]
	Area length:131072 [bytes]
	Digest ID:  0
Tokens:
Digests:
  0: pbkdf2
	Hash:       sha256
	Iterations: 182297
	Salt:       86 e2 2a ab 7c ec a4 7a 42 c2 a1 9d e4 ff a7 d8 
	            c9 35 32 73 b0 ff 1b 5f c9 c9 b6 56 9e cf 71 79 
	Digest:     26 b0 aa cd 5d 92 1a ee 0d 9e 10 15 a7 e3 a1 90 
	            f7 bc 94 8e 40 bd 47 06 a0 e9 21 29 f3 cf e9 f8 

looks it has added two slot key here, should we consider to add some tests for it ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions