Hello!

Since 5.2 AIX supports /dev/random and /dev/urandom. Openssl don't use it
because the select
system call works different on AIX than on linux.

As described in the following URL, the select system call expects the
number
of file describtors as first parameter in AIX. Linux expects the highst
numbered
fd +1.

http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/libs/commtrf1/select.htm


So I made a #ifdef and hardcoded the first parameter to 1 for AIX. I'm not
sure
if this will have any side effects, especially for versions < 5.2 but I
don't
think so.

The attached patch will do the change on the file
openssl-0.9.7a/crypto/rand/rand_unix.c.
Anders Liljegren tested it also on AIX 5.2 and found no problems.

Bye

      Andreas Walter


diff -u openssl-0.9.7a/crypto/rand/rand_unix.c-orig
openssl-0.9.7a/crypto/rand/rand_unix.c
--- openssl-0.9.7a/crypto/rand/rand_unix.c-orig 2003-03-28
14:23:01.000000000 +0100
+++ openssl-0.9.7a/crypto/rand/rand_unix.c      2003-03-28
14:45:19.000000000 +0100
@@ -170,7 +170,14 @@
                                FD_SET(fd, &fset);
                                r = -1;

+#ifdef AIX /* First paramater on AIX Specifies the number of file
descriptors and message
+            * queues to check. See also:
+            *
http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/libs/commtrf1/select.htm
+            */
+                                       if (select(1,&fset,NULL,NULL,&t) <
0)
+#else
                                if (select(fd+1,&fset,NULL,NULL,&t) < 0)
+#endif
                                        t.tv_usec=0;
                                else if (FD_ISSET(fd, &fset))
                                        {



______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to