From 9a1e34e5deab94717758384d76a20b39ec9ed030 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Sun, 19 Dec 1999 16:07:19 +0000 Subject: MacOS updates. --- crypto/des/enc_writ.c | 7 +++++-- crypto/md32_common.h | 7 ++++++- crypto/objects/obj_dat.c | 6 +----- crypto/rand/md_rand.c | 6 +++--- crypto/ripemd/rmd_one.c | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) (limited to 'crypto') diff --git a/crypto/des/enc_writ.c b/crypto/des/enc_writ.c index ba3f0822ef..8ded146f8b 100644 --- a/crypto/des/enc_writ.c +++ b/crypto/des/enc_writ.c @@ -153,12 +153,15 @@ int des_enc_write(int fd, const void *_buf, int len, { /* eay 26/08/92 I was not doing writing from where we * got upto. */ - i=write(fd,&(outbuf[j]),outnum-j); + i=write(fd,(void *)&(outbuf[j]),outnum-j); if (i == -1) { +#ifdef EINTR if (errno == EINTR) i=0; - else /* This is really a bad error - very bad + else +#endif + /* This is really a bad error - very bad * It will stuff-up both ends. */ return(-1); } diff --git a/crypto/md32_common.h b/crypto/md32_common.h index 5e62d40523..8d9059f95a 100644 --- a/crypto/md32_common.h +++ b/crypto/md32_common.h @@ -182,7 +182,12 @@ # if defined(_MSC_VER) # define ROTATE(a,n) _lrotl(a,n) # elif defined(__MWERKS__) -# define ROTATE(a,n) __rol(a,n) +# ifdef __POWERPC__ +# defined ROTATE(a,n) __rlwinm(a,n,0,31) +# else +# define ROTATE(a,n) __rol(a,n) +# endif + B # elif defined(__GNUC__) && __GNUC__>=2 && !defined(NO_ASM) /* * Some GNU C inline assembler templates. Note that these are diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index d47b874399..aa5c50e5cc 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -214,16 +214,12 @@ int OBJ_new_nid(int num) int OBJ_add_object(ASN1_OBJECT *obj) { ASN1_OBJECT *o; - ADDED_OBJ *ao[4],*aop; + ADDED_OBJ *ao[4]={NULL,NULL,NULL,NULL},*aop; int i; if (added == NULL) if (!init_added()) return(0); if ((o=OBJ_dup(obj)) == NULL) goto err; - ao[ADDED_DATA]=NULL; - ao[ADDED_SNAME]=NULL; - ao[ADDED_LNAME]=NULL; - ao[ADDED_NID]=NULL; ao[ADDED_NID]=(ADDED_OBJ *)Malloc(sizeof(ADDED_OBJ)); if ((o->length != 0) && (obj->data != NULL)) ao[ADDED_DATA]=(ADDED_OBJ *)Malloc(sizeof(ADDED_OBJ)); diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c index 729484fe92..98ad429c68 100644 --- a/crypto/rand/md_rand.c +++ b/crypto/rand/md_rand.c @@ -286,7 +286,7 @@ static void ssleay_rand_bytes(unsigned char *buf, int num) MD_CTX m; static int init=1; unsigned long l; -#ifndef MSDOS +#ifndef GETPID_IS_MEANINGLESS pid_t curr_pid = getpid(); #endif #ifdef DEVRANDOM @@ -327,7 +327,7 @@ static void ssleay_rand_bytes(unsigned char *buf, int num) /* put in some default random data, we need more than * just this */ RAND_seed(&m,sizeof(m)); -#ifndef MSDOS +#ifndef GETPID_IS_MEANINGLESS l=curr_pid; RAND_seed(&l,sizeof(l)); l=getuid(); @@ -386,7 +386,7 @@ static void ssleay_rand_bytes(unsigned char *buf, int num) j=(num >= MD_DIGEST_LENGTH/2)?MD_DIGEST_LENGTH/2:num; num-=j; MD_Init(&m); -#ifndef MSDOS +#ifndef GETPID_IS_MEANINGLESS if (curr_pid) /* just in the first iteration to save time */ { MD_Update(&m,(unsigned char*)&curr_pid,sizeof curr_pid); diff --git a/crypto/ripemd/rmd_one.c b/crypto/ripemd/rmd_one.c index cbc6132bc7..3d08499352 100644 --- a/crypto/ripemd/rmd_one.c +++ b/crypto/ripemd/rmd_one.c @@ -57,7 +57,7 @@ */ #include -#include +#include #include unsigned char *RIPEMD160(unsigned char *d, unsigned long n, -- cgit v1.2.3