-
Notifications
You must be signed in to change notification settings - Fork 1.7k
re-add branch we dropped in the past #11030
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
Conversation
src/rust/src/backend/utils.rs
Outdated
let pem_bytes = if password.is_empty() { | ||
rsa.private_key_to_pem()? | ||
} else { | ||
if cryptography_openssl::fips::is_enabled() { |
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.
This same issue is applicable to DSA and EC right? I think this should be higher up, at line 148 or so.
Co-authored-by: Alex Gaynor <[email protected]>
tests/hazmat/primitives/test_dsa.py
Outdated
@pytest.mark.supported( | ||
only_if=lambda backend: backend._fips_enabled, | ||
skip_message="Requires FIPS", | ||
) | ||
def test_traditional_serialization_fips(self, backend): | ||
key_bytes = load_vectors_from_file( | ||
os.path.join("asymmetric", "PKCS8", "unenc-dsa-pkcs8.pem"), | ||
lambda pemfile: pemfile.read().encode(), | ||
) | ||
key = serialization.load_pem_private_key(key_bytes, None, backend) | ||
assert isinstance(key, dsa.DSAPrivateKey) | ||
with pytest.raises(ValueError): | ||
key.private_bytes( | ||
serialization.Encoding.PEM, | ||
serialization.PrivateFormat.TraditionalOpenSSL, | ||
serialization.BestAvailableEncryption(b"password"), | ||
) | ||
|
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.
This is never reachable, we don't support DSA with FIPS
let's see if this fails since we shouldn't have a test covering this branch...