MacOS updates.
This commit is contained in:
parent
2b6313d0da
commit
9a1e34e5de
@ -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
|
/* eay 26/08/92 I was not doing writing from where we
|
||||||
* got upto. */
|
* got upto. */
|
||||||
i=write(fd,&(outbuf[j]),outnum-j);
|
i=write(fd,(void *)&(outbuf[j]),outnum-j);
|
||||||
if (i == -1)
|
if (i == -1)
|
||||||
{
|
{
|
||||||
|
#ifdef EINTR
|
||||||
if (errno == EINTR)
|
if (errno == EINTR)
|
||||||
i=0;
|
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. */
|
* It will stuff-up both ends. */
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,12 @@
|
|||||||
# if defined(_MSC_VER)
|
# if defined(_MSC_VER)
|
||||||
# define ROTATE(a,n) _lrotl(a,n)
|
# define ROTATE(a,n) _lrotl(a,n)
|
||||||
# elif defined(__MWERKS__)
|
# elif defined(__MWERKS__)
|
||||||
|
# ifdef __POWERPC__
|
||||||
|
# defined ROTATE(a,n) __rlwinm(a,n,0,31)
|
||||||
|
# else
|
||||||
# define ROTATE(a,n) __rol(a,n)
|
# define ROTATE(a,n) __rol(a,n)
|
||||||
|
# endif
|
||||||
|
B
|
||||||
# elif defined(__GNUC__) && __GNUC__>=2 && !defined(NO_ASM)
|
# elif defined(__GNUC__) && __GNUC__>=2 && !defined(NO_ASM)
|
||||||
/*
|
/*
|
||||||
* Some GNU C inline assembler templates. Note that these are
|
* Some GNU C inline assembler templates. Note that these are
|
||||||
|
@ -214,16 +214,12 @@ int OBJ_new_nid(int num)
|
|||||||
int OBJ_add_object(ASN1_OBJECT *obj)
|
int OBJ_add_object(ASN1_OBJECT *obj)
|
||||||
{
|
{
|
||||||
ASN1_OBJECT *o;
|
ASN1_OBJECT *o;
|
||||||
ADDED_OBJ *ao[4],*aop;
|
ADDED_OBJ *ao[4]={NULL,NULL,NULL,NULL},*aop;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (added == NULL)
|
if (added == NULL)
|
||||||
if (!init_added()) return(0);
|
if (!init_added()) return(0);
|
||||||
if ((o=OBJ_dup(obj)) == NULL) goto err;
|
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));
|
ao[ADDED_NID]=(ADDED_OBJ *)Malloc(sizeof(ADDED_OBJ));
|
||||||
if ((o->length != 0) && (obj->data != NULL))
|
if ((o->length != 0) && (obj->data != NULL))
|
||||||
ao[ADDED_DATA]=(ADDED_OBJ *)Malloc(sizeof(ADDED_OBJ));
|
ao[ADDED_DATA]=(ADDED_OBJ *)Malloc(sizeof(ADDED_OBJ));
|
||||||
|
@ -286,7 +286,7 @@ static void ssleay_rand_bytes(unsigned char *buf, int num)
|
|||||||
MD_CTX m;
|
MD_CTX m;
|
||||||
static int init=1;
|
static int init=1;
|
||||||
unsigned long l;
|
unsigned long l;
|
||||||
#ifndef MSDOS
|
#ifndef GETPID_IS_MEANINGLESS
|
||||||
pid_t curr_pid = getpid();
|
pid_t curr_pid = getpid();
|
||||||
#endif
|
#endif
|
||||||
#ifdef DEVRANDOM
|
#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
|
/* put in some default random data, we need more than
|
||||||
* just this */
|
* just this */
|
||||||
RAND_seed(&m,sizeof(m));
|
RAND_seed(&m,sizeof(m));
|
||||||
#ifndef MSDOS
|
#ifndef GETPID_IS_MEANINGLESS
|
||||||
l=curr_pid;
|
l=curr_pid;
|
||||||
RAND_seed(&l,sizeof(l));
|
RAND_seed(&l,sizeof(l));
|
||||||
l=getuid();
|
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;
|
j=(num >= MD_DIGEST_LENGTH/2)?MD_DIGEST_LENGTH/2:num;
|
||||||
num-=j;
|
num-=j;
|
||||||
MD_Init(&m);
|
MD_Init(&m);
|
||||||
#ifndef MSDOS
|
#ifndef GETPID_IS_MEANINGLESS
|
||||||
if (curr_pid) /* just in the first iteration to save time */
|
if (curr_pid) /* just in the first iteration to save time */
|
||||||
{
|
{
|
||||||
MD_Update(&m,(unsigned char*)&curr_pid,sizeof curr_pid);
|
MD_Update(&m,(unsigned char*)&curr_pid,sizeof curr_pid);
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <memory.h>
|
#include <string.h>
|
||||||
#include <openssl/ripemd.h>
|
#include <openssl/ripemd.h>
|
||||||
|
|
||||||
unsigned char *RIPEMD160(unsigned char *d, unsigned long n,
|
unsigned char *RIPEMD160(unsigned char *d, unsigned long n,
|
||||||
|
12
e_os.h
12
e_os.h
@ -88,6 +88,8 @@ extern "C" {
|
|||||||
# define NO_SYS_TYPES_H
|
# define NO_SYS_TYPES_H
|
||||||
# define NO_CHMOD
|
# define NO_CHMOD
|
||||||
# define NO_SYSLOG
|
# define NO_SYSLOG
|
||||||
|
# undef DEVRANDOM
|
||||||
|
# define GETPID_IS_MEANINGLESS
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -111,6 +113,10 @@ extern "C" {
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(MSDOS) && !defined(GETPID_IS_MEANINGLESS)
|
||||||
|
# define GETPID_IS_MEANINGLESS
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define get_last_sys_error() GetLastError()
|
#define get_last_sys_error() GetLastError()
|
||||||
#define clear_sys_error() SetLastError(0)
|
#define clear_sys_error() SetLastError(0)
|
||||||
@ -128,7 +134,7 @@ extern "C" {
|
|||||||
#define readsocket(s,b,n) recv((s),(b),(n),0)
|
#define readsocket(s,b,n) recv((s),(b),(n),0)
|
||||||
#define writesocket(s,b,n) send((s),(b),(n),0)
|
#define writesocket(s,b,n) send((s),(b),(n),0)
|
||||||
#define EADDRINUSE WSAEADDRINUSE
|
#define EADDRINUSE WSAEADDRINUSE
|
||||||
#elif MAC_OS_pre_X
|
#elif defined(MAC_OS_pre_X)
|
||||||
#define get_last_socket_error() errno
|
#define get_last_socket_error() errno
|
||||||
#define clear_socket_error() errno=0
|
#define clear_socket_error() errno=0
|
||||||
#define closesocket(s) MacSocket_close(s)
|
#define closesocket(s) MacSocket_close(s)
|
||||||
@ -245,8 +251,10 @@ extern "C" {
|
|||||||
# endif
|
# endif
|
||||||
# else
|
# else
|
||||||
/* !defined VMS */
|
/* !defined VMS */
|
||||||
# include OPENSSL_UNISTD
|
# include OPENSLL_UNISTD
|
||||||
|
# ifndef NO_SYS_TYPES_H
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
|
# endif
|
||||||
|
|
||||||
# define OPENSSL_CONF "openssl.cnf"
|
# define OPENSSL_CONF "openssl.cnf"
|
||||||
# define SSLEAY_CONF OPENSSL_CONF
|
# define SSLEAY_CONF OPENSSL_CONF
|
||||||
|
Loading…
x
Reference in New Issue
Block a user