Skip to content

Commit

Permalink
feat(core/utils): error on unlock with empty device_bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
steveej committed Sep 4, 2024
1 parent fb9f0ab commit 3d0b535
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ pub async fn get_seed_from_locked_device_bundle(

/// unlock seed_bundles to access the pub-key and seed
pub async fn unlock(device_bundle: &str, passphrase: &str) -> SeedExplorerResult<SigningKey> {
if device_bundle.is_empty() {
bail!("called with device_bundle");

Check failure on line 93 in core/src/utils.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, stable)

mismatched types
}

let cipher = base64::decode_config(device_bundle, base64::URL_SAFE_NO_PAD)?;
match UnlockedSeedBundle::from_locked(&cipher).await?.remove(0) {
LockedSeedCipher::PwHash(cipher) => {
Expand Down

0 comments on commit 3d0b535

Please sign in to comment.