Recent openssl is required for OPENSSL_free [Re: Please test snapshots for 3.0 release] (fwd)

Damien Miller djm at mindrot.org
Wed Oct 31 10:36:04 EST 2001


On Tue, 30 Oct 2001, Lutz Jaenicke wrote:

> Hmm, while thinking about it: the correct macro substution should therefore
> be "Free()" instead of "free()", as we must make sure that the correct
> memory handling function (CRYPTO_free()) is being called:

That is (as the OpenSSL developers discovered) a namespace collision 
waiting to happen. Can people try this patch?

Index: defines.h
===================================================================
RCS file: /var/cvs/openssh/defines.h,v
retrieving revision 1.74
diff -u -r1.74 defines.h
--- defines.h	2001/10/30 02:50:40	1.74
+++ defines.h	2001/10/30 23:35:22
@@ -45,6 +45,7 @@
 #include <unistd.h> /* For STDIN_FILENO, etc */
 #include <termios.h> /* Struct winsize */
 #include <fcntl.h> /* For O_NONBLOCK */
+#include <openssl/opensslv.h> /* For OPENSSL_VERSION_NUMBER */
 
 /* *-*-nto-qnx needs these headers for strcasecmp and LASTLOG_FILE respectively */
 #ifdef HAVE_STRINGS_H
@@ -448,6 +449,11 @@
 
 #ifndef GETPGRP_VOID
 # define getpgrp() getpgrp(0)
+#endif
+
+/* OPENSSL_free() is only available in OpenSSL 0.9.6 onwards */
+#if !defined(OPENSSL_VERSION_NUMBER) || (OPENSSL_VERSION_NUMBER < 0x0090600f)
+# define OPENSSL_free(x) Free(x)
 #endif
 
 /*


-- 
| By convention there is color,       \\ Damien Miller <djm at mindrot.org>
| By convention sweetness, By convention bitterness, \\ www.mindrot.org
| But in reality there are atoms and space - Democritus (c. 400 BCE)




More information about the openssh-unix-dev mailing list