openssl: add hash_algorithm parameter to pkcs7_new()
The pkcs7_new() function currently uses the hash algorithm from the X509 certificate's signature, but the content signature may use a different hash algorithm. This adds a parameter to allow specifying what hash algorithm the content signature generation used.
This commit is contained in:
@@ -355,7 +355,7 @@ static int verb_pkcs7(int argc, char *argv[], void *userdata) {
|
||||
|
||||
_cleanup_(PKCS7_freep) PKCS7 *pkcs7 = NULL;
|
||||
PKCS7_SIGNER_INFO *signer_info;
|
||||
r = pkcs7_new(certificate, /* private_key= */ NULL, &pkcs7, &signer_info);
|
||||
r = pkcs7_new(certificate, /* private_key= */ NULL, /* hash_algorithm= */ NULL, &pkcs7, &signer_info);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to allocate PKCS#7 context: %m");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user