<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:r_ansi;
        panose-1:2 11 6 9 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi, <o:p></o:p></p>
<p class="MsoNormal">  I’m trying to dig through a problem where building the FIPS capable version of OpenSSL-1.0.1r is not generating the correct code. 
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have done the following:<o:p></o:p></p>
<p class="MsoNormal">Created the fips canister according to the instructions in the User Guide, and installed it.<o:p></o:p></p>
<p class="MsoNormal">Then in the openssl source, I use ./config fips no-ec2m shared --with-fipsdir=/usr/local/ssl/fips-2.0 --with-fipslibdir=/usr/local/ssl/fips-2.0/lib/<o:p></o:p></p>
<p class="MsoNormal">    I always get a libcrypto.a that fails FIPS_mode_set as not supported.<o:p></o:p></p>
<p class="MsoNormal">If I leave the shared parameter off, I get the desired FIPS support, but in non-PIC code.  Since my need is to produce a .so of my own with the libcrypto.a statically linked into it that doesn’t work.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Digging into this a little, I see the FIPS_mode_set() definition in crypto/o_fips.c is gated by finding a definition of OPENSSL_FIPS.    I do see that in the generated opensslconf.h. 
<o:p></o:p></p>
<p class="MsoNormal">I can’t quite see why the shared versus non-shared would create a problem.     I didn’t have this trouble with the earlier version 1.0.1j of openssl, or at least I didn’t see it.. was PIC code still generated at that release for non-shared?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">As an aside, I did notice an anomaly in crypto/cryptlib.h near line 72:<o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:r_ansi">#include <openssl/crypto.h><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:r_ansi">#include <openssl/buffer.h><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:r_ansi">#include <openssl/bio.h><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:r_ansi">#include <openssl/err.h><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:r_ansi">#include <openssl/opensslconf.h><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">However, in crypto.h decisions are made based on the definition of OPENSSL_FIPS, which is not defined until opensslconf.h is read at line 76, so the behavior of crypto.h seems to be not as intended. 
<o:p></o:p></p>
<p class="MsoNormal">Thoughts, flames?<o:p></o:p></p>
<p class="MsoNormal">Thanks, -Kurt<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b><span style="color:red"><o:p> </o:p></span></b></p>
<p class="MsoNormal">Kurt Heberlein<o:p></o:p></p>
<p class="MsoNormal">Master Technologist<o:p></o:p></p>
<p class="MsoNormal">3PAR R&D<o:p></o:p></p>
<p class="MsoNormal">   HPE Storage <o:p></o:p></p>
<p class="MsoNormal">   <a href="http://www.hpe.com/storage">www.hpe.com/storage</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">   +1 512 319 4462 (office) <o:p></o:p></p>
<p class="MsoNormal">   +1 510 685 1141 (mobile)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">    kurt dot w dot heberlein at-sign hpe dot com<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">   <img border="0" width="194" height="76" id="Picture_x0020_1" src="cid:image001.png@01D195A5.27BD87D0"><o:p></o:p></p>
<p class="MsoNormal">   <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>