Switch to rand_os for random bytes.

This commit is contained in:
Emmanuel Gil Peyrot 2019-01-17 23:53:29 +01:00
commit 506d0b17fc
3 changed files with 15 additions and 11 deletions

View file

@ -1,19 +1,19 @@
#[cfg(feature = "scram")]
use openssl::error::ErrorStack;
use rand_os::rand_core::Error as RngError;
/// A wrapper enum for things that could go wrong in this crate.
#[derive(Debug)]
pub enum Error {
#[cfg(feature = "scram")]
/// An error in OpenSSL.
OpenSslErrorStack(ErrorStack),
/// An error while initializing the Rng.
RngError(RngError),
/// An error in a SASL mechanism.
SaslError(String),
}
#[cfg(feature = "scram")]
impl From<ErrorStack> for Error {
fn from(err: ErrorStack) -> Error {
Error::OpenSslErrorStack(err)
impl From<RngError> for Error {
fn from(err: RngError) -> Error {
Error::RngError(err)
}
}