Re: Include file order

Peter Budai <[email protected]> Sat, 9 Jun 2018 07:59:26 +0000
Newsgroups gmane.text.xml.xmlsec
Message-ID <AM5P189MB02910FEFFFE705696178556FC27A0@AM5P189MB0291.EURP189.PROD.OUTLOOK.COM>
--===============1063086533==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_AM5P189MB02910FEFFFE705696178556FC27A0AM5P189MB0291EURP_"

--_000_AM5P189MB02910FEFFFE705696178556FC27A0AM5P189MB0291EURP_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

I=92ll send a PR shortly, no problem



Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=3D550986> for Window=
s 10



________________________________
From: Aleksey Sanin <[email protected]>
Sent: Friday, June 8, 2018 6:44:29 PM
To: Peter Budai; [email protected]
Subject: Re: [xmlsec] Include file order

Interesting. Looks like libxslt is now including some windows crypto
code that triggered this issue.

I think changing includes order should be fine. Nothing in xmlsec
should depend on includes order. Do you mind sending a PR?

Aleksey

On 6/8/18 2:44 AM, Peter Budai wrote:
>
>
> With the latest release I have noticed that the build under MSYS2/MINGW
> is failing with the following message:
>
> ../../../src/openssl/x509.c:109:66: error: expected declaration
> specifiers or '...' before '(' token
>
> static xmlChar* xmlSecOpenSSLX509NameWrite (X509_NAME* nm);
>
> ^
>
> ../../../src/openssl/x509.c: In function
> 'xmlSecOpenSSLX509SubjectNameNodeWrite':
>
>
>
> More detailed build log you can see here:
> https://ci.appveyor.com/project/peterbud/xmlsec/build/job/sc82e41xseg7c39=
1#L494
>
>
>
> The problem in my understanding is that Windows headers also #define
> some names that openssl uses too. Openssl headers #undef the offending
> names before reusing them. But if those offending Windows headers get
> included _/after/_ the openssl headers the namespace gets polluted.
>
>
>
> As a solution I have changed the include order in the openssl/x509.c and
> openssl/x50vfy.c files, aka moved the openssl includes as the last files
> to include, and that solved the problem, I was able to compile and
> execute all the tests.
>
>
>
> However I=92m not sue this is the right solution. Any opinion?
>
>
>
> Peter
>
>
>
> _______________________________________________
> xmlsec mailing list
> [email protected]
> http://www.aleksey.com/mailman/listinfo/xmlsec
>

--_000_AM5P189MB02910FEFFFE705696178556FC27A0AM5P189MB0291EURP_
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1=
252">
<meta name=3D"Generator" content=3D"Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; pad=
ding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content=3D"text/html; charset=3Dutf-8">
<meta name=3D"x_Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style>
<!--
@font-face
	{font-family:"Cambria Math"}
@font-face
	{font-family:Calibri}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif}
a:x_link, span.x_MsoHyperlink
	{color:blue;
	text-decoration:underline}
a:x_visited, span.x_MsoHyperlinkFollowed
	{color:#954F72;
	text-decoration:underline}
.x_MsoChpDefault
	{}
@page WordSection1
	{margin:1.0in 1.0in 1.0in 1.0in}
div.x_WordSection1
	{}
-->
</style>
<div lang=3D"EN-US" link=3D"blue" vlink=3D"#954F72">
<div class=3D"x_WordSection1">
<p class=3D"x_MsoNormal">I=92ll send a PR shortly, no problem</p>
<p class=3D"x_MsoNormal">&nbsp;</p>
<p class=3D"x_MsoNormal">Sent from <a href=3D"https://go.microsoft.com/fwli=
nk/?LinkId=3D550986">
Mail</a> for Windows 10</p>
<p class=3D"x_MsoNormal">&nbsp;</p>
</div>
<hr tabindex=3D"-1" style=3D"display:inline-block; width:98%">
<div id=3D"x_divRplyFwdMsg" dir=3D"ltr"><font face=3D"Calibri, sans-serif" =
color=3D"#000000" style=3D"font-size:11pt"><b>From:</b> Aleksey Sanin &lt;a=
[email protected]&gt;<br>
<b>Sent:</b> Friday, June 8, 2018 6:44:29 PM<br>
<b>To:</b> Peter Budai; [email protected]<br>
<b>Subject:</b> Re: [xmlsec] Include file order</font>
<div>&nbsp;</div>
</div>
</div>
<font size=3D"2"><span style=3D"font-size:11pt;">
<div class=3D"PlainText">Interesting. Looks like libxslt is now including s=
ome windows crypto<br>
code that triggered this issue.<br>
<br>
I think changing includes order should be fine. Nothing in xmlsec<br>
should depend on includes order. Do you mind sending a PR?<br>
<br>
Aleksey<br>
<br>
On 6/8/18 2:44 AM, Peter Budai wrote:<br>
&gt; &nbsp;<br>
&gt; <br>
&gt; With the latest release I have noticed that the build under MSYS2/MING=
W<br>
&gt; is failing with the following message:<br>
&gt; <br>
&gt; ../../../src/openssl/x509.c:109:66: error: expected declaration<br>
&gt; specifiers or '...' before '(' token<br>
&gt; <br>
&gt; static xmlChar* xmlSecOpenSSLX509NameWrite (X509_NAME* nm);<br>
&gt; <br>
&gt; ^<br>
&gt; <br>
&gt; ../../../src/openssl/x509.c: In function<br>
&gt; 'xmlSecOpenSSLX509SubjectNameNodeWrite':<br>
&gt; <br>
&gt; &nbsp;<br>
&gt; <br>
&gt; More detailed build log you can see here:<br>
&gt; <a href=3D"https://ci.appveyor.com/project/peterbud/xmlsec/build/job/s=
c82e41xseg7c391#L494">
https://ci.appveyor.com/project/peterbud/xmlsec/build/job/sc82e41xseg7c391#=
L494</a><br>
&gt; <br>
&gt; &nbsp;<br>
&gt; <br>
&gt; The problem in my understanding is that Windows headers also #define<b=
r>
&gt; some names that openssl uses too. Openssl headers #undef the offending=
<br>
&gt; names before reusing them. But if those offending Windows headers get<=
br>
&gt; included _/after/_ the openssl headers the namespace gets polluted.<br=
>
&gt; <br>
&gt; &nbsp;<br>
&gt; <br>
&gt; As a solution I have changed the include order in the openssl/x509.c a=
nd<br>
&gt; openssl/x50vfy.c files, aka moved the openssl includes as the last fil=
es<br>
&gt; to include, and that solved the problem, I was able to compile and<br>
&gt; execute all the tests.<br>
&gt; <br>
&gt; &nbsp;<br>
&gt; <br>
&gt; However I=92m not sue this is the right solution. Any opinion?<br>
&gt; <br>
&gt; &nbsp;<br>
&gt; <br>
&gt; Peter<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; xmlsec mailing list<br>
&gt; [email protected]<br>
&gt; <a href=3D"http://www.aleksey.com/mailman/listinfo/xmlsec">http://www.=
aleksey.com/mailman/listinfo/xmlsec</a><br>
&gt; <br>
</div>
</span></font>
</body>
</html>

--_000_AM5P189MB02910FEFFFE705696178556FC27A0AM5P189MB0291EURP_--

--===============1063086533==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KeG1sc2VjIG1h
aWxpbmcgbGlzdAp4bWxzZWNAYWxla3NleS5jb20KaHR0cDovL3d3dy5hbGVrc2V5LmNvbS9tYWls
bWFuL2xpc3RpbmZvL3htbHNlYwo=

--===============1063086533==--