Skip to content
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

It is (probably) okay to decrypt a message with a revoked, expired or weak key #6991

Closed
nwalfield opened this issue Oct 12, 2023 · 1 comment · Fixed by #7000
Closed

It is (probably) okay to decrypt a message with a revoked, expired or weak key #6991

nwalfield opened this issue Oct 12, 2023 · 1 comment · Fixed by #7000
Assignees

Comments

@nwalfield
Copy link

secret_key_from_cert is used by decrypt to decrypt a message:

/// Get the secret encryption key, which is the first and only subkey, from the cert.
pub(crate) fn secret_key_from_cert<'a>(
policy: &'a dyn Policy,
cert: &'a Cert,
) -> Result<Key<SecretParts, UnspecifiedRole>> {
// Pull the encryption keys that are compatible with by the standard policy
// (e.g. not SHA-1) supported by Sequoia, and not revoked.
// These filter options should be kept in sync with `Helper::decrypt()`.
let keys: Vec<_> = filter_keys!(cert.keys().secret(), policy).collect();

But, there is no reason to not decrypt a message if it key is expired, revoked, the policy says the algorithms are no longer strong enough. Is there?

@legoktm
Copy link
Member

legoktm commented Oct 12, 2023

In the current context of SecureDrop it's a bit theoretical. Source keypairs are fully created and managed by SecureDrop, so there should never be a scenario with an expired or revoked key.

AFAIK SecureDrop has always generated keys that are compliant with the current standard policy, but I agree with you that it doesn't make sense to prevent decryption of messages because of that.

@legoktm legoktm self-assigned this Oct 12, 2023
legoktm added a commit that referenced this issue Oct 12, 2023
Even if a source key is no longer valid per policy, we still want them
to be able to decrypt a previously valid message for them. We can also
drop the revocation/expiry filters, which were mostly theoretical in the
SecureDrop context anyways.

Fixes #6991.
legoktm added a commit that referenced this issue Oct 12, 2023
Even if a source key is no longer valid per policy, we still want them
to be able to decrypt a previously valid message for them. We can also
drop the revocation/expiry filters, which were mostly theoretical in the
SecureDrop context anyways.

Fixes #6991.
legoktm added a commit that referenced this issue Oct 12, 2023
Even if a source key is no longer valid per policy, we still want them
to be able to decrypt a previously valid message for them. We can also
drop the revocation/expiry filters, which were mostly theoretical in the
SecureDrop context anyways.

Fixes #6991.
legoktm added a commit that referenced this issue Oct 13, 2023
Even if a source key is no longer valid per policy, we still want them
to be able to decrypt a previously valid message for them. We can also
drop the revocation/expiry filters, which were mostly theoretical in the
SecureDrop context anyways.

We first try validating the key with the StandardPolicy before trying
again with a NullPolicy to avoid downgrade attacks. Since we now have
another type of policy being used, the constant has been renamed to
STANDARD_POLICY to be clearer what kind it is.

Fixes #6991.
legoktm added a commit that referenced this issue Oct 27, 2023
Even if a source key is no longer valid per policy, we still want them
to be able to decrypt a previously valid message for them. We can also
drop the revocation/expiry filters, which were mostly theoretical in the
SecureDrop context anyways.

We first try validating the key with the StandardPolicy before trying
again with a NullPolicy to avoid downgrade attacks. Since we now have
another type of policy being used, the constant has been renamed to
STANDARD_POLICY to be clearer what kind it is.

Fixes #6991.
zenmonkeykstop pushed a commit that referenced this issue Oct 27, 2023
Even if a source key is no longer valid per policy, we still want them
to be able to decrypt a previously valid message for them. We can also
drop the revocation/expiry filters, which were mostly theoretical in the
SecureDrop context anyways.

We first try validating the key with the StandardPolicy before trying
again with a NullPolicy to avoid downgrade attacks. Since we now have
another type of policy being used, the constant has been renamed to
STANDARD_POLICY to be clearer what kind it is.

Fixes #6991.

(cherry picked from commit 3596bb0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants