On 9/12/2010 11:38 PM, Raj Singh wrote:

issuer_pubkey_len = i2d_PUBKEY(pubKey, NULL);
issuer_pubkey = malloc(issuer_pubkey_len);
i2d_PUBKEY(pubKey, &issuer_pubkey);
memory_dump("issuer_pubkey", issuer_pubkey, issuer_pubkey_len);

The problem, is issuer_pubkey buffer is different each time, I run the
my application using same code.

Umm, you forgot to save the original issuer_pubkey. After the call to i2d_PUBKEY, issuer_pubkey points elsewhere. Try:

issuer_pubkey_len = i2d_PUBKEY(pubKey, NULL);
issuer_pubkey = malloc(issuer_pubkey_len);
foo=issuer_pubkey;
i2d_PUBKEY(pubKey, &foo);
memory_dump("issuer_pubkey", issuer_pubkey, issuer_pubkey_len);

DS

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to