fix comments get_server_salt.rs

This commit is contained in:
ayham 2021-07-14 22:58:29 +03:00
parent c74da469ae
commit 1efc7aea8f
Signed by: ayham
GPG Key ID: EAB7F5A9DF503678
1 changed files with 5 additions and 6 deletions

View File

@ -15,19 +15,18 @@ use tokio_rustls::client::TlsStream;
/// Issues a command to the connected TLS server to obtain a salt.
///
/// All salts returned are of size ```digest::SHA512_OUTPUT_LEN/2``` or 32 bytes.
/// All salts returned are of size ```digest::SHA512_OUTPUT_LEN/2```, 32 bytes.
/// Should be used in contexts that return ```io::Result```.
/// Should be used in Async contexts.
///
/// Arguments:
/// socket - The TLS connection to use for the salt.
/// socket - The TLS stream to use for the salt.
///
/// Returns: a [u8; 32] on success, and ```ReturnFlags``` on error containing the reason of failure.
///
/// Example:
/// ```rust
/// let server_salt: [u8; digest::SHA512_OUTPUT_LEN/2] = match get_server_salt(tls_client, poll) {
/// Ok(salt) => salt,
/// Err(err) => panic!("could not retrieve server salt; err: {}", errj)
/// };
/// let server_salt: [u8; digest::SHA512_OUTPUT_LEN/2] = get_server_salt(tls_client)?;
/// ```
pub async fn get_server_salt(
socket: &mut TlsStream<TcpStream>,