Chore: Update xsalsa20poly1305 -> 0.9
A few extra error types needed adding and handling due to the new `KeyInit::new_from_slice` returning a non-exported error.
This commit is contained in:
@@ -30,7 +30,7 @@ use std::{net::IpAddr, str::FromStr};
|
||||
use tokio::{net::UdpSocket, spawn, time::timeout};
|
||||
use tracing::{debug, info, instrument};
|
||||
use url::Url;
|
||||
use xsalsa20poly1305::{aead::NewAead, XSalsa20Poly1305 as Cipher};
|
||||
use xsalsa20poly1305::{KeyInit, XSalsa20Poly1305 as Cipher};
|
||||
|
||||
pub(crate) struct Connection {
|
||||
pub(crate) info: ConnectionInfo,
|
||||
@@ -353,7 +353,8 @@ async fn init_cipher(client: &mut WsStream, mode: CryptoMode) -> Result<Cipher>
|
||||
return Err(Error::CryptoModeInvalid);
|
||||
}
|
||||
|
||||
return Ok(Cipher::new_from_slice(&desc.secret_key)?);
|
||||
return Cipher::new_from_slice(&desc.secret_key)
|
||||
.map_err(|_| Error::CryptoInvalidLength);
|
||||
},
|
||||
other => {
|
||||
debug!(
|
||||
|
||||
Reference in New Issue
Block a user