Skip to content

Commit fc30c3e

Browse files
committed
feat: add unseal_once for UnsealBox to improve security.
1 parent a292e61 commit fc30c3e

File tree

3 files changed

+877
-64
lines changed

3 files changed

+877
-64
lines changed

src/core.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ impl Core {
358358

359359
let mut deprecated_key_set = self.deprecated_unseal_keys_set();
360360
if let Ok(deprecated_key_set) = &deprecated_key_set {
361-
if deprecated_key_set.is_used(key) {
361+
if deprecated_key_set.contains(key) {
362362
return Err(RvError::ErrBarrierKeyDeprecated);
363363
}
364364
}
@@ -411,7 +411,7 @@ impl Core {
411411
if once {
412412
if let Ok(deprecated_key_set) = &mut deprecated_key_set {
413413
for key in unseal_key_shares.iter() {
414-
deprecated_key_set.mark_as_used(key);
414+
deprecated_key_set.insert(key);
415415
}
416416

417417
let pe = PhysicalBackendEntry {

0 commit comments

Comments
 (0)