FAQ 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025
  1. OpenSSL - Frequently Asked Questions
  2. --------------------------------------
  3. [MISC] Miscellaneous questions
  4. * Which is the current version of OpenSSL?
  5. * Where is the documentation?
  6. * How can I contact the OpenSSL developers?
  7. * Where can I get a compiled version of OpenSSL?
  8. * Why aren't tools like 'autoconf' and 'libtool' used?
  9. * What is an 'engine' version?
  10. * How do I check the authenticity of the OpenSSL distribution?
  11. [LEGAL] Legal questions
  12. * Do I need patent licenses to use OpenSSL?
  13. * Can I use OpenSSL with GPL software?
  14. [USER] Questions on using the OpenSSL applications
  15. * Why do I get a "PRNG not seeded" error message?
  16. * Why do I get an "unable to write 'random state'" error message?
  17. * How do I create certificates or certificate requests?
  18. * Why can't I create certificate requests?
  19. * Why does <SSL program> fail with a certificate verify error?
  20. * Why can I only use weak ciphers when I connect to a server using OpenSSL?
  21. * How can I create DSA certificates?
  22. * Why can't I make an SSL connection using a DSA certificate?
  23. * How can I remove the passphrase on a private key?
  24. * Why can't I use OpenSSL certificates with SSL client authentication?
  25. * Why does my browser give a warning about a mismatched hostname?
  26. * How do I install a CA certificate into a browser?
  27. * Why is OpenSSL x509 DN output not conformant to RFC2253?
  28. * What is a "128 bit certificate"? Can I create one with OpenSSL?
  29. * Why does OpenSSL set the authority key identifier extension incorrectly?
  30. * How can I set up a bundle of commercial root CA certificates?
  31. [BUILD] Questions about building and testing OpenSSL
  32. * Why does the linker complain about undefined symbols?
  33. * Why does the OpenSSL test fail with "bc: command not found"?
  34. * Why does the OpenSSL test fail with "bc: 1 no implemented"?
  35. * Why does the OpenSSL test fail with "bc: stack empty"?
  36. * Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
  37. * Why does the OpenSSL compilation fail with "ar: command not found"?
  38. * Why does the OpenSSL compilation fail on Win32 with VC++?
  39. * What is special about OpenSSL on Redhat?
  40. * Why does the OpenSSL compilation fail on MacOS X?
  41. * Why does the OpenSSL test suite fail on MacOS X?
  42. * Why does the OpenSSL test suite fail in BN_sqr test [on a 64-bit platform]?
  43. * Why does OpenBSD-i386 build fail on des-586.s with "Unimplemented segment type"?
  44. * Why does the OpenSSL test suite fail in sha512t on x86 CPU?
  45. * Why does compiler fail to compile sha512.c?
  46. * Test suite still fails, what to do?
  47. * I think I've found a bug, what should I do?
  48. * I'm SURE I've found a bug, how do I report it?
  49. * I've found a security issue, how do I report it?
  50. [PROG] Questions about programming with OpenSSL
  51. * Is OpenSSL thread-safe?
  52. * I've compiled a program under Windows and it crashes: why?
  53. * How do I read or write a DER encoded buffer using the ASN1 functions?
  54. * OpenSSL uses DER but I need BER format: does OpenSSL support BER?
  55. * I've tried using <M_some_evil_pkcs12_macro> and I get errors why?
  56. * I've called <some function> and it fails, why?
  57. * I just get a load of numbers for the error output, what do they mean?
  58. * Why do I get errors about unknown algorithms?
  59. * Why can't the OpenSSH configure script detect OpenSSL?
  60. * Can I use OpenSSL's SSL library with non-blocking I/O?
  61. * Why doesn't my server application receive a client certificate?
  62. * Why does compilation fail due to an undefined symbol NID_uniqueIdentifier?
  63. * I think I've detected a memory leak, is this a bug?
  64. * Why does Valgrind complain about the use of uninitialized data?
  65. * Why doesn't a memory BIO work when a file does?
  66. * Where are the declarations and implementations of d2i_X509() etc?
  67. ===============================================================================
  68. [MISC] ========================================================================
  69. * Which is the current version of OpenSSL?
  70. The current version is available from <URL: http://www.openssl.org>.
  71. OpenSSL 1.0.0d was released on Feb 8th, 2011.
  72. In addition to the current stable release, you can also access daily
  73. snapshots of the OpenSSL development version at <URL:
  74. ftp://ftp.openssl.org/snapshot/>, or get it by anonymous CVS access.
  75. * Where is the documentation?
  76. OpenSSL is a library that provides cryptographic functionality to
  77. applications such as secure web servers. Be sure to read the
  78. documentation of the application you want to use. The INSTALL file
  79. explains how to install this library.
  80. OpenSSL includes a command line utility that can be used to perform a
  81. variety of cryptographic functions. It is described in the openssl(1)
  82. manpage. Documentation for developers is currently being written. Many
  83. manual pages are available; overviews over libcrypto and
  84. libssl are given in the crypto(3) and ssl(3) manpages.
  85. The OpenSSL manpages are installed in /usr/local/ssl/man/ (or a
  86. different directory if you specified one as described in INSTALL).
  87. In addition, you can read the most current versions at
  88. <URL: http://www.openssl.org/docs/>. Note that the online documents refer
  89. to the very latest development versions of OpenSSL and may include features
  90. not present in released versions. If in doubt refer to the documentation
  91. that came with the version of OpenSSL you are using.
  92. For information on parts of libcrypto that are not yet documented, you
  93. might want to read Ariel Glenn's documentation on SSLeay 0.9, OpenSSL's
  94. predecessor, at <URL: http://www.columbia.edu/~ariel/ssleay/>. Much
  95. of this still applies to OpenSSL.
  96. There is some documentation about certificate extensions and PKCS#12
  97. in doc/openssl.txt
  98. The original SSLeay documentation is included in OpenSSL as
  99. doc/ssleay.txt. It may be useful when none of the other resources
  100. help, but please note that it reflects the obsolete version SSLeay
  101. 0.6.6.
  102. * How can I contact the OpenSSL developers?
  103. The README file describes how to submit bug reports and patches to
  104. OpenSSL. Information on the OpenSSL mailing lists is available from
  105. <URL: http://www.openssl.org>.
  106. * Where can I get a compiled version of OpenSSL?
  107. You can finder pointers to binary distributions in
  108. <URL: http://www.openssl.org/related/binaries.html> .
  109. Some applications that use OpenSSL are distributed in binary form.
  110. When using such an application, you don't need to install OpenSSL
  111. yourself; the application will include the required parts (e.g. DLLs).
  112. If you want to build OpenSSL on a Windows system and you don't have
  113. a C compiler, read the "Mingw32" section of INSTALL.W32 for information
  114. on how to obtain and install the free GNU C compiler.
  115. A number of Linux and *BSD distributions include OpenSSL.
  116. * Why aren't tools like 'autoconf' and 'libtool' used?
  117. autoconf will probably be used in future OpenSSL versions. If it was
  118. less Unix-centric, it might have been used much earlier.
  119. * What is an 'engine' version?
  120. With version 0.9.6 OpenSSL was extended to interface to external crypto
  121. hardware. This was realized in a special release '0.9.6-engine'. With
  122. version 0.9.7 the changes were merged into the main development line,
  123. so that the special release is no longer necessary.
  124. * How do I check the authenticity of the OpenSSL distribution?
  125. We provide MD5 digests and ASC signatures of each tarball.
  126. Use MD5 to check that a tarball from a mirror site is identical:
  127. md5sum TARBALL | awk '{print $1;}' | cmp - TARBALL.md5
  128. You can check authenticity using pgp or gpg. You need the OpenSSL team
  129. member public key used to sign it (download it from a key server, see a
  130. list of keys at <URL: http://www.openssl.org/about/>). Then
  131. just do:
  132. pgp TARBALL.asc
  133. [LEGAL] =======================================================================
  134. * Do I need patent licenses to use OpenSSL?
  135. The patents section of the README file lists patents that may apply to
  136. you if you want to use OpenSSL. For information on intellectual
  137. property rights, please consult a lawyer. The OpenSSL team does not
  138. offer legal advice.
  139. You can configure OpenSSL so as not to use IDEA, MDC2 and RC5 by using
  140. ./config no-idea no-mdc2 no-rc5
  141. * Can I use OpenSSL with GPL software?
  142. On many systems including the major Linux and BSD distributions, yes (the
  143. GPL does not place restrictions on using libraries that are part of the
  144. normal operating system distribution).
  145. On other systems, the situation is less clear. Some GPL software copyright
  146. holders claim that you infringe on their rights if you use OpenSSL with
  147. their software on operating systems that don't normally include OpenSSL.
  148. If you develop open source software that uses OpenSSL, you may find it
  149. useful to choose an other license than the GPL, or state explicitly that
  150. "This program is released under the GPL with the additional exemption that
  151. compiling, linking, and/or using OpenSSL is allowed." If you are using
  152. GPL software developed by others, you may want to ask the copyright holder
  153. for permission to use their software with OpenSSL.
  154. [USER] ========================================================================
  155. * Why do I get a "PRNG not seeded" error message?
  156. Cryptographic software needs a source of unpredictable data to work
  157. correctly. Many open source operating systems provide a "randomness
  158. device" (/dev/urandom or /dev/random) that serves this purpose.
  159. All OpenSSL versions try to use /dev/urandom by default; starting with
  160. version 0.9.7, OpenSSL also tries /dev/random if /dev/urandom is not
  161. available.
  162. On other systems, applications have to call the RAND_add() or
  163. RAND_seed() function with appropriate data before generating keys or
  164. performing public key encryption. (These functions initialize the
  165. pseudo-random number generator, PRNG.) Some broken applications do
  166. not do this. As of version 0.9.5, the OpenSSL functions that need
  167. randomness report an error if the random number generator has not been
  168. seeded with at least 128 bits of randomness. If this error occurs and
  169. is not discussed in the documentation of the application you are
  170. using, please contact the author of that application; it is likely
  171. that it never worked correctly. OpenSSL 0.9.5 and later make the
  172. error visible by refusing to perform potentially insecure encryption.
  173. If you are using Solaris 8, you can add /dev/urandom and /dev/random
  174. devices by installing patch 112438 (Sparc) or 112439 (x86), which are
  175. available via the Patchfinder at <URL: http://sunsolve.sun.com>
  176. (Solaris 9 includes these devices by default). For /dev/random support
  177. for earlier Solaris versions, see Sun's statement at
  178. <URL: http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=fsrdb/27606&zone_32=SUNWski>
  179. (the SUNWski package is available in patch 105710).
  180. On systems without /dev/urandom and /dev/random, it is a good idea to
  181. use the Entropy Gathering Demon (EGD); see the RAND_egd() manpage for
  182. details. Starting with version 0.9.7, OpenSSL will automatically look
  183. for an EGD socket at /var/run/egd-pool, /dev/egd-pool, /etc/egd-pool and
  184. /etc/entropy.
  185. Most components of the openssl command line utility automatically try
  186. to seed the random number generator from a file. The name of the
  187. default seeding file is determined as follows: If environment variable
  188. RANDFILE is set, then it names the seeding file. Otherwise if
  189. environment variable HOME is set, then the seeding file is $HOME/.rnd.
  190. If neither RANDFILE nor HOME is set, versions up to OpenSSL 0.9.6 will
  191. use file .rnd in the current directory while OpenSSL 0.9.6a uses no
  192. default seeding file at all. OpenSSL 0.9.6b and later will behave
  193. similarly to 0.9.6a, but will use a default of "C:\" for HOME on
  194. Windows systems if the environment variable has not been set.
  195. If the default seeding file does not exist or is too short, the "PRNG
  196. not seeded" error message may occur.
  197. The openssl command line utility will write back a new state to the
  198. default seeding file (and create this file if necessary) unless
  199. there was no sufficient seeding.
  200. Pointing $RANDFILE to an Entropy Gathering Daemon socket does not work.
  201. Use the "-rand" option of the OpenSSL command line tools instead.
  202. The $RANDFILE environment variable and $HOME/.rnd are only used by the
  203. OpenSSL command line tools. Applications using the OpenSSL library
  204. provide their own configuration options to specify the entropy source,
  205. please check out the documentation coming the with application.
  206. * Why do I get an "unable to write 'random state'" error message?
  207. Sometimes the openssl command line utility does not abort with
  208. a "PRNG not seeded" error message, but complains that it is
  209. "unable to write 'random state'". This message refers to the
  210. default seeding file (see previous answer). A possible reason
  211. is that no default filename is known because neither RANDFILE
  212. nor HOME is set. (Versions up to 0.9.6 used file ".rnd" in the
  213. current directory in this case, but this has changed with 0.9.6a.)
  214. * How do I create certificates or certificate requests?
  215. Check out the CA.pl(1) manual page. This provides a simple wrapper round
  216. the 'req', 'verify', 'ca' and 'pkcs12' utilities. For finer control check
  217. out the manual pages for the individual utilities and the certificate
  218. extensions documentation (currently in doc/openssl.txt).
  219. * Why can't I create certificate requests?
  220. You typically get the error:
  221. unable to find 'distinguished_name' in config
  222. problems making Certificate Request
  223. This is because it can't find the configuration file. Check out the
  224. DIAGNOSTICS section of req(1) for more information.
  225. * Why does <SSL program> fail with a certificate verify error?
  226. This problem is usually indicated by log messages saying something like
  227. "unable to get local issuer certificate" or "self signed certificate".
  228. When a certificate is verified its root CA must be "trusted" by OpenSSL
  229. this typically means that the CA certificate must be placed in a directory
  230. or file and the relevant program configured to read it. The OpenSSL program
  231. 'verify' behaves in a similar way and issues similar error messages: check
  232. the verify(1) program manual page for more information.
  233. * Why can I only use weak ciphers when I connect to a server using OpenSSL?
  234. This is almost certainly because you are using an old "export grade" browser
  235. which only supports weak encryption. Upgrade your browser to support 128 bit
  236. ciphers.
  237. * How can I create DSA certificates?
  238. Check the CA.pl(1) manual page for a DSA certificate example.
  239. * Why can't I make an SSL connection to a server using a DSA certificate?
  240. Typically you'll see a message saying there are no shared ciphers when
  241. the same setup works fine with an RSA certificate. There are two possible
  242. causes. The client may not support connections to DSA servers most web
  243. browsers (including Netscape and MSIE) only support connections to servers
  244. supporting RSA cipher suites. The other cause is that a set of DH parameters
  245. has not been supplied to the server. DH parameters can be created with the
  246. dhparam(1) command and loaded using the SSL_CTX_set_tmp_dh() for example:
  247. check the source to s_server in apps/s_server.c for an example.
  248. * How can I remove the passphrase on a private key?
  249. Firstly you should be really *really* sure you want to do this. Leaving
  250. a private key unencrypted is a major security risk. If you decide that
  251. you do have to do this check the EXAMPLES sections of the rsa(1) and
  252. dsa(1) manual pages.
  253. * Why can't I use OpenSSL certificates with SSL client authentication?
  254. What will typically happen is that when a server requests authentication
  255. it will either not include your certificate or tell you that you have
  256. no client certificates (Netscape) or present you with an empty list box
  257. (MSIE). The reason for this is that when a server requests a client
  258. certificate it includes a list of CAs names which it will accept. Browsers
  259. will only let you select certificates from the list on the grounds that
  260. there is little point presenting a certificate which the server will
  261. reject.
  262. The solution is to add the relevant CA certificate to your servers "trusted
  263. CA list". How you do this depends on the server software in uses. You can
  264. print out the servers list of acceptable CAs using the OpenSSL s_client tool:
  265. openssl s_client -connect www.some.host:443 -prexit
  266. If your server only requests certificates on certain URLs then you may need
  267. to manually issue an HTTP GET command to get the list when s_client connects:
  268. GET /some/page/needing/a/certificate.html
  269. If your CA does not appear in the list then this confirms the problem.
  270. * Why does my browser give a warning about a mismatched hostname?
  271. Browsers expect the server's hostname to match the value in the commonName
  272. (CN) field of the certificate. If it does not then you get a warning.
  273. * How do I install a CA certificate into a browser?
  274. The usual way is to send the DER encoded certificate to the browser as
  275. MIME type application/x-x509-ca-cert, for example by clicking on an appropriate
  276. link. On MSIE certain extensions such as .der or .cacert may also work, or you
  277. can import the certificate using the certificate import wizard.
  278. You can convert a certificate to DER form using the command:
  279. openssl x509 -in ca.pem -outform DER -out ca.der
  280. Occasionally someone suggests using a command such as:
  281. openssl pkcs12 -export -out cacert.p12 -in cacert.pem -inkey cakey.pem
  282. DO NOT DO THIS! This command will give away your CAs private key and
  283. reduces its security to zero: allowing anyone to forge certificates in
  284. whatever name they choose.
  285. * Why is OpenSSL x509 DN output not conformant to RFC2253?
  286. The ways to print out the oneline format of the DN (Distinguished Name) have
  287. been extended in version 0.9.7 of OpenSSL. Using the new X509_NAME_print_ex()
  288. interface, the "-nameopt" option could be introduded. See the manual
  289. page of the "openssl x509" commandline tool for details. The old behaviour
  290. has however been left as default for the sake of compatibility.
  291. * What is a "128 bit certificate"? Can I create one with OpenSSL?
  292. The term "128 bit certificate" is a highly misleading marketing term. It does
  293. *not* refer to the size of the public key in the certificate! A certificate
  294. containing a 128 bit RSA key would have negligible security.
  295. There were various other names such as "magic certificates", "SGC
  296. certificates", "step up certificates" etc.
  297. You can't generally create such a certificate using OpenSSL but there is no
  298. need to any more. Nowadays web browsers using unrestricted strong encryption
  299. are generally available.
  300. When there were tight restrictions on the export of strong encryption
  301. software from the US only weak encryption algorithms could be freely exported
  302. (initially 40 bit and then 56 bit). It was widely recognised that this was
  303. inadequate. A relaxation of the rules allowed the use of strong encryption but
  304. only to an authorised server.
  305. Two slighly different techniques were developed to support this, one used by
  306. Netscape was called "step up", the other used by MSIE was called "Server Gated
  307. Cryptography" (SGC). When a browser initially connected to a server it would
  308. check to see if the certificate contained certain extensions and was issued by
  309. an authorised authority. If these test succeeded it would reconnect using
  310. strong encryption.
  311. Only certain (initially one) certificate authorities could issue the
  312. certificates and they generally cost more than ordinary certificates.
  313. Although OpenSSL can create certificates containing the appropriate extensions
  314. the certificate would not come from a permitted authority and so would not
  315. be recognized.
  316. The export laws were later changed to allow almost unrestricted use of strong
  317. encryption so these certificates are now obsolete.
  318. * Why does OpenSSL set the authority key identifier (AKID) extension incorrectly?
  319. It doesn't: this extension is often the cause of confusion.
  320. Consider a certificate chain A->B->C so that A signs B and B signs C. Suppose
  321. certificate C contains AKID.
  322. The purpose of this extension is to identify the authority certificate B. This
  323. can be done either by including the subject key identifier of B or its issuer
  324. name and serial number.
  325. In this latter case because it is identifying certifcate B it must contain the
  326. issuer name and serial number of B.
  327. It is often wrongly assumed that it should contain the subject name of B. If it
  328. did this would be redundant information because it would duplicate the issuer
  329. name of C.
  330. * How can I set up a bundle of commercial root CA certificates?
  331. The OpenSSL software is shipped without any root CA certificate as the
  332. OpenSSL project does not have any policy on including or excluding
  333. any specific CA and does not intend to set up such a policy. Deciding
  334. about which CAs to support is up to application developers or
  335. administrators.
  336. Other projects do have other policies so you can for example extract the CA
  337. bundle used by Mozilla and/or modssl as described in this article:
  338. <URL: http://www.mail-archive.com/modssl-users@modssl.org/msg16980.html>
  339. [BUILD] =======================================================================
  340. * Why does the linker complain about undefined symbols?
  341. Maybe the compilation was interrupted, and make doesn't notice that
  342. something is missing. Run "make clean; make".
  343. If you used ./Configure instead of ./config, make sure that you
  344. selected the right target. File formats may differ slightly between
  345. OS versions (for example sparcv8/sparcv9, or a.out/elf).
  346. In case you get errors about the following symbols, use the config
  347. option "no-asm", as described in INSTALL:
  348. BF_cbc_encrypt, BF_decrypt, BF_encrypt, CAST_cbc_encrypt,
  349. CAST_decrypt, CAST_encrypt, RC4, RC5_32_cbc_encrypt, RC5_32_decrypt,
  350. RC5_32_encrypt, bn_add_words, bn_div_words, bn_mul_add_words,
  351. bn_mul_comba4, bn_mul_comba8, bn_mul_words, bn_sqr_comba4,
  352. bn_sqr_comba8, bn_sqr_words, bn_sub_words, des_decrypt3,
  353. des_ede3_cbc_encrypt, des_encrypt, des_encrypt2, des_encrypt3,
  354. des_ncbc_encrypt, md5_block_asm_host_order, sha1_block_asm_data_order
  355. If none of these helps, you may want to try using the current snapshot.
  356. If the problem persists, please submit a bug report.
  357. * Why does the OpenSSL test fail with "bc: command not found"?
  358. You didn't install "bc", the Unix calculator. If you want to run the
  359. tests, get GNU bc from ftp://ftp.gnu.org or from your OS distributor.
  360. * Why does the OpenSSL test fail with "bc: 1 no implemented"?
  361. On some SCO installations or versions, bc has a bug that gets triggered
  362. when you run the test suite (using "make test"). The message returned is
  363. "bc: 1 not implemented".
  364. The best way to deal with this is to find another implementation of bc
  365. and compile/install it. GNU bc (see <URL: http://www.gnu.org/software/software.html>
  366. for download instructions) can be safely used, for example.
  367. * Why does the OpenSSL test fail with "bc: stack empty"?
  368. On some DG/ux versions, bc seems to have a too small stack for calculations
  369. that the OpenSSL bntest throws at it. This gets triggered when you run the
  370. test suite (using "make test"). The message returned is "bc: stack empty".
  371. The best way to deal with this is to find another implementation of bc
  372. and compile/install it. GNU bc (see <URL: http://www.gnu.org/software/software.html>
  373. for download instructions) can be safely used, for example.
  374. * Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
  375. On some Alpha installations running Tru64 Unix and Compaq C, the compilation
  376. of crypto/sha/sha_dgst.c fails with the message 'Fatal: Insufficient virtual
  377. memory to continue compilation.' As far as the tests have shown, this may be
  378. a compiler bug. What happens is that it eats up a lot of resident memory
  379. to build something, probably a table. The problem is clearly in the
  380. optimization code, because if one eliminates optimization completely (-O0),
  381. the compilation goes through (and the compiler consumes about 2MB of resident
  382. memory instead of 240MB or whatever one's limit is currently).
  383. There are three options to solve this problem:
  384. 1. set your current data segment size soft limit higher. Experience shows
  385. that about 241000 kbytes seems to be enough on an AlphaServer DS10. You do
  386. this with the command 'ulimit -Sd nnnnnn', where 'nnnnnn' is the number of
  387. kbytes to set the limit to.
  388. 2. If you have a hard limit that is lower than what you need and you can't
  389. get it changed, you can compile all of OpenSSL with -O0 as optimization
  390. level. This is however not a very nice thing to do for those who expect to
  391. get the best result from OpenSSL. A bit more complicated solution is the
  392. following:
  393. ----- snip:start -----
  394. make DIRS=crypto SDIRS=sha "`grep '^CFLAG=' Makefile.ssl | \
  395. sed -e 's/ -O[0-9] / -O0 /'`"
  396. rm `ls crypto/*.o crypto/sha/*.o | grep -v 'sha_dgst\.o'`
  397. make
  398. ----- snip:end -----
  399. This will only compile sha_dgst.c with -O0, the rest with the optimization
  400. level chosen by the configuration process. When the above is done, do the
  401. test and installation and you're set.
  402. 3. Reconfigure the toolkit with no-sha0 option to leave out SHA0. It
  403. should not be used and is not used in SSL/TLS nor any other recognized
  404. protocol in either case.
  405. * Why does the OpenSSL compilation fail with "ar: command not found"?
  406. Getting this message is quite usual on Solaris 2, because Sun has hidden
  407. away 'ar' and other development commands in directories that aren't in
  408. $PATH by default. One of those directories is '/usr/ccs/bin'. The
  409. quickest way to fix this is to do the following (it assumes you use sh
  410. or any sh-compatible shell):
  411. ----- snip:start -----
  412. PATH=${PATH}:/usr/ccs/bin; export PATH
  413. ----- snip:end -----
  414. and then redo the compilation. What you should really do is make sure
  415. '/usr/ccs/bin' is permanently in your $PATH, for example through your
  416. '.profile' (again, assuming you use a sh-compatible shell).
  417. * Why does the OpenSSL compilation fail on Win32 with VC++?
  418. Sometimes, you may get reports from VC++ command line (cl) that it
  419. can't find standard include files like stdio.h and other weirdnesses.
  420. One possible cause is that the environment isn't correctly set up.
  421. To solve that problem for VC++ versions up to 6, one should run
  422. VCVARS32.BAT which is found in the 'bin' subdirectory of the VC++
  423. installation directory (somewhere under 'Program Files'). For VC++
  424. version 7 (and up?), which is also called VS.NET, the file is called
  425. VSVARS32.BAT instead.
  426. This needs to be done prior to running NMAKE, and the changes are only
  427. valid for the current DOS session.
  428. * What is special about OpenSSL on Redhat?
  429. Red Hat Linux (release 7.0 and later) include a preinstalled limited
  430. version of OpenSSL. For patent reasons, support for IDEA, RC5 and MDC2
  431. is disabled in this version. The same may apply to other Linux distributions.
  432. Users may therefore wish to install more or all of the features left out.
  433. To do this you MUST ensure that you do not overwrite the openssl that is in
  434. /usr/bin on your Red Hat machine. Several packages depend on this file,
  435. including sendmail and ssh. /usr/local/bin is a good alternative choice. The
  436. libraries that come with Red Hat 7.0 onwards have different names and so are
  437. not affected. (eg For Red Hat 7.2 they are /lib/libssl.so.0.9.6b and
  438. /lib/libcrypto.so.0.9.6b with symlinks /lib/libssl.so.2 and
  439. /lib/libcrypto.so.2 respectively).
  440. Please note that we have been advised by Red Hat attempting to recompile the
  441. openssl rpm with all the cryptography enabled will not work. All other
  442. packages depend on the original Red Hat supplied openssl package. It is also
  443. worth noting that due to the way Red Hat supplies its packages, updates to
  444. openssl on each distribution never change the package version, only the
  445. build number. For example, on Red Hat 7.1, the latest openssl package has
  446. version number 0.9.6 and build number 9 even though it contains all the
  447. relevant updates in packages up to and including 0.9.6b.
  448. A possible way around this is to persuade Red Hat to produce a non-US
  449. version of Red Hat Linux.
  450. FYI: Patent numbers and expiry dates of US patents:
  451. MDC-2: 4,908,861 13/03/2007
  452. IDEA: 5,214,703 25/05/2010
  453. RC5: 5,724,428 03/03/2015
  454. * Why does the OpenSSL compilation fail on MacOS X?
  455. If the failure happens when trying to build the "openssl" binary, with
  456. a large number of undefined symbols, it's very probable that you have
  457. OpenSSL 0.9.6b delivered with the operating system (you can find out by
  458. running '/usr/bin/openssl version') and that you were trying to build
  459. OpenSSL 0.9.7 or newer. The problem is that the loader ('ld') in
  460. MacOS X has a misfeature that's quite difficult to go around.
  461. Look in the file PROBLEMS for a more detailed explanation and for possible
  462. solutions.
  463. * Why does the OpenSSL test suite fail on MacOS X?
  464. If the failure happens when running 'make test' and the RC4 test fails,
  465. it's very probable that you have OpenSSL 0.9.6b delivered with the
  466. operating system (you can find out by running '/usr/bin/openssl version')
  467. and that you were trying to build OpenSSL 0.9.6d. The problem is that
  468. the loader ('ld') in MacOS X has a misfeature that's quite difficult to
  469. go around and has linked the programs "openssl" and the test programs
  470. with /usr/lib/libcrypto.dylib and /usr/lib/libssl.dylib instead of the
  471. libraries you just built.
  472. Look in the file PROBLEMS for a more detailed explanation and for possible
  473. solutions.
  474. * Why does the OpenSSL test suite fail in BN_sqr test [on a 64-bit platform]?
  475. Failure in BN_sqr test is most likely caused by a failure to configure the
  476. toolkit for current platform or lack of support for the platform in question.
  477. Run './config -t' and './apps/openssl version -p'. Do these platform
  478. identifiers match? If they don't, then you most likely failed to run
  479. ./config and you're hereby advised to do so before filing a bug report.
  480. If ./config itself fails to run, then it's most likely problem with your
  481. local environment and you should turn to your system administrator (or
  482. similar). If identifiers match (and/or no alternative identifier is
  483. suggested by ./config script), then the platform is unsupported. There might
  484. or might not be a workaround. Most notably on SPARC64 platforms with GNU
  485. C compiler you should be able to produce a working build by running
  486. './config -m32'. I understand that -m32 might not be what you want/need,
  487. but the build should be operational. For further details turn to
  488. <openssl-dev@openssl.org>.
  489. * Why does OpenBSD-i386 build fail on des-586.s with "Unimplemented segment type"?
  490. As of 0.9.7 assembler routines were overhauled for position independence
  491. of the machine code, which is essential for shared library support. For
  492. some reason OpenBSD is equipped with an out-of-date GNU assembler which
  493. finds the new code offensive. To work around the problem, configure with
  494. no-asm (and sacrifice a great deal of performance) or patch your assembler
  495. according to <URL: http://www.openssl.org/~appro/gas-1.92.3.OpenBSD.patch>.
  496. For your convenience a pre-compiled replacement binary is provided at
  497. <URL: http://www.openssl.org/~appro/gas-1.92.3.static.aout.bin>.
  498. Reportedly elder *BSD a.out platforms also suffer from this problem and
  499. remedy should be same. Provided binary is statically linked and should be
  500. working across wider range of *BSD branches, not just OpenBSD.
  501. * Why does the OpenSSL test suite fail in sha512t on x86 CPU?
  502. If the test program in question fails withs SIGILL, Illegal Instruction
  503. exception, then you more than likely to run SSE2-capable CPU, such as
  504. Intel P4, under control of kernel which does not support SSE2
  505. instruction extentions. See accompanying INSTALL file and
  506. OPENSSL_ia32cap(3) documentation page for further information.
  507. * Why does compiler fail to compile sha512.c?
  508. OpenSSL SHA-512 implementation depends on compiler support for 64-bit
  509. integer type. Few elder compilers [ULTRIX cc, SCO compiler to mention a
  510. couple] lack support for this and therefore are incapable of compiling
  511. the module in question. The recommendation is to disable SHA-512 by
  512. adding no-sha512 to ./config [or ./Configure] command line. Another
  513. possible alternative might be to switch to GCC.
  514. * Test suite still fails, what to do?
  515. Another common reason for failure to complete some particular test is
  516. simply bad code generated by a buggy component in toolchain or deficiency
  517. in run-time environment. There are few cases documented in PROBLEMS file,
  518. consult it for possible workaround before you beat the drum. Even if you
  519. don't find solution or even mention there, do reserve for possibility of
  520. a compiler bug. Compiler bugs might appear in rather bizarre ways, they
  521. never make sense, and tend to emerge when you least expect them. In order
  522. to identify one, drop optimization level, e.g. by editing CFLAG line in
  523. top-level Makefile, recompile and re-run the test.
  524. * I think I've found a bug, what should I do?
  525. If you are a new user then it is quite likely you haven't found a bug and
  526. something is happening you aren't familiar with. Check this FAQ, the associated
  527. documentation and the mailing lists for similar queries. If you are still
  528. unsure whether it is a bug or not submit a query to the openssl-users mailing
  529. list.
  530. * I'm SURE I've found a bug, how do I report it?
  531. Bug reports with no security implications should be sent to the request
  532. tracker. This can be done by mailing the report to <rt@openssl.org> (or its
  533. alias <openssl-bugs@openssl.org>), please note that messages sent to the
  534. request tracker also appear in the public openssl-dev mailing list.
  535. The report should be in plain text. Any patches should be sent as
  536. plain text attachments because some mailers corrupt patches sent inline.
  537. If your issue affects multiple versions of OpenSSL check any patches apply
  538. cleanly and, if possible include patches to each affected version.
  539. The report should be given a meaningful subject line briefly summarising the
  540. issue. Just "bug in OpenSSL" or "bug in OpenSSL 0.9.8n" is not very helpful.
  541. By sending reports to the request tracker the bug can then be given a priority
  542. and assigned to the appropriate maintainer. The history of discussions can be
  543. accessed and if the issue has been addressed or a reason why not. If patches
  544. are only sent to openssl-dev they can be mislaid if a team member has to
  545. wade through months of old messages to review the discussion.
  546. See also <URL: http://www.openssl.org/support/rt.html>
  547. * I've found a security issue, how do I report it?
  548. If you think your bug has security implications then please send it to
  549. openssl-security@openssl.org if you don't get a prompt reply at least
  550. acknowledging receipt then resend or mail it directly to one of the
  551. more active team members (e.g. Steve).
  552. [PROG] ========================================================================
  553. * Is OpenSSL thread-safe?
  554. Yes (with limitations: an SSL connection may not concurrently be used
  555. by multiple threads). On Windows and many Unix systems, OpenSSL
  556. automatically uses the multi-threaded versions of the standard
  557. libraries. If your platform is not one of these, consult the INSTALL
  558. file.
  559. Multi-threaded applications must provide two callback functions to
  560. OpenSSL by calling CRYPTO_set_locking_callback() and
  561. CRYPTO_set_id_callback(), for all versions of OpenSSL up to and
  562. including 0.9.8[abc...]. As of version 1.0.0, CRYPTO_set_id_callback()
  563. and associated APIs are deprecated by CRYPTO_THREADID_set_callback()
  564. and friends. This is described in the threads(3) manpage.
  565. * I've compiled a program under Windows and it crashes: why?
  566. This is usually because you've missed the comment in INSTALL.W32.
  567. Your application must link against the same version of the Win32
  568. C-Runtime against which your openssl libraries were linked. The
  569. default version for OpenSSL is /MD - "Multithreaded DLL".
  570. If you are using Microsoft Visual C++'s IDE (Visual Studio), in
  571. many cases, your new project most likely defaulted to "Debug
  572. Singlethreaded" - /ML. This is NOT interchangeable with /MD and your
  573. program will crash, typically on the first BIO related read or write
  574. operation.
  575. For each of the six possible link stage configurations within Win32,
  576. your application must link against the same by which OpenSSL was
  577. built. If you are using MS Visual C++ (Studio) this can be changed
  578. by:
  579. 1. Select Settings... from the Project Menu.
  580. 2. Select the C/C++ Tab.
  581. 3. Select "Code Generation from the "Category" drop down list box
  582. 4. Select the Appropriate library (see table below) from the "Use
  583. run-time library" drop down list box. Perform this step for both
  584. your debug and release versions of your application (look at the
  585. top left of the settings panel to change between the two)
  586. Single Threaded /ML - MS VC++ often defaults to
  587. this for the release
  588. version of a new project.
  589. Debug Single Threaded /MLd - MS VC++ often defaults to
  590. this for the debug version
  591. of a new project.
  592. Multithreaded /MT
  593. Debug Multithreaded /MTd
  594. Multithreaded DLL /MD - OpenSSL defaults to this.
  595. Debug Multithreaded DLL /MDd
  596. Note that debug and release libraries are NOT interchangeable. If you
  597. built OpenSSL with /MD your application must use /MD and cannot use /MDd.
  598. As per 0.9.8 the above limitation is eliminated for .DLLs. OpenSSL
  599. .DLLs compiled with some specific run-time option [we insist on the
  600. default /MD] can be deployed with application compiled with different
  601. option or even different compiler. But there is a catch! Instead of
  602. re-compiling OpenSSL toolkit, as you would have to with prior versions,
  603. you have to compile small C snippet with compiler and/or options of
  604. your choice. The snippet gets installed as
  605. <install-root>/include/openssl/applink.c and should be either added to
  606. your application project or simply #include-d in one [and only one]
  607. of your application source files. Failure to link this shim module
  608. into your application manifests itself as fatal "no OPENSSL_Applink"
  609. run-time error. An explicit reminder is due that in this situation
  610. [mixing compiler options] it is as important to add CRYPTO_malloc_init
  611. prior first call to OpenSSL.
  612. * How do I read or write a DER encoded buffer using the ASN1 functions?
  613. You have two options. You can either use a memory BIO in conjunction
  614. with the i2d_*_bio() or d2i_*_bio() functions or you can use the
  615. i2d_*(), d2i_*() functions directly. Since these are often the
  616. cause of grief here are some code fragments using PKCS7 as an example:
  617. unsigned char *buf, *p;
  618. int len;
  619. len = i2d_PKCS7(p7, NULL);
  620. buf = OPENSSL_malloc(len); /* or Malloc, error checking omitted */
  621. p = buf;
  622. i2d_PKCS7(p7, &p);
  623. At this point buf contains the len bytes of the DER encoding of
  624. p7.
  625. The opposite assumes we already have len bytes in buf:
  626. unsigned char *p;
  627. p = buf;
  628. p7 = d2i_PKCS7(NULL, &p, len);
  629. At this point p7 contains a valid PKCS7 structure of NULL if an error
  630. occurred. If an error occurred ERR_print_errors(bio) should give more
  631. information.
  632. The reason for the temporary variable 'p' is that the ASN1 functions
  633. increment the passed pointer so it is ready to read or write the next
  634. structure. This is often a cause of problems: without the temporary
  635. variable the buffer pointer is changed to point just after the data
  636. that has been read or written. This may well be uninitialized data
  637. and attempts to free the buffer will have unpredictable results
  638. because it no longer points to the same address.
  639. * OpenSSL uses DER but I need BER format: does OpenSSL support BER?
  640. The short answer is yes, because DER is a special case of BER and OpenSSL
  641. ASN1 decoders can process BER.
  642. The longer answer is that ASN1 structures can be encoded in a number of
  643. different ways. One set of ways is the Basic Encoding Rules (BER) with various
  644. permissible encodings. A restriction of BER is the Distinguished Encoding
  645. Rules (DER): these uniquely specify how a given structure is encoded.
  646. Therefore, because DER is a special case of BER, DER is an acceptable encoding
  647. for BER.
  648. * I've tried using <M_some_evil_pkcs12_macro> and I get errors why?
  649. This usually happens when you try compiling something using the PKCS#12
  650. macros with a C++ compiler. There is hardly ever any need to use the
  651. PKCS#12 macros in a program, it is much easier to parse and create
  652. PKCS#12 files using the PKCS12_parse() and PKCS12_create() functions
  653. documented in doc/openssl.txt and with examples in demos/pkcs12. The
  654. 'pkcs12' application has to use the macros because it prints out
  655. debugging information.
  656. * I've called <some function> and it fails, why?
  657. Before submitting a report or asking in one of the mailing lists, you
  658. should try to determine the cause. In particular, you should call
  659. ERR_print_errors() or ERR_print_errors_fp() after the failed call
  660. and see if the message helps. Note that the problem may occur earlier
  661. than you think -- you should check for errors after every call where
  662. it is possible, otherwise the actual problem may be hidden because
  663. some OpenSSL functions clear the error state.
  664. * I just get a load of numbers for the error output, what do they mean?
  665. The actual format is described in the ERR_print_errors() manual page.
  666. You should call the function ERR_load_crypto_strings() before hand and
  667. the message will be output in text form. If you can't do this (for example
  668. it is a pre-compiled binary) you can use the errstr utility on the error
  669. code itself (the hex digits after the second colon).
  670. * Why do I get errors about unknown algorithms?
  671. The cause is forgetting to load OpenSSL's table of algorithms with
  672. OpenSSL_add_all_algorithms(). See the manual page for more information. This
  673. can cause several problems such as being unable to read in an encrypted
  674. PEM file, unable to decrypt a PKCS#12 file or signature failure when
  675. verifying certificates.
  676. * Why can't the OpenSSH configure script detect OpenSSL?
  677. Several reasons for problems with the automatic detection exist.
  678. OpenSSH requires at least version 0.9.5a of the OpenSSL libraries.
  679. Sometimes the distribution has installed an older version in the system
  680. locations that is detected instead of a new one installed. The OpenSSL
  681. library might have been compiled for another CPU or another mode (32/64 bits).
  682. Permissions might be wrong.
  683. The general answer is to check the config.log file generated when running
  684. the OpenSSH configure script. It should contain the detailed information
  685. on why the OpenSSL library was not detected or considered incompatible.
  686. * Can I use OpenSSL's SSL library with non-blocking I/O?
  687. Yes; make sure to read the SSL_get_error(3) manual page!
  688. A pitfall to avoid: Don't assume that SSL_read() will just read from
  689. the underlying transport or that SSL_write() will just write to it --
  690. it is also possible that SSL_write() cannot do any useful work until
  691. there is data to read, or that SSL_read() cannot do anything until it
  692. is possible to send data. One reason for this is that the peer may
  693. request a new TLS/SSL handshake at any time during the protocol,
  694. requiring a bi-directional message exchange; both SSL_read() and
  695. SSL_write() will try to continue any pending handshake.
  696. * Why doesn't my server application receive a client certificate?
  697. Due to the TLS protocol definition, a client will only send a certificate,
  698. if explicitly asked by the server. Use the SSL_VERIFY_PEER flag of the
  699. SSL_CTX_set_verify() function to enable the use of client certificates.
  700. * Why does compilation fail due to an undefined symbol NID_uniqueIdentifier?
  701. For OpenSSL 0.9.7 the OID table was extended and corrected. In earlier
  702. versions, uniqueIdentifier was incorrectly used for X.509 certificates.
  703. The correct name according to RFC2256 (LDAP) is x500UniqueIdentifier.
  704. Change your code to use the new name when compiling against OpenSSL 0.9.7.
  705. * I think I've detected a memory leak, is this a bug?
  706. In most cases the cause of an apparent memory leak is an OpenSSL internal table
  707. that is allocated when an application starts up. Since such tables do not grow
  708. in size over time they are harmless.
  709. These internal tables can be freed up when an application closes using various
  710. functions. Currently these include following:
  711. Thread-local cleanup functions:
  712. ERR_remove_state()
  713. Application-global cleanup functions that are aware of usage (and therefore
  714. thread-safe):
  715. ENGINE_cleanup() and CONF_modules_unload()
  716. "Brutal" (thread-unsafe) Application-global cleanup functions:
  717. ERR_free_strings(), EVP_cleanup() and CRYPTO_cleanup_all_ex_data().
  718. * Why does Valgrind complain about the use of uninitialized data?
  719. When OpenSSL's PRNG routines are called to generate random numbers the supplied
  720. buffer contents are mixed into the entropy pool: so it technically does not
  721. matter whether the buffer is initialized at this point or not. Valgrind (and
  722. other test tools) will complain about this. When using Valgrind, make sure the
  723. OpenSSL library has been compiled with the PURIFY macro defined (-DPURIFY)
  724. to get rid of these warnings.
  725. * Why doesn't a memory BIO work when a file does?
  726. This can occur in several cases for example reading an S/MIME email message.
  727. The reason is that a memory BIO can do one of two things when all the data
  728. has been read from it.
  729. The default behaviour is to indicate that no more data is available and that
  730. the call should be retried, this is to allow the application to fill up the BIO
  731. again if necessary.
  732. Alternatively it can indicate that no more data is available and that EOF has
  733. been reached.
  734. If a memory BIO is to behave in the same way as a file this second behaviour
  735. is needed. This must be done by calling:
  736. BIO_set_mem_eof_return(bio, 0);
  737. See the manual pages for more details.
  738. * Where are the declarations and implementations of d2i_X509() etc?
  739. These are defined and implemented by macros of the form:
  740. DECLARE_ASN1_FUNCTIONS(X509) and IMPLEMENT_ASN1_FUNCTIONS(X509)
  741. The implementation passes an ASN1 "template" defining the structure into an
  742. ASN1 interpreter using generalised functions such as ASN1_item_d2i().
  743. ===============================================================================