Okay, as a first step toward getting my Mac changes into OpenSSL, here
are the diffs I've made wrt to clean 0.9.4 install.
Next, I'm packaging up some notes and code for Mac people who are
interested in using OpenSSL. Is there an FTP drop box I can place these?
It'll be a little large for emailing to the list....
The other question is what sort of legal mumbo jumbo I ought to put at
the start of my Mac code files. I'd like to make my code as free as
OpenSSL. Any thoughts, folks?
Anyway, here are the diffs. They're really not as significant as they
seem-- there are a bunch of diffs here just because I indented some
other code when I added #ifdef's.
-Roy
Only in openssl-0.9.4: Makefile
Only in openssl-0.9.4/apps: Makefile
Only in openssl-0.9.4/apps: md5.c
Only in openssl-0.9.4/apps: rmd160.c
Only in openssl-0.9.4/crypto: Makefile
Only in openssl-0.9.4/crypto/asn1: Makefile
diff -u -r openssl-0.9.4/crypto/asn1/a_digest.c
openssl-0.9.4.Macintosh/crypto/asn1/a_digest.c
--- openssl-0.9.4/crypto/asn1/a_digest.c Sun Aug 8 07:25:31 1999
+++ openssl-0.9.4.Macintosh/crypto/asn1/a_digest.c Mon Aug 23 06:24:05
1999
@@ -58,8 +58,11 @@
#include <stdio.h>
#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+
+#ifndef macintosh
+# include <sys/types.h>
+# include <sys/stat.h>
+#endif
#include "cryptlib.h"
#include <openssl/evp.h>
diff -u -r openssl-0.9.4/crypto/asn1/a_sign.c
openssl-0.9.4.Macintosh/crypto/asn1/a_sign.c
--- openssl-0.9.4/crypto/asn1/a_sign.c Fri Apr 23 18:08:08 1999
+++ openssl-0.9.4.Macintosh/crypto/asn1/a_sign.c Mon Aug 23 06:24:24 1999
@@ -58,8 +58,11 @@
#include <stdio.h>
#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+
+#ifndef macintosh
+# include <sys/types.h>
+# include <sys/stat.h>
+#endif
#include "cryptlib.h"
#include <openssl/bn.h>
diff -u -r openssl-0.9.4/crypto/asn1/a_verify.c
openssl-0.9.4.Macintosh/crypto/asn1/a_verify.c
--- openssl-0.9.4/crypto/asn1/a_verify.c Fri Apr 23 18:08:08 1999
+++ openssl-0.9.4.Macintosh/crypto/asn1/a_verify.c Mon Aug 23 06:24:34
1999
@@ -58,8 +58,11 @@
#include <stdio.h>
#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+
+#ifndef macintosh
+# include <sys/types.h>
+# include <sys/stat.h>
+#endif
#include "cryptlib.h"
#include <openssl/bn.h>
Only in openssl-0.9.4/crypto/bf: Makefile
Only in openssl-0.9.4/crypto/bio: Makefile
diff -u -r openssl-0.9.4/crypto/bio/bss_sock.c
openssl-0.9.4.Macintosh/crypto/bio/bss_sock.c
--- openssl-0.9.4/crypto/bio/bss_sock.c Mon Apr 26 12:40:58 1999
+++ openssl-0.9.4.Macintosh/crypto/bio/bss_sock.c Mon Aug 23 07:26:28 1999
@@ -60,7 +60,13 @@
#include <stdio.h>
#include <errno.h>
-#define USE_SOCKETS
+
+#ifndef macintosh
+ #define USE_SOCKETS
+#else
+ #include "MacSocket.h"
+#endif
+
#include "cryptlib.h"
#include <openssl/bio.h>
@@ -163,8 +169,12 @@
if (a->init)
{
#ifndef BIO_FD
+ #ifndef macintosh
shutdown(a->num,2);
closesocket(a->num);
+ #else
+ MacSocket_close(a->num);
+ #endif
#else /* BIO_FD */
close(a->num);
#endif
@@ -188,7 +198,15 @@
{
#ifndef BIO_FD
clear_socket_error();
+
+ #ifndef macintosh
ret=readsocket(b->num,out,outl);
+ #else
+ if (MacSocket_recv(b->num,out,outl,&ret,true))
+ {
+ ret = errno;
+ }
+ #endif
#else
clear_sys_error();
ret=read(b->num,out,outl);
@@ -217,7 +235,17 @@
#ifndef BIO_FD
clear_socket_error();
- ret=writesocket(b->num,in,inl);
+
+ #ifndef macintosh
+ ret=writesocket(b->num,in,inl);
+ #else
+ {
+ if (MacSocket_send(b->num,in,inl,&ret))
+ {
+ ret = errno;
+ }
+ }
+ #endif
#else
clear_sys_error();
ret=write(b->num,in,inl);
Only in openssl-0.9.4/crypto/bn: Makefile
Only in openssl-0.9.4/crypto/buffer: Makefile
Only in openssl-0.9.4/crypto/cast: Makefile
Only in openssl-0.9.4/crypto/comp: Makefile
Only in openssl-0.9.4/crypto/conf: Makefile
Only in openssl-0.9.4/crypto/des: Makefile
Only in openssl-0.9.4/crypto/des/asm: perlasm
diff -u -r openssl-0.9.4/crypto/des/enc_read.c
openssl-0.9.4.Macintosh/crypto/des/enc_read.c
--- openssl-0.9.4/crypto/des/enc_read.c Sun May 16 08:25:45 1999
+++ openssl-0.9.4.Macintosh/crypto/des/enc_read.c Mon Aug 23 06:26:46 1999
@@ -147,7 +147,7 @@
/* first - get the length */
while (net_num < HDRSIZE)
{
- i=read(fd,&(net[net_num]),HDRSIZE-net_num);
+ i=read(fd,(char *) &(net[net_num]),HDRSIZE-net_num);
#ifdef EINTR
if ((i == -1) && (errno == EINTR)) continue;
#endif
@@ -169,7 +169,7 @@
net_num=0;
while (net_num < rnum)
{
- i=read(fd,&(net[net_num]),rnum-net_num);
+ i=read(fd,(char *) &(net[net_num]),rnum-net_num);
#ifdef EINTR
if ((i == -1) && (errno == EINTR)) continue;
#endif
diff -u -r openssl-0.9.4/crypto/des/read_pwd.c
openssl-0.9.4.Macintosh/crypto/des/read_pwd.c
--- openssl-0.9.4/crypto/des/read_pwd.c Thu Jul 15 19:47:02 1999
+++ openssl-0.9.4.Macintosh/crypto/des/read_pwd.c Mon Aug 23 06:29:03 1999
@@ -129,6 +129,14 @@
#define SGTTY
#endif
+#ifdef macintosh
+#undef TERMIOS
+#undef TERMIO
+#undef SGTTY
+
+#define TTY_STRUCT int
+#endif
+
#ifdef TERMIOS
#include <termios.h>
#define TTY_STRUCT struct termios
@@ -153,8 +161,8 @@
#define TTY_set(tty,data) ioctl(tty,TIOCSETP,data)
#endif
-#if !defined(_LIBC) && !defined(MSDOS) && !defined(VMS)
-#include <sys/ioctl.h>
+#if !defined(_LIBC) && !defined(MSDOS) && !defined(VMS) &&
!defined(macintosh)
+ #include <sys/ioctl.h>
#endif
#ifdef MSDOS
Only in openssl-0.9.4/crypto/dh: Makefile
Only in openssl-0.9.4/crypto/dsa: Makefile
Only in openssl-0.9.4/crypto/err: Makefile
Only in openssl-0.9.4/crypto/evp: Makefile
Only in openssl-0.9.4/crypto/hmac: Makefile
Only in openssl-0.9.4/crypto/idea: Makefile
Only in openssl-0.9.4/crypto/lhash: Makefile
Only in openssl-0.9.4/crypto/md2: Makefile
Only in openssl-0.9.4/crypto/md5: Makefile
Only in openssl-0.9.4/crypto/mdc2: Makefile
Only in openssl-0.9.4/crypto/objects: Makefile
Only in openssl-0.9.4.Macintosh/crypto/objects: obj_dat.h
Only in openssl-0.9.4/crypto/pem: Makefile
Only in openssl-0.9.4/crypto/pkcs12: Makefile
Only in openssl-0.9.4/crypto/pkcs7: Makefile
Only in openssl-0.9.4/crypto/rand: Makefile
diff -u -r openssl-0.9.4/crypto/rand/md_rand.c
openssl-0.9.4.Macintosh/crypto/rand/md_rand.c
--- openssl-0.9.4/crypto/rand/md_rand.c Fri May 21 07:16:36 1999
+++ openssl-0.9.4.Macintosh/crypto/rand/md_rand.c Mon Aug 23 07:08:22 1999
@@ -57,7 +57,11 @@
*/
#include <stdio.h>
-#include <sys/types.h>
+
+#ifndef macintosh
+# include <sys/types.h>
+#endif
+
#include <time.h>
#include <string.h>
diff -u -r openssl-0.9.4/crypto/rand/rand_lib.c
openssl-0.9.4.Macintosh/crypto/rand/rand_lib.c
--- openssl-0.9.4/crypto/rand/rand_lib.c Fri Apr 23 18:11:52 1999
+++ openssl-0.9.4.Macintosh/crypto/rand/rand_lib.c Mon Aug 23 07:10:51
1999
@@ -57,7 +57,11 @@
*/
#include <stdio.h>
-#include <sys/types.h>
+
+#ifndef macintosh
+# include <sys/types.h>
+#endif
+
#include <time.h>
#include <openssl/rand.h>
diff -u -r openssl-0.9.4/crypto/rand/randfile.c
openssl-0.9.4.Macintosh/crypto/rand/randfile.c
--- openssl-0.9.4/crypto/rand/randfile.c Fri May 21 07:16:36 1999
+++ openssl-0.9.4.Macintosh/crypto/rand/randfile.c Mon Aug 23 07:10:28
1999
@@ -60,9 +60,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/types.h>
+
+#ifdef macintosh
+ #include <stat.h>
+
+#else
+ #include <sys/types.h>
+ #include <sys/stat.h>
+#endif
#include "openssl/e_os.h"
@@ -122,13 +127,20 @@
should be completely harmless on system that have no file
versions. -- Richard Levitte */
out=fopen(file,"rb+");
- if (out == NULL && errno == ENOENT)
+ if (out == NULL
+#ifndef macintosh
+ && errno == ENOENT
+#endif
+ )
+
{
errno = 0;
out=fopen(file,"wb");
}
if (out == NULL) goto err;
+#ifndef macintosh
chmod(file,0600);
+#endif
n=RAND_DATA;
for (;;)
{
Only in openssl-0.9.4/crypto/rc2: Makefile
Only in openssl-0.9.4/crypto/rc4: Makefile
Only in openssl-0.9.4/crypto/rc5: Makefile
Only in openssl-0.9.4/crypto/ripemd: Makefile
Only in openssl-0.9.4/crypto/rsa: Makefile
Only in openssl-0.9.4/crypto/sha: Makefile
Only in openssl-0.9.4/crypto/stack: Makefile
Only in openssl-0.9.4/crypto/txt_db: Makefile
Only in openssl-0.9.4/crypto/x509: Makefile
diff -u -r openssl-0.9.4/crypto/x509/by_dir.c
openssl-0.9.4.Macintosh/crypto/x509/by_dir.c
--- openssl-0.9.4/crypto/x509/by_dir.c Sun May 9 06:12:06 1999
+++ openssl-0.9.4.Macintosh/crypto/x509/by_dir.c Mon Aug 23 07:12:12 1999
@@ -59,8 +59,14 @@
#include <stdio.h>
#include <time.h>
#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+
+#ifdef macintosh
+ #include <stat.h>
+
+#else
+ #include <sys/types.h>
+ #include <sys/stat.h>
+#endif
#include "cryptlib.h"
#include <openssl/lhash.h>
diff -u -r openssl-0.9.4/crypto/x509/by_file.c
openssl-0.9.4.Macintosh/crypto/x509/by_file.c
--- openssl-0.9.4/crypto/x509/by_file.c Wed Jul 21 16:57:12 1999
+++ openssl-0.9.4.Macintosh/crypto/x509/by_file.c Mon Aug 23 07:12:27 1999
@@ -59,8 +59,14 @@
#include <stdio.h>
#include <time.h>
#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+
+#ifdef macintosh
+ #include <stat.h>
+
+#else
+ #include <sys/types.h>
+ #include <sys/stat.h>
+#endif
#include "cryptlib.h"
#include <openssl/lhash.h>
diff -u -r openssl-0.9.4/crypto/x509/x509_cmp.c
openssl-0.9.4.Macintosh/crypto/x509/x509_cmp.c
--- openssl-0.9.4/crypto/x509/x509_cmp.c Sat May 1 13:40:57 1999
+++ openssl-0.9.4.Macintosh/crypto/x509/x509_cmp.c Mon Aug 23 07:12:38
1999
@@ -57,8 +57,15 @@
*/
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+
+#ifdef macintosh
+ #include <stat.h>
+
+#else
+ #include <sys/types.h>
+ #include <sys/stat.h>
+#endif
+
#include "cryptlib.h"
#include <openssl/asn1.h>
#include <openssl/objects.h>
diff -u -r openssl-0.9.4/crypto/x509/x509_d2.c
openssl-0.9.4.Macintosh/crypto/x509/x509_d2.c
--- openssl-0.9.4/crypto/x509/x509_d2.c Sun May 9 06:12:06 1999
+++ openssl-0.9.4.Macintosh/crypto/x509/x509_d2.c Mon Aug 23 07:12:45 1999
@@ -57,8 +57,15 @@
*/
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+
+#ifdef macintosh
+ #include <stat.h>
+
+#else
+ #include <sys/types.h>
+ #include <sys/stat.h>
+#endif
+
#include "cryptlib.h"
#include <openssl/crypto.h>
#include <openssl/x509.h>
diff -u -r openssl-0.9.4/crypto/x509/x509_def.c
openssl-0.9.4.Macintosh/crypto/x509/x509_def.c
--- openssl-0.9.4/crypto/x509/x509_def.c Fri Apr 23 18:12:35 1999
+++ openssl-0.9.4.Macintosh/crypto/x509/x509_def.c Mon Aug 23 07:12:52
1999
@@ -57,8 +57,15 @@
*/
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+
+#ifdef macintosh
+ #include <stat.h>
+
+#else
+ #include <sys/types.h>
+ #include <sys/stat.h>
+#endif
+
#include "cryptlib.h"
#include <openssl/crypto.h>
#include <openssl/x509.h>
diff -u -r openssl-0.9.4/crypto/x509/x509_txt.c
openssl-0.9.4.Macintosh/crypto/x509/x509_txt.c
--- openssl-0.9.4/crypto/x509/x509_txt.c Fri Apr 23 18:12:35 1999
+++ openssl-0.9.4.Macintosh/crypto/x509/x509_txt.c Mon Aug 23 07:13:09
1999
@@ -59,7 +59,10 @@
#include <stdio.h>
#include <time.h>
#include <errno.h>
-#include <sys/types.h>
+
+#ifndef macintosh
+ #include <sys/types.h>
+#endif
#include "cryptlib.h"
#include <openssl/lhash.h>
diff -u -r openssl-0.9.4/crypto/x509/x509_vfy.c
openssl-0.9.4.Macintosh/crypto/x509/x509_vfy.c
--- openssl-0.9.4/crypto/x509/x509_vfy.c Sun Aug 8 10:06:29 1999
+++ openssl-0.9.4.Macintosh/crypto/x509/x509_vfy.c Mon Aug 23 07:13:22
1999
@@ -59,8 +59,15 @@
#include <stdio.h>
#include <time.h>
#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+
+#ifdef macintosh
+ #include <stat.h>
+
+#else
+ #include <sys/types.h>
+ #include <sys/stat.h>
+#endif
+
#include <openssl/crypto.h>
#include "cryptlib.h"
Only in openssl-0.9.4/crypto/x509v3: Makefile
diff -u -r openssl-0.9.4/e_os.h openssl-0.9.4.Macintosh/e_os.h
--- openssl-0.9.4/e_os.h Thu Jun 10 04:12:20 1999
+++ openssl-0.9.4.Macintosh/e_os.h Mon Aug 23 06:19:45 1999
@@ -250,79 +250,81 @@
/*************/
-#ifdef USE_SOCKETS
-# if defined(WINDOWS) || defined(MSDOS)
+#ifndef macintosh
+
+# ifdef USE_SOCKETS
+# if defined(WINDOWS) || defined(MSDOS)
/* windows world */
-# ifdef NO_SOCK
-# define SSLeay_Write(a,b,c) (-1)
-# define SSLeay_Read(a,b,c) (-1)
-# define SHUTDOWN(fd) close(fd)
-# define SHUTDOWN2(fd) close(fd)
-# else
-# include <winsock.h>
+# ifdef NO_SOCK
+# define SSLeay_Write(a,b,c) (-1)
+# define SSLeay_Read(a,b,c) (-1)
+# define SHUTDOWN(fd) close(fd)
+# define SHUTDOWN2(fd) close(fd)
+# else
+# include <winsock.h>
extern HINSTANCE _hInstance;
-# define SSLeay_Write(a,b,c) send((a),(b),(c),0)
-# define SSLeay_Read(a,b,c) recv((a),(b),(c),0)
-# define SHUTDOWN(fd) { shutdown((fd),0); closesocket(fd); }
-# define SHUTDOWN2(fd) { shutdown((fd),2); closesocket(fd); }
-# endif
-
-
-# else
+# define SSLeay_Write(a,b,c) send((a),(b),(c),0)
+# define SSLeay_Read(a,b,c) recv((a),(b),(c),0)
+# define SHUTDOWN(fd) { shutdown((fd),0); closesocket(fd); }
+# define SHUTDOWN2(fd) { shutdown((fd),2); closesocket(fd); }
+# endif
-# include <sys/types.h>
-# ifndef VMS
-# include <sys/param.h>
-# endif
-# include <sys/time.h> /* Needed under linux for FD_XXX */
-# include <netdb.h>
-# if defined(VMS) && !defined(__DECC)
-# include <socket.h>
-# include <in.h>
# else
-# include <sys/socket.h>
-# ifdef FILIO_H
-# include <sys/filio.h> /* Added for FIONBIO under unixware */
+# include <sys/types.h>
+# ifndef VMS
+# include <sys/param.h>
# endif
-# include <netinet/in.h>
-# endif
+# include <sys/time.h> /* Needed under linux for FD_XXX */
-# if defined(NeXT) || defined(_NEXT_SOURCE)
-# include <sys/fcntl.h>
-# include <sys/types.h>
-# endif
+# include <netdb.h>
+# if defined(VMS) && !defined(__DECC)
+# include <socket.h>
+# include <in.h>
+# else
+# include <sys/socket.h>
+# ifdef FILIO_H
+# include <sys/filio.h> /* Added for FIONBIO under unixware */
+# endif
+# include <netinet/in.h>
+# endif
-# ifdef AIX
-# include <sys/select.h>
-# endif
+# if defined(NeXT) || defined(_NEXT_SOURCE)
+# include <sys/fcntl.h>
+# include <sys/types.h>
+# endif
-# if defined(sun)
-# include <sys/filio.h>
-# else
-# ifndef VMS
-# include <sys/ioctl.h>
+# ifdef AIX
+# include <sys/select.h>
+# endif
+
+# if defined(sun)
+# include <sys/filio.h>
# else
- /* ioctl is only in VMS > 7.0 and when socketshr is not used */
-# if !defined(TCPIP_TYPE_SOCKETSHR) && defined(__VMS_VER) &&
(__VMS_VER > 70000000)
+# ifndef VMS
# include <sys/ioctl.h>
+# else
+ /* ioctl is only in VMS > 7.0 and when socketshr is not used */
+# if !defined(TCPIP_TYPE_SOCKETSHR) && defined(__VMS_VER) &&
(__VMS_VER > 70000000)
+# include <sys/ioctl.h>
+# endif
# endif
# endif
-# endif
-# ifdef VMS
-# include <unixio.h>
-# if defined(TCPIP_TYPE_SOCKETSHR)
-# include <socketshr.h>
+# ifdef VMS
+# include <unixio.h>
+# if defined(TCPIP_TYPE_SOCKETSHR)
+# include <socketshr.h>
+# endif
# endif
-# endif
-# define SSLeay_Read(a,b,c) read((a),(b),(c))
-# define SSLeay_Write(a,b,c) write((a),(b),(c))
-# define SHUTDOWN(fd) { shutdown((fd),0); close((fd)); }
-# define SHUTDOWN2(fd) { shutdown((fd),2); close((fd)); }
-# define INVALID_SOCKET (-1)
+# define SSLeay_Read(a,b,c) read((a),(b),(c))
+# define SSLeay_Write(a,b,c) write((a),(b),(c))
+# define SHUTDOWN(fd) { shutdown((fd),0); close((fd)); }
+# define SHUTDOWN2(fd) { shutdown((fd),2); close((fd)); }
+# define INVALID_SOCKET (-1)
+# endif
# endif
#endif
Only in openssl-0.9.4/ms: .rnd
Only in openssl-0.9.4.Macintosh/ms: _rnd
Only in openssl-0.9.4/rsaref: Makefile
Only in openssl-0.9.4/ssl: Makefile
diff -u -r openssl-0.9.4/ssl/ssl_cert.c
openssl-0.9.4.Macintosh/ssl/ssl_cert.c
--- openssl-0.9.4/ssl/ssl_cert.c Sun Aug 8 10:19:44 1999
+++ openssl-0.9.4.Macintosh/ssl/ssl_cert.c Mon Aug 23 06:23:04 1999
@@ -105,8 +105,12 @@
*/
#include <stdio.h>
-#include <sys/types.h>
-#if !defined(WIN32) && !defined(VSM) && !defined(NeXT)
+
+#ifndef macintosh
+# include <sys/types.h>
+#endif
+
+#if !defined(WIN32) && !defined(VSM) && !defined(NeXT) &&
!defined(macintosh)
#include <dirent.h>
#endif
#ifdef NeXT
@@ -671,6 +675,7 @@
#ifndef WIN32
#ifndef VMS /* XXXX This may be fixed in the future */
+#ifndef macintosh
int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
const char *dir)
@@ -712,5 +717,6 @@
return ret;
}
+#endif
#endif
#endif
Only in openssl-0.9.4/test: Makefile
Only in openssl-0.9.4/test: bftest.c
Only in openssl-0.9.4/test: bntest.c
Only in openssl-0.9.4/test: casttest.c
Only in openssl-0.9.4/test: destest.c
Only in openssl-0.9.4/test: dhtest.c
Only in openssl-0.9.4/test: dsatest.c
Only in openssl-0.9.4/test: exptest.c
Only in openssl-0.9.4/test: hmactest.c
Only in openssl-0.9.4/test: ideatest.c
Only in openssl-0.9.4/test: md2test.c
Only in openssl-0.9.4/test: md5test.c
Only in openssl-0.9.4/test: mdc2test.c
Only in openssl-0.9.4/test: randtest.c
Only in openssl-0.9.4/test: rc2test.c
Only in openssl-0.9.4/test: rc4test.c
Only in openssl-0.9.4/test: rc5test.c
Only in openssl-0.9.4/test: rmdtest.c
Only in openssl-0.9.4/test: rsa_oaep_test.c
Only in openssl-0.9.4/test: sha1test.c
Only in openssl-0.9.4/test: shatest.c
Only in openssl-0.9.4/test: ssltest.c
Only in openssl-0.9.4/tools: Makefile
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]