55f7e85aeac5a08fdf956bb0830e0bb5bf11010b
[openssl-web.git] / docs / faq-4-build.txt
1 Questions on Building and Testing OpenSSL
2
3 * Does OpenSSL use AES-NI or other speedups?
4
5 The short answer is yes, unless you configure with "no-asm."
6
7 What OpenSSL does is not obvious.  The INSTALL document talks about the
8 no-asm configuration option.  Details about what the assembler code does
9 in terms of optimization are only available by reading the source code
10 comments in the various Perl files that generate the assembler, mostly.
11
12 On x86, the assembly code uses the CPUID instruction (see the
13 OPENSSL_ia32cap.pod manpage) to determine if various instructions (AES,
14 SSE, MMX, etc) are available and will use them if so.  For other processors,
15 similar tests are performed if at all possible.
16
17 * Why does Clang sanitizer give warnings?
18
19 You need to build with -DPEDANTIC to run sanitized tests, otherwise
20 you will get optimized assembler versions of some functions.
21
22 * Why does the linker complain about undefined symbols?
23
24 Maybe the compilation was interrupted, and make doesn't notice that
25 something is missing.  Run "make clean; make".
26
27 If you used ./Configure instead of ./config, make sure that you
28 selected the right target.  File formats may differ slightly between
29 OS versions (for example sparcv8/sparcv9, or a.out/elf).
30
31 In case you get errors about the following symbols, use the config
32 option "no-asm", as described in INSTALL:
33
34 <PRE>
35     BF_cbc_encrypt, BF_decrypt, BF_encrypt, CAST_cbc_encrypt,
36     CAST_decrypt, CAST_encrypt, RC4, RC5_32_cbc_encrypt, RC5_32_decrypt,
37     RC5_32_encrypt, bn_add_words, bn_div_words, bn_mul_add_words,
38     bn_mul_comba4, bn_mul_comba8, bn_mul_words, bn_sqr_comba4,
39     bn_sqr_comba8, bn_sqr_words, bn_sub_words, des_decrypt3,
40     des_ede3_cbc_encrypt, des_encrypt, des_encrypt2, des_encrypt3,
41     des_ncbc_encrypt, md5_block_asm_host_order, sha1_block_asm_data_order
42 </PRE>
43
44 If none of these helps, you may want to try using the current snapshot.
45 If the problem persists, please submit a bug report.
46
47 * Why does the OpenSSL compilation fail with "ar: command not found"?
48
49 Getting this message is quite usual on Solaris 2, because Sun has hidden
50 away 'ar' and other development commands in directories that aren't in
51 $PATH by default.  One of those directories is '/usr/ccs/bin'.  The
52 quickest way to fix this is to do the following (it assumes you use sh
53 or any sh-compatible shell):
54
55 <PRE>
56     PATH=${PATH}:/usr/ccs/bin; export PATH
57 </PRE>
58
59 and then redo the compilation.  What you should really do is make sure
60 '/usr/ccs/bin' is permanently in your $PATH, for example through your
61 '.profile' (again, assuming you use a sh-compatible shell).
62
63 * Why does the OpenSSL compilation fail on Win32 with VC++?
64
65 Sometimes, you may get reports from VC++ command line (cl) that it
66 can't find standard include files like stdio.h and other weirdnesses.
67 One possible cause is that the environment isn't correctly set up.
68 To solve that problem for VC++ versions up to 6, one should run
69 VCVARS32.BAT which is found in the 'bin' subdirectory of the VC++
70 installation directory (somewhere under 'Program Files').  For VC++
71 version 7 (and up?), which is also called VS.NET, the file is called
72 VSVARS32.BAT instead.
73 This needs to be done prior to running NMAKE, and the changes are only
74 valid for the current DOS session.
75
76 * What is special about OpenSSL on Redhat?
77
78 Red Hat Linux (release 7.0 and later) include a preinstalled limited
79 version of OpenSSL. Red Hat has chosen to disable support for IDEA, RC5 and
80 MDC2 in this version. The same may apply to other Linux distributions.
81 Users may therefore wish to install more or all of the features left out.
82
83 To do this you MUST ensure that you do not overwrite the openssl that is in
84 /usr/bin on your Red Hat machine. Several packages depend on this file,
85 including sendmail and ssh. /usr/local/bin is a good alternative choice. The
86 libraries that come with Red Hat 7.0 onwards have different names and so are
87 not affected. (eg For Red Hat 7.2 they are /lib/libssl.so.0.9.6b and
88 /lib/libcrypto.so.0.9.6b with symlinks /lib/libssl.so.2 and
89 /lib/libcrypto.so.2 respectively).
90
91 Please note that we have been advised by Red Hat attempting to recompile the
92 openssl rpm with all the cryptography enabled will not work. All other
93 packages depend on the original Red Hat supplied openssl package. It is also
94 worth noting that due to the way Red Hat supplies its packages, updates to
95 openssl on each distribution never change the package version, only the
96 build number. For example, on Red Hat 7.1, the latest openssl package has
97 version number 0.9.6 and build number 9 even though it contains all the
98 relevant updates in packages up to and including 0.9.6b.
99
100 A possible way around this is to persuade Red Hat to produce a non-US
101 version of Red Hat Linux.
102
103 * Why does the OpenSSL test suite fail in BN_sqr test [on a 64-bit platform]?
104
105 Failure in BN_sqr test is most likely caused by a failure to configure the
106 toolkit for current platform or lack of support for the platform in question.
107 Run './config -t' and './apps/openssl version -p'. Do these platform
108 identifiers match? If they don't, then you most likely failed to run
109 ./config and you're hereby advised to do so before filing a bug report.
110 If ./config itself fails to run, then it's most likely problem with your
111 local environment and you should turn to your system administrator (or
112 similar). If identifiers match (and/or no alternative identifier is
113 suggested by ./config script), then the platform is unsupported. There might
114 or might not be a workaround. Most notably on SPARC64 platforms with GNU
115 C compiler you should be able to produce a working build by running
116 './config -m32'. I understand that -m32 might not be what you want/need,
117 but the build should be operational. For further details turn to
118 @@@mailto:openssl-dev@openssl.org@@@
119
120 * Why does the OpenSSL test suite fail in sha512t on x86 CPU?
121
122 If the test program in question fails withs SIGILL, Illegal Instruction
123 exception, then you more than likely to run SSE2-capable CPU, such as
124 Intel P4, under control of kernel which does not support SSE2
125 instruction extensions. See accompanying INSTALL file and
126 OPENSSL_ia32cap(3) documentation page for further information.
127
128 * Why does compiler fail to compile sha512.c?
129
130 OpenSSL SHA-512 implementation depends on compiler support for 64-bit
131 integer type. Few elder compilers [ULTRIX cc, SCO compiler to mention a
132 couple] lack support for this and therefore are incapable of compiling
133 the module in question. The recommendation is to disable SHA-512 by
134 adding no-sha512 to ./config [or ./Configure] command line. Another
135 possible alternative might be to switch to GCC.
136
137 * Test suite still fails, what to do?
138
139 Another common reason for test failures is bugs in the toolchain
140 or run-time environment. Compiler bugs often appear in rather bizarre ways,
141 they never make sense, and tend to emerge when you least expect
142 them. One thing to try is to reduce the level of optimization (such
143 as by editing the CFLAG variable line in the top-level Makefile),
144 and then recompile and re-run the test.
145
146 * I think I've found a bug, what should I do?
147
148 If you are a new user then it is quite likely you haven't found a bug and
149 something is happening you aren't familiar with. Check this FAQ, the associated
150 documentation and the mailing lists for similar queries. If you are still
151 unsure whether it is a bug or not submit a query to the openssl-users mailing
152 list.
153
154 If you think you have found a bug based on the output of static analysis tools
155 then please manually check the issue is genuine. Such tools can produce a
156 LOT of false positives.
157
158 * I'm SURE I've found a bug, how do I report it?
159
160 Please see @@@https://www.openssl.org/community@@@.
161
162 * I've found a security issue, how do I report it?
163
164 If you think your bug has security implications then please send it to
165 openssl-security@openssl.org if you don't get a prompt reply at least
166 acknowledging receipt then resend or mail it directly to one of the
167 more active team members (e.g. Steve). If you wish to use PGP to send
168 in a report please use one or more of the keys of the OMC listed
169 at @@@https://www.openssl.org/community/omc.html@@@.
170
171 Note that bugs only present in the openssl utility are not in general
172 considered to be security issues.
173
174 * How do I enable weak ciphers?
175
176 Warning: known-insecure ciphers are disabled in newer releases of OpenSSL.
177 There is good reason why these have been disabled by default. Consider upgrading
178 to more robust options as these ciphers may only provide a facade of security.
179 This option is not recommended for anyone other than maintainers of legacy
180 applications.
181
182 You must set the weak ciphers flag and override the default SECLEVEL with:
183
184 <PRE>
185     ./config enable-weak-ssl-ciphers -DOPENSSL_TLS_SECURITY_LEVEL=0
186 </PRE>
187
188 Then follow compilation/install procedure like normal...