File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ pub enum Cipher {
6868/// A struct that represents the parameters required to create a key.
6969pub struct EncryptionKey {
7070 pub cipher : Cipher ,
71+ #[ serde( default ) ]
7172 pub key_name : String ,
7273 pub key : String ,
7374 pub key_len : u32 ,
Original file line number Diff line number Diff line change @@ -82,10 +82,12 @@ async fn util_fetch_secret_params(
8282 . map_err ( |e : LvsError | Status :: invalid_argument ( e. to_string ( ) ) ) ?,
8383 ) ,
8484 create_pool_request:: Encryption :: Secret ( cks) => {
85- let secret_params = secret_data ( cks. secret . as_str ( ) )
85+ let mut secret_params: PoolEncKey = secret_data ( cks. secret . as_str ( ) )
8686 . await
8787 . map_err ( |e| Status :: invalid_argument ( e. to_string ( ) ) ) ?;
8888 trace ! ( "[create pool] Received encryption params: {secret_params:?}" ) ;
89+ // Use secret name as key name.
90+ secret_params. key_name = cks. secret . to_string ( ) ;
8991 Some ( secret_params)
9092 }
9193 }
@@ -96,10 +98,12 @@ async fn util_fetch_secret_params(
9698 . map_err ( |e : LvsError | Status :: invalid_argument ( e. to_string ( ) ) ) ?,
9799 ) ,
98100 import_pool_request:: Encryption :: Secret ( iks) => {
99- let secret_params = secret_data ( iks. secret . as_str ( ) )
101+ let mut secret_params: PoolEncKey = secret_data ( iks. secret . as_str ( ) )
100102 . await
101103 . map_err ( |e| Status :: invalid_argument ( e. to_string ( ) ) ) ?;
102104 trace ! ( "[import pool] Received encryption params: {secret_params:?}" ) ;
105+ // Use secret file name as key name.
106+ secret_params. key_name = iks. secret . to_string ( ) ;
103107 Some ( secret_params)
104108 }
105109 } ,
Original file line number Diff line number Diff line change @@ -783,7 +783,7 @@ impl Lvs {
783783 . await
784784 . map_err ( |e| {
785785 error ! (
786- "failed to delete crypto vbdev {:?} after failed pool creation . {e}" ,
786+ "failed to delete crypto vbdev {:?} during pool destroy . {e}" ,
787787 base_bdev. name( )
788788 ) ;
789789 } ) ;
You can’t perform that action at this time.
0 commit comments