summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2002-02-14 15:37:38 +0000
committerRichard Levitte <levitte@openssl.org>2002-02-14 15:37:38 +0000
commit3e83e686ba2e21a2d7d991446bc6fedde5ff58c0 (patch)
treed8330c1735352c6b85a98a49ef79c97dbd096290 /crypto
parent8f06b003736c957c6e693d3b5dd1393f91a530cd (diff)
Add the configuration target VxWorks.
Diffstat (limited to 'crypto')
-rw-r--r--crypto/bio/bss_bio.c7
-rw-r--r--crypto/bio/bss_log.c2
-rw-r--r--crypto/des/read_pwd.c8
-rw-r--r--crypto/rand/rand_egd.c6
-rw-r--r--crypto/rsa/rsa.h12
-rw-r--r--crypto/tmdiff.c19
-rw-r--r--crypto/ui/ui_openssl.c8
7 files changed, 49 insertions, 13 deletions
diff --git a/crypto/bio/bss_bio.c b/crypto/bio/bss_bio.c
index f666c47f4e..1eeed9e7fe 100644
--- a/crypto/bio/bss_bio.c
+++ b/crypto/bio/bss_bio.c
@@ -23,6 +23,11 @@
#include <openssl/crypto.h>
#include "e_os.h"
+
+/* VxWorks defines SSIZE_MAX with an empty value causing compile errors */
+#if defined(OPENSSL_SYS_VSWORKS)
+# undef SSIZE_MAX
+#endif
#ifndef SSIZE_MAX
# define SSIZE_MAX INT_MAX
#endif
@@ -255,7 +260,7 @@ static ssize_t bio_nread(BIO *bio, char **buf, size_t num_)
ssize_t num, available;
if (num_ > SSIZE_MAX)
- num = SSIZE_MAX;
+ num = SSIZE_MAX;
else
num = (ssize_t)num_;
diff --git a/crypto/bio/bss_log.c b/crypto/bio/bss_log.c
index e5954cd7f5..a39d95297c 100644
--- a/crypto/bio/bss_log.c
+++ b/crypto/bio/bss_log.c
@@ -77,7 +77,7 @@
# include <starlet.h>
#elif defined(__ultrix)
# include <sys/syslog.h>
-#elif !defined(MSDOS) && !defined(NO_SYSLOG) /* Unix */
+#elif !defined(MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && !defined(NO_SYSLOG) /* Unix */
# include <syslog.h>
#endif
diff --git a/crypto/des/read_pwd.c b/crypto/des/read_pwd.c
index db021dfc37..db623706a7 100644
--- a/crypto/des/read_pwd.c
+++ b/crypto/des/read_pwd.c
@@ -133,6 +133,12 @@
#define SGTTY
#endif
+#if defined(OPENSSL_SYS_VSWORKS)
+#undef TERMIOS
+#undef TERMIO
+#undef SGTTY
+#endif
+
#ifdef TERMIOS
#include <termios.h>
#define TTY_STRUCT struct termios
@@ -268,7 +274,7 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt,
#ifdef OPENSSL_SYS_MSDOS
if ((tty=fopen("con","r")) == NULL)
tty=stdin;
-#elif defined(MAC_OS_pre_X)
+#elif defined(MAC_OS_pre_X) || defined(OPENSSL_SYS_VSWORKS)
tty=stdin;
#else
#ifndef OPENSSL_SYS_MPE
diff --git a/crypto/rand/rand_egd.c b/crypto/rand/rand_egd.c
index dc54e5fa12..dd490c8254 100644
--- a/crypto/rand/rand_egd.c
+++ b/crypto/rand/rand_egd.c
@@ -114,7 +114,11 @@ int RAND_egd_bytes(const char *path,int bytes)
#include <sys/types.h>
#include <sys/socket.h>
#ifndef NO_SYS_UN_H
-#include <sys/un.h>
+# ifdef OPENSSL_SYS_VSWORKS
+# include <streams/un.h>
+# else
+# include <sys/un.h>
+# endif
#else
struct sockaddr_un {
short sun_family; /* AF_UNIX */
diff --git a/crypto/rsa/rsa.h b/crypto/rsa/rsa.h
index 47d12c9e8d..030a6c88e5 100644
--- a/crypto/rsa/rsa.h
+++ b/crypto/rsa/rsa.h
@@ -109,10 +109,10 @@ typedef struct rsa_meth_st
* option is set in 'flags'.
*/
int (*rsa_sign)(int type,
- const unsigned char *m, unsigned int m_len,
+ const unsigned char *m, unsigned int m_length,
unsigned char *sigret, unsigned int *siglen, const RSA *rsa);
int (*rsa_verify)(int dtype,
- const unsigned char *m, unsigned int m_len,
+ const unsigned char *m, unsigned int m_length,
unsigned char *sigbuf, unsigned int siglen, const RSA *rsa);
} RSA_METHOD;
@@ -231,18 +231,18 @@ RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length, int (*cb)(
/* The following 2 functions sign and verify a X509_SIG ASN1 object
* inside PKCS#1 padded RSA encryption */
-int RSA_sign(int type, const unsigned char *m, unsigned int m_len,
+int RSA_sign(int type, const unsigned char *m, unsigned int m_length,
unsigned char *sigret, unsigned int *siglen, RSA *rsa);
-int RSA_verify(int type, const unsigned char *m, unsigned int m_len,
+int RSA_verify(int type, const unsigned char *m, unsigned int m_length,
unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
/* The following 2 function sign and verify a ASN1_OCTET_STRING
* object inside PKCS#1 padded RSA encryption */
int RSA_sign_ASN1_OCTET_STRING(int type,
- const unsigned char *m, unsigned int m_len,
+ const unsigned char *m, unsigned int m_length,
unsigned char *sigret, unsigned int *siglen, RSA *rsa);
int RSA_verify_ASN1_OCTET_STRING(int type,
- const unsigned char *m, unsigned int m_len,
+ const unsigned char *m, unsigned int m_length,
unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
diff --git a/crypto/tmdiff.c b/crypto/tmdiff.c
index eccba43c0b..aea47598ad 100644
--- a/crypto/tmdiff.c
+++ b/crypto/tmdiff.c
@@ -65,7 +65,7 @@
#undef TIMES
#endif
-#if !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_SYS_VMS) || defined(__DECC) && !defined(OPENSSL_SYS_MACOSX)
+#if !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_SYS_VMS) || defined(__DECC) && !defined(OPENSSL_SYS_MACOSX) && !defined(OPENSSL_SYS_VXWORKS)
# define TIMES
#endif
@@ -91,7 +91,7 @@
#include <sys/param.h>
#endif
-#ifndef TIMES
+#if !defined(TIMES) && !defined(OPENSSL_SYS_VXWORKS)
#include <sys/timeb.h>
#endif
@@ -121,7 +121,11 @@ typedef struct ms_tm
HANDLE thread_id;
FILETIME ms_win32;
# else
+# ifdef OPENSSL_SYS_VSWORKS
+ unsigned long ticks;
+# else
struct timeb ms_timeb;
+# endif
# endif
#endif
} MS_TM;
@@ -159,7 +163,11 @@ void ms_time_get(char *a)
# ifdef OPENSSL_SYS_WIN32
GetThreadTimes(tm->thread_id,&tmpa,&tmpb,&tmpc,&(tm->ms_win32));
# else
+# ifdef OPENSSL_SYS_VSWORKS
+ tm->ticks = tickGet();
+# else
ftime(&tm->ms_timeb);
+# endif
# endif
#endif
}
@@ -189,10 +197,14 @@ double ms_time_diff(char *ap, char *bp)
ret=((double)(lb-la))/1e7;
}
# else
+# ifdef OPENSSL_SYS_VSWORKS
+ ret = (double)(b->ticks - a->ticks) / (double)sysClkRateGet();
+# else
ret= (double)(b->ms_timeb.time-a->ms_timeb.time)+
(((double)b->ms_timeb.millitm)-
((double)a->ms_timeb.millitm))/1000.0;
# endif
+# endif
#endif
return((ret < 0.0000001)?0.0000001:ret);
}
@@ -210,6 +222,9 @@ int ms_time_cmp(char *ap, char *bp)
d =(b->ms_win32.dwHighDateTime&0x000fffff)*10+b->ms_win32.dwLowDateTime/1e7;
d-=(a->ms_win32.dwHighDateTime&0x000fffff)*10+a->ms_win32.dwLowDateTime/1e7;
# else
+# ifdef OPENSSL_SYS_VSWORKS
+ d = (b->ticks - a->ticks);
+# else
d= (double)(b->ms_timeb.time-a->ms_timeb.time)+
(((double)b->ms_timeb.millitm)-(double)a->ms_timeb.millitm)/1000.0;
# endif
diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c
index 95e0b6e921..3aa03f74aa 100644
--- a/crypto/ui/ui_openssl.c
+++ b/crypto/ui/ui_openssl.c
@@ -191,6 +191,12 @@
# define SGTTY
#endif
+#if defined(OPENSSL_SYS_VSWORKS)
+#undef TERMIOS
+#undef TERMIO
+#undef SGTTY
+#endif
+
#ifdef TERMIOS
# include <termios.h>
# define TTY_STRUCT struct termios
@@ -444,7 +450,7 @@ static int open_console(UI *ui)
CRYPTO_w_lock(CRYPTO_LOCK_UI);
is_a_tty = 1;
-#if defined(OPENSSL_SYS_MACINTOSH_CLASSIC)
+#if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_VSWORKS)
tty_in=stdin;
tty_out=stderr;
#else