Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

Commit

Permalink
Patch network address SALT and get val_config_ip_address pass
Browse files Browse the repository at this point in the history
  • Loading branch information
simsekgokhan committed Aug 23, 2021
1 parent 2ee4b38 commit 9bafd2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 1 addition & 4 deletions ol/types/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,8 @@ fn val_config_ip_address() {
let correct_fn_hex = "012d0400a1230da9052318072029fa0229ff55e1307caf3e32f3f4d0f2cb322cbb5e6d264c1df92e7740e1c06f0800".to_owned();
assert_eq!(encode(&val.op_fullnode_network_addresses), correct_fn_hex);

// TODO: Why is this "correct hex not the same as before"
let correct_hex = "010000000000000000000000003e250c102074e46ce6160d0efb958f48e4ba3b5a5ac468080135881b885f9baef0da93a2a0b993823448da4d8bf0414d9acd8fea5b664688b864b54c8ec8ae".to_owned();

// TODO: Why is this failing when it was passing in the v4 Libra codebase
// assert_eq!(encode(&val.op_validator_network_addresses), correct_hex);
assert_eq!(encode(&val.op_validator_network_addresses), correct_hex);

let mut enc_addr: Vec<EncNetworkAddress> = bcs::from_bytes(&val.op_validator_network_addresses)
.expect("couldn't deserialize encrypted network address");
Expand Down
5 changes: 3 additions & 2 deletions types/src/network_address/encrypted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ pub const TEST_SHARED_VAL_NETADDR_KEY_VERSION: KeyVersion = 0;
/// let derived_salt = HashValue::sha3_256_of(b"DIEM_ENCRYPTED_NETWORK_ADDRESS_SALT");
/// assert_eq!(HKDF_SALT.as_ref(), derived_salt.as_ref());
/// ```
/////// 0L /////////
pub const HKDF_SALT: [u8; 32] = [
0x7f, 0xfd, 0xa2, 0xae, 0x98, 0x2a, 0x2e, 0xbf, 0xab, 0x2a, 0x4d, 0xa6, 0x2f, 0x76, 0xfe, 0x33,
0x59, 0x2c, 0x85, 0xe0, 0x24, 0x45, 0xb8, 0x75, 0xf0, 0x2d, 0xed, 0x51, 0xa5, 0x20, 0xba, 0x2a,
0xdf, 0xc8, 0xff, 0xcc, 0x7f, 0x62, 0xea, 0x4e, 0x5b, 0x9b, 0xc4, 0x1e, 0xe7, 0x96, 0x9b, 0x44,
0x27, 0x54, 0x19, 0xeb, 0xaa, 0xd1, 0xdb, 0x27, 0xd2, 0xa1, 0x91, 0xb6, 0xd1, 0xdb, 0x6d, 0x13,
];

/// An encrypted [`NetworkAddress`].
Expand Down

0 comments on commit 9bafd2c

Please sign in to comment.