Hi all
I use the following code piece to create the digest of certificate
p = *p_key_buf;*
* /* get the certificate body as a DER string */
if ( i2d_X509_CINF(m_x509->cert_info, &p) == 0 )
{
printf("Ci2d_X509_CINF failed\n");
return;
}
length = p - p_key_buf;
if ( length > 8192 )
{
printf("i2d_X509_CINF value exceeds buffer length");
return ;
}
SHA1_Init(&SHA);
SHA1_Update(&SHA, p_key_buf, length);
SHA1_Final(sha_value, &SHA);
*
And the result of above code is different from X509_digest() 's. My openssl
version is 0.9.8f.
Is it correct?
--
Best regards to you and your family