[xmlsec] XMLsec: Crash on WinNT in Keysmngr.c [Virus checked]

Hans-Juergen.Heinrich@de.gi-de.com Hans-Juergen.Heinrich@de.gi-de.com
Fri, 17 May 2002 13:21:50 +0200


This is a multi-part message in MIME format.
Since your mail reader does not understand
this format, some or all of this message may not be legible.

--0__=C1256BBC003D95178f9e8a93df938690918cC1256BBC003D9517
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: quoted-printable


Dear author,

Here's a problem occurring in XMLsec on WinNT, but there is also
a solution :-)
When calling the procedure PEM_read_PrivateKey in Keysmngr.c, the
program will crash.
Anyway, this problem is already well-known in the OpenSSL mailing list,=

where a solution was provided (I did not yet try it, however!). See the=

attachment containing this mail.

I just wanted to report it so that you can update the XMLsec software.

Best regards,
Hans-J=FCrgen Heinrich

----------------------------------
Dr. Hans-J=FCrgen Heinrich
System engineer, 4TE3
Giesecke & Devrient GmbH, Truderinger Stra=DFe 15, D-81607 M=FCnchen
Phone:  +49 89 4119-2625, FAX:     +49 89 4119-1629
mailto:hans-juergen.heinrich@de.gi-de.com
http://www.gieseckedevrient.com

(See attached file: crash_solution.txt)
It works fines:

  EVP_PKEY *key;
  BIO *bio;
  char *file;
  //Init file with the appropriate path to the private key file.
  char *password;
  //Init the password.

  bio =3D BIO_new( BIO_s_file() );
  BIO_read_filename( bio, file );
  key  =3D PEM_read_bio_PrivateKey( bio, NULL, NULL, password );

Note that I am not providing a password callback and that I am using th=
e
bio
version of the PEM_read_PrivateKey.
I hope it helps.

Marc-Andre

-----Original Message-----
From: Roberto Rodrigues - McLean [mailto:Roberto.Rodrigues@Spacenet.com=
]
Sent: Friday, April 26, 2002 4:55 PM
To: 'openssl-users@openssl.org'
Subject: PEM_read_PrivateKey() wont work on Windows (visual)


hi,

I basically copied the code from sign.c, I call it like this:
PEM_read_PrivateKey(fp, NULL, pass_cb, password);

it crashes complaining about memory access.

Has anyone make it work on Windows ? Is there any other way of loading =
a
Private Key from a file (into a EVP obj) ?

Thank you,
roberto.KEY *key;
  BIO *bio;
  char *file;
  //Init file with the appropriate path to the private key file.
  char *password;
  //Init the password.

  bio =3D BIO_new( BIO_s_file() );
  BIO_read_filename( bio, file );
  key  =3D PEM_read_bio_PrivateKey( bio, NULL, NULL, password );

Note that I am not providing a password callback and that I am using th=
e
bio
version of the PEM_read_PrivateKey.
I hope it helps.

Marc-Andre

-----Original Message-----
From: Roberto Rodrigues - McLean [mailto:Roberto.Rodrigues@Spacenet.com=
]
Sent: Friday, April 26, 2002 4:55 PM
To: 'openssl-users@openssl.org'
Subject: PEM_read_PrivateKey() wont work on Windows (visual)


hi,

I basically copied the code from sign.c, I call it like this:
PEM_read_PrivateKey(fp, NULL, pass_cb, password);

it crashes complaining about memory access.

Has anyone make it work on Windows ? Is there any other way of loading =
a
Private Key from a file (into a EVP obj) ?

Thank you,
roberto.
=

--0__=C1256BBC003D95178f9e8a93df938690918cC1256BBC003D9517
Content-type: application/octet-stream; 
	name="=?iso-8859-1?Q?crash=5Fsolution.txt?="
Content-Disposition: attachment; filename="=?iso-8859-1?Q?crash=5Fsolution.txt?="
Content-transfer-encoding: base64

SXQgd29ya3MgZmluZSB3aXRoIGEgY29kZSBzaW1pbGFyIHRvIHRoaXM6DQoNCiAgRVZQX1BLRVkg
KmtleTsNCiAgQklPICpiaW87DQogIGNoYXIgKmZpbGU7DQogIC8vSW5pdCBmaWxlIHdpdGggdGhl
IGFwcHJvcHJpYXRlIHBhdGggdG8gdGhlIHByaXZhdGUga2V5IGZpbGUuDQogIGNoYXIgKnBhc3N3
b3JkOw0KICAvL0luaXQgdGhlIHBhc3N3b3JkLg0KDQogIGJpbyA9IEJJT19uZXcoIEJJT19zX2Zp
bGUoKSApOw0KICBCSU9fcmVhZF9maWxlbmFtZSggYmlvLCBmaWxlICk7DQogIGtleSAgPSBQRU1f
cmVhZF9iaW9fUHJpdmF0ZUtleSggYmlvLCBOVUxMLCBOVUxMLCBwYXNzd29yZCApOw0KDQpOb3Rl
IHRoYXQgSSBhbSBub3Qgc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