File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/engine/strat_engine/backstore/crypt Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -205,8 +205,15 @@ impl CryptHandle {
205205 . and_then ( |path| clevis_info_from_metadata ( & mut device) . map ( |ci| ( path, ci) ) )
206206 . and_then ( |( _, clevis_info) | {
207207 let encryption_info =
208- EncryptionInfo :: from_options ( ( encryption_info. key_description ( ) . cloned ( ) , clevis_info) )
209- . expect ( "Encrypted device must be provided encryption parameters" ) ;
208+ if let Some ( info) = EncryptionInfo :: from_options ( ( encryption_info. key_description ( ) . cloned ( ) , clevis_info) ) {
209+ info
210+ } else {
211+ return Err ( StratisError :: Msg ( format ! (
212+ "No valid encryption method that can be used to unlock device {} found after initialization" ,
213+ physical_path. display( )
214+ ) ) ) ;
215+ } ;
216+
210217 let device_path = DevicePath :: new ( physical_path) ?;
211218 let devno = get_devno_from_path ( physical_path) ?;
212219 Ok ( CryptHandle :: new (
You can’t perform that action at this time.
0 commit comments