fix(pay): checksum Monero addresses (base58 + keccak)
All checks were successful
ci / test (pull_request) Successful in 3m16s
All checks were successful
ci / test (pull_request) Successful in 3m16s
Reject prefix+length junk so /pay, /tip, and profile save cannot sign or store garbage xmr_addr. Empty profile address stays allowed.
This commit is contained in:
parent
2b42864eba
commit
666b9d2e86
6 changed files with 99 additions and 16 deletions
|
|
@ -125,6 +125,9 @@ fn check_fields(display_name: &str, bio: &str, xmr_addr: &str) -> Result<()> {
|
|||
if display_name.contains('\n') || bio.contains('\n') || xmr_addr.contains('\n') {
|
||||
return Err(Error("profile fields must not contain newlines".into()));
|
||||
}
|
||||
if !xmr_addr.is_empty() {
|
||||
crate::pay::check_address(xmr_addr).map_err(|e| Error(e.to_string()))?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue