Re: SHA-1 Hash Problem with i2d_Pubkey()

2010-09-13 Thread Raj Singh
Hi David/Stefan, Thanks for the reply. The core of the problem was that after calling i2d_PUBKEY() issuer_pubkey was pointing to end of the buffer. Interesting part is why it was working [same pubkey data] all time in single test program and not my application. In single test program, issuer_pbuke

Re: SHA-1 Hash Problem with i2d_Pubkey()

2010-09-13 Thread stefan.n...@t-online.de
Hi, > To: openssl-...@openssl.org, openssl-users@openssl.org One list really would have been enough ... (snipp) > issuer_pubkey = malloc(issuer_pubkey_len); > i2d_PUBKEY(pubKey, &issuer_pubkey); The fact that you need to pass the _address_ of issuer_pubkey hints at amodification of

Re: SHA-1 Hash Problem with i2d_Pubkey()

2010-09-13 Thread David Schwartz
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

SHA-1 Hash Problem with i2d_Pubkey()

2010-09-12 Thread Raj Singh
Hi! I was to send SHA1 hash of my public to some peer. For that i have written a function: EVP_PKEY * ReadPublicKey(const char *certfile) { FILE *fp = fopen (certfile, "r"); X509 *x509; EVP_PKEY *pkey; if (!fp) return NULL; x509 = PEM_read_X509(fp, NULL, 0, NULL); if (x509 ==