You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Build failure on OS X ≤ 10.9 due to missing CommonCrypto/CommonRandom.h #384
Note that if you're coming from the branch 1.2, then it was historically using BRG (Brian's Gladman's AES lib), so -DMZ_BRG=ON will give you the least surprises.
You can build instead using the Brian's Gladman's library -DMZ_BRG=ON or OpenSSL instead -DMZ_OPENSSL=ON
Thanks, I'll look into those.
I have added a check to the cmake in the dev branch that will check for the availablity of common crypto library.
Thanks, but it looks like you added a check for CommonCrypto.h, but the header you're using that's missing is CommonRandom.h.
The first appearance of some of the Common Crypto functions was Mac OS X 10.4. The CommonCrypto.h header (which just includes some of the others) was added in OS X 10.8. The CommonRandom.h header (which contains the CCRandomGenerateBytes function minizip is using) was added in OS X 10.10.
I have changed it to use SecRandomCopyBytes which is available on 10.7. I wouldn't be surprised if underneath CCRandomCopyBytes it uses this function. Let me know if you have any issues with this.
I'm not sure if it makes sense to use SecRandomCopyBytes instead. @Coeur thoughts?
Regarding CommonCrypto.h, in my projects, I only target macOS 10.8+ for "modern" Objective-C or macOS 10.14.3+ for Swift with stable ABI, so I always have that header.
Activity
nmoinvaz commentedon Apr 30, 2019
You can build instead using the Brian's Gladman's library -DMZ_BRG=ON or OpenSSL instead -DMZ_OPENSSL=ON
Coeur commentedon Apr 30, 2019
Note that if you're coming from the branch 1.2, then it was historically using BRG (Brian's Gladman's AES lib), so
-DMZ_BRG=ONwill give you the least surprises.Check availability of common crypto library for mac. #384
nmoinvaz commentedon Apr 30, 2019
I have added a check to the cmake in the
devbranch that will check for the availablity of common crypto library.Fixed wrong cmake macro used. #384
ryandesign commentedon May 2, 2019
Thanks, I'll look into those.
Thanks, but it looks like you added a check for CommonCrypto.h, but the header you're using that's missing is CommonRandom.h.
The first appearance of some of the Common Crypto functions was Mac OS X 10.4. The CommonCrypto.h header (which just includes some of the others) was added in OS X 10.8. The CommonRandom.h header (which contains the
CCRandomGenerateBytesfunction minizip is using) was added in OS X 10.10.Check for existence of CommonRandom.h instead of CommonCrypto.h #384
nmoinvaz commentedon May 2, 2019
Ok, I have updated it again. Thank you.
nmoinvaz commentedon May 2, 2019
I'm not sure if it makes sense to use
SecRandomCopyBytesinstead. @Coeur thoughts?Use SecRandomCopyBytes available on 10.7+ instead of CCRandomCopyBytes.
nmoinvaz commentedon May 2, 2019
I have changed it to use
SecRandomCopyByteswhich is available on 10.7. I wouldn't be surprised if underneathCCRandomCopyBytesit uses this function. Let me know if you have any issues with this.Coeur commentedon May 2, 2019
Regarding CommonCrypto.h, in my projects, I only target macOS 10.8+ for "modern" Objective-C or macOS 10.14.3+ for Swift with stable ABI, so I always have that header.
Regarding CCRandomCopyBytes, it's partially open source: https://opensource.apple.com/source/CommonCrypto/CommonCrypto-60074/lib/CommonRandom.c
It does:
So it has the same signature as SecRandomCopyBytes, and yes, they are probably interchangeable.
And for the laugh, CommonCrypto is using Brian Gladman AES under the hood: https://opensource.apple.com/source/CommonCrypto/CommonCrypto-55010/Source/GladmanAES/
nmoinvaz commentedon May 2, 2019
Haha that is a good laugh! It looks like more recent versions might not use it, still funny though.