diff options
Diffstat (limited to 'openpgp/src/crypto/backend/cng.rs')
-rw-r--r-- | openpgp/src/crypto/backend/cng.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/openpgp/src/crypto/backend/cng.rs b/openpgp/src/crypto/backend/cng.rs index 96a4c2c0..d40b904b 100644 --- a/openpgp/src/crypto/backend/cng.rs +++ b/openpgp/src/crypto/backend/cng.rs @@ -17,13 +17,12 @@ impl super::interface::Backend for Backend { // XXX: can we include features and the version? "Windows CNG".to_string() } -} -/// Fills the given buffer with random data. -pub fn random(buf: &mut [u8]) { - RandomNumberGenerator::system_preferred() - .gen_random(buf) - .expect("system-preferred RNG not to fail") + fn random(buf: &mut [u8]) -> crate::Result<()> { + RandomNumberGenerator::system_preferred() + .gen_random(buf)?; + Ok(()) + } } impl PublicKeyAlgorithm { |