-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added check to turn off CC backend for OS X version < 10.8 #744
Conversation
Is 10.8 the lowest version that actually works? |
Test PASSed. |
Yes, I explicitly wrote it to support only 10.8+. There are several major missing features in older CC (like GCM). |
Of course I have no idea how we get test coverage for this. You could re-write the if/else to be like |
Have the whole thing invoke a function that you pass the version to, then you can pass it < 10.8 as a test. |
That sounds ugly and doesn't really tell you very much? |
Gets you coverage :) I prefer your solution provided coverage doesn't think there's an uncovered branch. |
Now checking my source(http://sourceforge.net/p/fink/mailman/fink-users/thread/[email protected]/) it might actually be that the KeyDeriviation file is available from 10.7 (but there is additional changes in 10.8) On apple open source the file is copyright 2010, making inclusion in 10.7 likely |
KDF is indeed in 10.7, but AES GCM and several other primitives are not available in 10.7 that were added in 10.8 so we made the decision to limit the CC backend to 10.8+ (at least for now). |
Test PASSed. |
Test PASSed. |
@@ -46,4 +48,5 @@ def _ensure_ffi_initialized(cls): | |||
|
|||
@classmethod | |||
def is_available(cls): | |||
return sys.platform == "darwin" | |||
version = parse_version(platform.mac_ver()[0]) | |||
return version >= parse_version("10.8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Err, what does this do under a non-OS X OS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It returns an empty tuple, which makes me uncomfortable since I don't know if that's a guarantee or just a coincidence. I'd prefer to do this using platform.uname() I think (Darwin >=12 is 10.8+).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If sys.platform =="Darwin" and platform.mac_ver() something something
On Mar 6, 2014, at 6:27 PM, Paul Kehrer [email protected] wrote:
In cryptography/hazmat/bindings/commoncrypto/binding.py:
@@ -46,4 +48,5 @@ def _ensure_ffi_initialized(cls):
@classmethod def is_available(cls):
return sys.platform == "darwin"
version = parse_version(platform.mac_ver()[0])
It returns an empty tuple, which makes me uncomfortable since I don't know if that's a guarantee or just a coincidence. I'd prefer to do this using platform.uname() I think (Darwin >=12 is 10.8+).return version >= parse_version("10.8")
—
Reply to this email directly or view it on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@reaperhulk The docs state
Entries which cannot be determined are set to ''. All tuple entries are strings.
so I assumed that it is guaranteed to be an empty tuple for non OS X systems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought you were going to keep the sys.platform check?
Test FAILed. |
Test FAILed. |
Test PASSed. |
Added check to turn off CC backend for OS X version < 10.8
No description provided.