File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/engine/strat_engine/crypt/handle Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -544,6 +544,12 @@ impl CryptHandle {
544
544
pin : & str ,
545
545
json : & Value ,
546
546
) -> StratisResult < u32 > {
547
+ if self . metadata . encryption_info . all_token_slots ( ) . count ( ) >= 15 {
548
+ return Err ( StratisError :: Msg (
549
+ "Reached limit of 15 token and keyslots for pool" . to_string ( ) ,
550
+ ) ) ;
551
+ }
552
+
547
553
let mut json_owned = json. clone ( ) ;
548
554
let yes = interpret_clevis_config ( pin, & mut json_owned) ?;
549
555
@@ -644,6 +650,12 @@ impl CryptHandle {
644
650
token_slot : Option < u32 > ,
645
651
key_desc : & KeyDescription ,
646
652
) -> StratisResult < u32 > {
653
+ if self . metadata . encryption_info . all_token_slots ( ) . count ( ) >= 15 {
654
+ return Err ( StratisError :: Msg (
655
+ "Reached limit of 15 token and keyslots for pool" . to_string ( ) ,
656
+ ) ) ;
657
+ }
658
+
647
659
let mut device = self . acquire_crypt_device ( ) ?;
648
660
let key =
649
661
get_passphrase ( & mut device, self . encryption_info ( ) ) ?. either ( |( _, key) | key, |key| key) ;
You can’t perform that action at this time.
0 commit comments