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

Fixes #15247: Validating signatures in shared-files API #2322

Merged
merged 1 commit into from
Jul 19, 2019
Merged

Fixes #15247: Validating signatures in shared-files API #2322

merged 1 commit into from
Jul 19, 2019

Conversation

bernsteining
Copy link
Contributor

@@ -76,6 +78,13 @@ impl HashType {
}
}
}

fn hashtype_to_openssl_hash(&self) -> MessageDigest {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to_openssl_hash is enough as it is already a method on HashType

@@ -177,6 +186,19 @@ pub fn get_pubkey(pubkey: String) -> Result<PKey<Public>, ErrorStack> {
)?)
}

pub fn validate_signature(file: String, pubkey: PKey<Public>, hash_type: HashType, digest: &[u8]) -> Result<bool, ErrorStack>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@bernsteining
Copy link
Contributor Author

Commit modified

@Normation-Quality-Assistant
Copy link
Contributor

OK, merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit 9e3bb5e into Normation:master Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants