sbsign: handle errors from PKCS7_sign_add_signer()
Rather than causing a segfault (si == NULL), report an error and exit. Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
This commit is contained in:
parent
8f8939d9bb
commit
81d7825c98
1 changed files with 5 additions and 0 deletions
5
sbsign.c
5
sbsign.c
|
@ -195,6 +195,11 @@ int main(int argc, char **argv)
|
|||
|
||||
PKCS7_SIGNER_INFO *si = PKCS7_sign_add_signer(p7, cert,
|
||||
pkey, md, PKCS7_BINARY);
|
||||
if (!si) {
|
||||
fprintf(stderr, "error in key/certificate chain\n");
|
||||
ERR_print_errors_fp(stderr);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
PKCS7_content_new(p7, NID_pkcs7_data);
|
||||
|
||||
|
|
Loading…
Reference in a new issue