PKCS7_add_signature dumps core (windows)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OpenSSL experts,

Here the intention is to get the signed data (raw signature obtained
by PKCS11 APIs like C_Sign) to be packed in PKCS7 format (attached -
with certificate, content and signer info) using openssl.

I am using USB token (smart card) for signing.

Here's the code snippet.

	PKCS7* p7 = PKCS7_new();
	PKCS7_set_type(p7, NID_pkcs7_signed);
	//PKCS7_SIGNER_INFO* pSI = PKCS7_SIGNER_INFO_new();
	//PKCS7_SIGNER_INFO_set(pSI, pX509, pX509->cert_info->key->pkey, EVP_sha256());
	//PKCS7_add_signer(p7, pSI);
	PKCS7_SIGNER_INFO* pSI = PKCS7_add_signature(p7, pX509,
pX509->cert_info->key->pkey, EVP_sha256());  // <== core dumps here
        :
        :
where pX509 is correctly obtained X509* node using d2i_X509() from the
value obtained from PKCS11 funcstions like C_GetAttributeValue() etc.

I believe the set of the commented lines is the alternate way for this
add signature function - that also dumps core at
PKCS7_SIGNER_INFO_set() function.

I have no clue as to what am I doing wrong here.

Appreciate your help.

regards
Srinivas


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux