Skip to content

Commit

Permalink
update secp256k1 check
Browse files Browse the repository at this point in the history
  • Loading branch information
armaganyildirak committed Jul 25, 2023
1 parent fee5dc5 commit 887e1ff
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,13 +1059,8 @@ fn check_spec_reserved_keys(key: &[u8], value: &[u8]) -> Result<(), EnrError> {
}
}
b"secp256k1" => {
let secp256k1_bytes = rlp::decode::<Vec<u8>>(value)
rlp::decode::<Enr<k256::ecdsa::SigningKey>>(value)
.map_err(|err| EnrError::InvalidRlpData(err.to_string()))?;
if secp256k1_bytes.len() != 33 {
return Err(EnrError::InvalidRlpData(
"Invalid Secp256k1 size".to_string(),
));
}
}
_ => return Ok(()),
};
Expand Down

0 comments on commit 887e1ff

Please sign in to comment.