getentropy
apparently considered private on non-macOS darwin
#102643
Labels
O-ios
Operating system: iOS
regression-from-stable-to-beta
Performance or correctness regression from stable to beta.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
Milestone
Ugh. #101011 probably needs reverting before 1.65 hits stable, or Rust apps may1 fail AppStore review on iOS and tvOS.
Apparently,
getentropy
on Darwin platforms is actually only considered public API on MacOS. This is surprising, since there are several indications to the contrary:In the declaration in the public header (
sys/random.h
) on MacOS, it has a availability annotation that indicates it's fine in iOS/tvOS 10.0 and watchOS 3.0:Apple's security guidelines say to use it for random number generation.
Sadly, does seem to indeed be true that
sys/random.h
does not exist in any of the platform SDKs aside from MacOSX.sdk, and it also seems to have lead to one to iOS App Store rejection. TBH, it being an accidentally missing file feels plausible, but who knows and it doesn't matter anyway.This is a bummer, and I guess now I know, I can't really trust the the available annotations anymore.
Footnotes
There's actually a good chance that our use of
weak!
evades this detection, but I don't want to rely on this or make random Rust apps test it for us. ↩The text was updated successfully, but these errors were encountered: