mirror of
https://github.com/mtrojnar/osslsigncode.git
synced 2025-04-04 17:00:11 -05:00
Fixed getting content
This commit is contained in:
parent
4576895718
commit
dcf58a00e7
13
helpers.c
13
helpers.c
@ -268,15 +268,16 @@ int add_indirect_data_object(PKCS7 *p7)
|
|||||||
*/
|
*/
|
||||||
int sign_spc_indirect_data_content(PKCS7 *p7, ASN1_OCTET_STRING *content)
|
int sign_spc_indirect_data_content(PKCS7 *p7, ASN1_OCTET_STRING *content)
|
||||||
{
|
{
|
||||||
int len, hdrlen;
|
int len, inf, tag, class;
|
||||||
const u_char *data;
|
long plen;
|
||||||
|
const u_char *data, *p;
|
||||||
PKCS7 *td7;
|
PKCS7 *td7;
|
||||||
|
|
||||||
data = ASN1_STRING_get0_data(content);
|
p = data = ASN1_STRING_get0_data(content);
|
||||||
len = ASN1_STRING_length(content);
|
len = ASN1_STRING_length(content);
|
||||||
hdrlen = ASN1_object_size(0, len, V_ASN1_SEQUENCE) - len;
|
inf = ASN1_get_object(&p, &plen, &tag, &class, len);
|
||||||
|
if (inf != V_ASN1_CONSTRUCTED || tag != V_ASN1_SEQUENCE
|
||||||
if (!pkcs7_sign_content(p7, data + hdrlen, len - hdrlen)) {
|
|| !pkcs7_sign_content(p7, p, (int)plen)) {
|
||||||
printf("Failed to sign spcIndirectDataContent\n");
|
printf("Failed to sign spcIndirectDataContent\n");
|
||||||
return 0; /* FAILED */
|
return 0; /* FAILED */
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user