------=_Part_4488_6211665.1142752283624
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi,

I am implementing a linux application about smime, it requires loading
private-key for decryption. I rewrite the load_key function just the same a=
s
OpenSSL. But It returns a NULL pointer.
By debugging, I found that an error may occurs when adding ciphers to the
hash table. The EVP_CIPHER object seems wrong. So I wrote the following
codes for testing.

test.cxx :
#include
int main()
{
const EVP_CIPHER* c =3D EVP_des_ede3_cbc();
return 0;
}
then: g++ -g -lssl test.cxx
and gdb says:
(gdb) p *c
$1 =3D {nid =3D 44, block_size =3D 8, key_len =3D 24, iv_len =3D 8, flags =
=3D 1026,
init =3D 0xa1a378 ,
do_cipher =3D 0xa1a021 , cleanup =3D 0, ctx_size =3D 384,
set_asn1_parameters =3D 0xa1e8c5 ,
get_asn1_parameters =3D 0xa1e82a , ctrl =3D 0,
app_data =3D 0x0}

but when debug:
openssl smime -decrypt -in my.enc -out my.dec -inkey ca.key -recip ca.crt
it says:
$1 =3D {nid =3D 44, block_size =3D 8, key_len =3D 24, iv_len =3D 8, flags =
=3D 514,
init =3D 0x80e2d10 ,
do_cipher =3D 0x80e2a90 , cleanup =3D 0, ctx_size =3D=
384,
set_asn1_parameters =3D 0x80e6920 ,
get_asn1_parameters =3D 0x80e68b0 ,
ctrl =3D 0x80e2d60 , app_data =3D 0x0}

I DON'T know why they are different. With the former one in my program, the
decryption of private key will failed, so load_key returns NULL.

Is there anyone can help me? Thanks a lot!!

------=_Part_4488_6211665.1142752283624
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi,



I am implementing a linux application about smime, it requires loading
private-key for decryption. I rewrite the load_key function just the
same as OpenSSL. But It returns a NULL pointer.

By debugging, I found that an error may occurs when adding ciphers to
the hash table. The EVP_CIPHER object seems wrong. So I wrote the
following codes for testing. 



test.cxx :

#include <openssl/evp.h>

int main()

{

     const EVP_CIPHER* c =3D EVP_des_ede3_cbc();

     return 0;

}

then:  g++ -g -lssl test.cxx

and gdb says:

(gdb) p *c

$1 =3D {nid =3D 44, block_size =3D 8, key_len =3D 24, iv_len =3D 8, tyle=3D"color: rgb(255, 0, 0);">flags =3D 1026,

  init =3D 0xa1a378 <EVP_des=
_ede3_cfb8+126>
,

  do_cipher =3D 0xa1a021 <EV=
P_bf_ecb+303>
, cleanup =3D 0, ctx_size =3D 384,

  set_asn1_parameters =3D 0xa1e8c5 <EVP_CIPHER_set_asn1_iv>,

  get_asn1_parameters =3D 0xa1e82a <EVP_CIPHER_get_asn1_iv>, an style=3D"color: rgb(255, 0, 0);">ctrl =3D 0,

  app_data =3D 0x0}



but when debug:

openssl smime -decrypt -in my.enc -out my.dec -inkey ca.key -recip ca.crt r>
it says:

$1 =3D {nid =3D 44, block_size =3D 8, key_len =3D 24, iv_len =3D 8, tyle=3D"color: rgb(255, 0, 0);">flags =3D 514,

  init =3D 0x80e2d10 <des_ed=
e3_init_key>
,

  do_cipher =3D 0x80e2a90 <d=
es_ede_cbc_cipher>
, cleanup =3D 0, ctx_size =3D 384,

  set_asn1_parameters =3D 0x80e6920 <EVP_CIPHER_set_asn1_iv>,
>
  get_asn1_parameters =3D 0x80e68b0 <EVP_CIPHER_get_asn1_iv>,
>
  ctrl =3D 0x80e2d60 <des3_c=
trl>
, app_data =3D 0x0}



I DON'T know why they are different. With the former one in my program,
the decryption of private key will failed, so load_key returns NULL.



Is there anyone can help me? Thanks a lot!!












------=_Part_4488_6211665.1142752283624--
__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-dev@openssl.org
Automated List Manager majordomo@openssl.org