title: How do I know if the 'usedforsecurity' flag is supported by hashlib.md5?
body: <p>When I run the following on my Macbook, I get the error:</p>
  
  <pre><code>&gt;&gt;&gt; import hashlib
  &gt;&gt;&gt; hashlib.md5(usedforsecurity=False)
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: openssl_md5() takes no keyword arguments
  </code></pre>
  
  <p>But when I run it on my Linux box, it works!</p>
  
  <pre><code>&gt;&gt;&gt; import hashlib
  &gt;&gt;&gt; hashlib.md5(usedforsecurity=False)
  &lt;md5 HASH object @ 0x7f763c1375d0&gt;
  </code></pre>
  
  <p>My problem is, I need to run some safe, non-security related code on my FIPS enabled system (such as managing a cache of user requests which hashes the user query as an MD5 string). Using the <code>usedforsecurity</code> flag prevents a FIPs exception. </p>
  
  <p>This works fine, except when I want to test my code on my Macbook. My Macbook's "libcrypto" library apparently doesn't support this <code>usedforsecurity</code> flag. Is there a good way to detect if the underlying C bindings behind <code>hashlib.md5</code> support this  flag or not?</p>