Skip to content

Commit

Permalink
redwood: Correctly check for secret key material
Browse files Browse the repository at this point in the history
We were not checking if any subkeys had secret key material too, which
is_tsk() checks for us.

Fixes #6988.
  • Loading branch information
legoktm committed Oct 13, 2023
1 parent 02cdf2f commit 814a37c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion redwood/src/lib.rs
Expand Up @@ -105,7 +105,7 @@ pub fn is_valid_public_key(input: &str) -> Result<String> {
// We don't need the keys, just need to check there's at least one and no error
keys::keys_from_cert(POLICY, &cert)?;
// And there is no secret key material
if cert.keys().secret().next().is_some() {
if cert.is_tsk() {
return Err(Error::HasSecretKeyMaterial);
}
Ok(cert.fingerprint().to_string())
Expand Down

0 comments on commit 814a37c

Please sign in to comment.