From: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
To: linux-modules@vger.kernel.org
Cc: ykaliuta@redhat.com, Lucas De Marchi <lucas.demarchi@intel.com>
Subject: Re: [PATCH] libkmod-signature: implement pkcs7 parsing with openssl
Date: Sun, 18 Nov 2018 09:54:55 +0200 [thread overview]
Message-ID: <xunyzhu6izw0.fsf@redhat.com> (raw)
In-Reply-To: <20181116183228.32080-1-yauheni.kaliuta@redhat.com> (Yauheni Kaliuta's message of "Fri, 16 Nov 2018 20:32:28 +0200")
Hi!
>>>>> On Fri, 16 Nov 2018 20:32:28 +0200, Yauheni Kaliuta wrote:
[...]
Yeah, cleanup on error for the values allocated below.
But the main question is in general if the way of linking is
possible.
> +
> +
> + sno_bn = ASN1_INTEGER_to_BN(sno, NULL);
> + if (sno_bn == NULL)
> + goto err;
> +
> + len = BN_num_bytes(sno_bn);
> + key_id_str = malloc(len);
> + BN_bn2bin(sno_bn, key_id_str);
> +
> + sig_info->key_id = (const char *)key_id_str;
> + sig_info->key_id_len = len;
> +
> + issuer_str = x509_name_to_str(issuer);
> + if (issuer_str != NULL) {
> + sig_info->signer = issuer_str;
> + sig_info->signer_len = strlen(issuer_str);
> + }
> +
> + sig_info->algo = NULL;
> +
> + X509_ALGOR_get0(&o, NULL, NULL, dig_alg);
> +
> + sig_info->hash_algo = pkey_hash_algo[obj_to_hash_algo(o)];
> + sig_info->id_type = pkey_id_type[modsig->id_type];
> +
> + pvt = malloc(sizeof(*pvt));
> + if (pvt == NULL)
> + goto err;
> +
> + pvt->cms = cms;
> + pvt->key_id = key_id_str;
> + pvt->sno = sno_bn;
> + sig_info->private = pvt;
> +
> + sig_info->free = pkcs7_free;
> +
> + return true;
> +
> +err:
> + CMS_ContentInfo_free(cms);
> + return false;
> +}
> +
--
WBR,
Yauheni Kaliuta
prev parent reply other threads:[~2018-11-18 7:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-16 18:32 [PATCH] libkmod-signature: implement pkcs7 parsing with openssl Yauheni Kaliuta
2018-11-16 18:34 ` Yauheni Kaliuta
2018-11-18 7:54 ` Yauheni Kaliuta [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xunyzhu6izw0.fsf@redhat.com \
--to=yauheni.kaliuta@redhat.com \
--cc=linux-modules@vger.kernel.org \
--cc=lucas.demarchi@intel.com \
--cc=ykaliuta@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).