Skip to content

Commit

Permalink
Problem: (fix crypto-com#54)option key_backup_data_path means differe…
Browse files Browse the repository at this point in the history
…ntly for command init and recover in sgx provide

Solution: add consensus-key.backup to the key_backup_data_path
  • Loading branch information
allthatjazzleo committed Apr 20, 2021
1 parent 43d92f5 commit 59c0174
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions providers/sgx/sgx-runner/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub fn init(
config::write_sealed_file(
config.sealed_consensus_key_path,
&sealed_key.sealed_key_data,
)
)?
.map_err(|e| format!("failed to write consensus key: {:?}", e))?;
let public_key =
ed25519_dalek::PublicKey::from_bytes(&sealed_key.sealed_key_data.seal_key_request.keyid)
Expand Down Expand Up @@ -198,7 +198,7 @@ pub fn recover(
Zeroizing::new(subtle_encoding::hex::encode(&*key_bytes))
};
let key_data = serde_json::from_str(
&fs::read_to_string(key_backup_data_path)
&fs::read_to_string(key_backup_data_path.join("consensus-key.backup"))
.map_err(|e| format!("failed to read backup data: {:?}", e))?,
)
.map_err(|e| format!("failed to parse backup data: {:?}", e))?;
Expand Down

0 comments on commit 59c0174

Please sign in to comment.