fix: server keys and destination resolution when server name contains port

This commit is contained in:
Timo Kösters 2020-09-15 21:46:10 +02:00
parent 005e00e9b1
commit dd749b8aee
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
3 changed files with 49 additions and 14 deletions

View file

@ -29,8 +29,13 @@ pub fn increment(old: Option<&[u8]>) -> Option<Vec<u8>> {
pub fn generate_keypair(old: Option<&[u8]>) -> Option<Vec<u8>> {
Some(old.map(|s| s.to_vec()).unwrap_or_else(|| {
ruma::signatures::Ed25519KeyPair::generate()
.expect("Ed25519KeyPair generation always works (?)")
let mut value = random_string(8).as_bytes().to_vec();
value.push(0xff);
value.extend_from_slice(
&ruma::signatures::Ed25519KeyPair::generate()
.expect("Ed25519KeyPair generation always works (?)"),
);
value
}))
}