[xmlsec] Bug report

Jesse Pelton jsp at PKC.com
Mon Apr 7 07:45:28 PDT 2003


xmlSecKeyReadBinaryFile() in the 0.1.1 version of keys.c uses fopen to open
a binary file. The file mode is specified as "r", which seems to be fine for
POSIX-compliant systems, but some non-POSIX systems (like Windows) support a
text/binary switch as specified in ISO C. Such systems may default to text
mode, in which case reads will terminate when an end-of-file character is
encountered, and end-of-line sequences may be transformed when read.

Since the text/binary switch is part of ISO C, compliant systems that don't
support it flag must ignore it.  BSD, Solaris, and Linux man pages for
fopen() indicate that they do so. I don't know about other operating
systems.

That's the case for the change. The change itself is simple: the fopen()
mode parameter in xmlSecKeyReadBinaryFile() needs to change from "r" to
"rb". (That's line 783 of r1.44 according to bonsai.)

xmlSecOpenSSLAppPkcs12Load() probably also needs a similar change.



More information about the xmlsec mailing list