fn validate(&self, nonce: &[u8]) -> Result<()> {
        if self.done {
            Err(Error::authentication_error(
                "MONGODB-AWS",
                "handshake terminated early",
            ))
        } else if !self.server_nonce.starts_with(nonce) {
            Err(Error::authentication_error(
                "MONGODB-AWS",
                "mismatched nonce",
            ))
        } else if self.server_nonce.len() != 64 {
            Err(Error::authentication_error(
                "MONGODB-AWS",
                "incorrect length server nonce",
            ))
        } else if self.sts_host.is_empty() {
            Err(Error::authentication_error(
                "MONGODB-AWS",
                "sts host must be non-empty",
            ))
        } else if self.sts_host.as_bytes().len() > 255 {
            Err(Error::authentication_error(
                "MONGODB-AWS",
                "sts host cannot be more than 255 bytes",
            ))
        } else if self.sts_host.split('.').any(|s| s.is_empty()) {
            Err(Error::authentication_error(
                "MONGODB-AWS",
                "sts host cannot contain empty labels",
            ))
        } else {
            Ok(())
        }
    }
/// Ensures that the server sent a valid response to the `saslStart` command.
Ensures that the server sent a valid response to the `saslStart` command.
Ensures that the server sent a valid response to the ` saslStart ` command .
fn validate(&self, nonce: &[u8]) -> Result<()> {
        if self.done {
            Err(Error::authentication_error(
                "MONGODB-AWS",
                "handshake terminated early",
            ))
        } else if !self.server_nonce.starts_with(nonce) {
            Err(Error::authentication_error(
                "MONGODB-AWS",
                "mismatched nonce",
            ))
        } else if self.server_nonce.len() != 64 {
            Err(Error::authentication_error(
                "MONGODB-AWS",
                "incorrect length server nonce",
            ))
        } else if self.sts_host.is_empty() {
            Err(Error::authentication_error(
                "MONGODB-AWS",
                "sts host must be non-empty",
            ))
        } else if self.sts_host.as_bytes().len() > 255 {
            Err(Error::authentication_error(
                "MONGODB-AWS",
                "sts host cannot be more than 255 bytes",
            ))
        } else if self.sts_host.split('.').any(|s| s.is_empty()) {
            Err(Error::authentication_error(
                "MONGODB-AWS",
                "sts host cannot contain empty labels",
            ))
        } else {
            Ok(())
        }
    }
fn validate ( & self , nonce : & [ u8 ] ) -> Result < ( ) > { if self . done { Err ( Error :: authentication_error ( " " , " " , ) ) } else if ! self . server_nonce . starts_with ( nonce ) { Err ( Error :: authentication_error ( " " , " " , ) ) } else if self . server_nonce . len ( ) != 64 { Err ( Error :: authentication_error ( " " , " " , ) ) } else if self . sts_host . is_empty ( ) { Err ( Error :: authentication_error ( " " , " " , ) ) } else if self . sts_host . as_bytes ( ) . len ( ) > 255 { Err ( Error :: authentication_error ( " " , " " , ) ) } else if self . sts_host . split ( '.' ) . any ( | s | s . is_empty ( ) ) { Err ( Error :: authentication_error ( " " , " " , ) ) } else { Ok ( ( ) ) } }
Ensures that the server sent a valid response to the `saslStart` command.
Ensures that the server sent a valid response to the ` saslStart ` command .
&self
nonce
&[u8]
&self
nonce
&[u8]