We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e6e7dd6 commit 21e03e8Copy full SHA for 21e03e8
src/ios.rs
@@ -18,7 +18,8 @@ extern "C" {
18
pub fn getrandom_inner(dest: &mut [u8]) -> Result<(), Error> {
19
// Apple's documentation guarantees kSecRandomDefault is a synonym for NULL.
20
let ret = unsafe { SecRandomCopyBytes(null(), dest.len(), dest.as_mut_ptr()) };
21
- if ret == -1 {
+ // errSecSuccess (from SecBase.h) is always zero.
22
+ if ret != 0 {
23
Err(Error::IOS_SEC_RANDOM)
24
} else {
25
Ok(())
0 commit comments