summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/crypto/bio
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2002-07-30 12:44:15 +0000
committernectar <nectar@FreeBSD.org>2002-07-30 12:44:15 +0000
commit0aed2eea83b351d68092e43b5a9496ce3dd5043d (patch)
treea6133c35ab337984fbbd26293f8b1ad7a958132b /crypto/openssl/crypto/bio
parent1f8c2aa1763b5d8a328b2fd4053396e94ea48d35 (diff)
downloadFreeBSD-src-0aed2eea83b351d68092e43b5a9496ce3dd5043d.zip
FreeBSD-src-0aed2eea83b351d68092e43b5a9496ce3dd5043d.tar.gz
Import of OpenSSL 0.9.6d.
Diffstat (limited to 'crypto/openssl/crypto/bio')
-rw-r--r--crypto/openssl/crypto/bio/b_print.c9
-rw-r--r--crypto/openssl/crypto/bio/b_sock.c4
-rw-r--r--crypto/openssl/crypto/bio/bf_lbuf.c12
-rw-r--r--crypto/openssl/crypto/bio/bio.h4
-rw-r--r--crypto/openssl/crypto/bio/bss_bio.c7
-rw-r--r--crypto/openssl/crypto/bio/bss_log.c2
6 files changed, 23 insertions, 15 deletions
diff --git a/crypto/openssl/crypto/bio/b_print.c b/crypto/openssl/crypto/bio/b_print.c
index f0a50c2..bbd5101 100644
--- a/crypto/openssl/crypto/bio/b_print.c
+++ b/crypto/openssl/crypto/bio/b_print.c
@@ -716,12 +716,13 @@ doapr_outch(
if (buffer) {
while (*currlen >= *maxlen) {
if (*buffer == NULL) {
- assert(*sbuffer != NULL);
if (*maxlen == 0)
*maxlen = 1024;
*buffer = OPENSSL_malloc(*maxlen);
- if (*currlen > 0)
+ if (*currlen > 0) {
+ assert(*sbuffer != NULL);
memcpy(*buffer, *sbuffer, *currlen);
+ }
*sbuffer = NULL;
} else {
*maxlen += 1024;
@@ -761,7 +762,9 @@ int BIO_vprintf (BIO *bio, const char *format, va_list args)
{
int ret;
size_t retlen;
- MS_STATIC char hugebuf[1024*10];
+ char hugebuf[1024*2]; /* Was previously 10k, which is unreasonable
+ in small-stack environments, like threads
+ or DOS programs. */
char *hugebufp = hugebuf;
size_t hugebufsize = sizeof(hugebuf);
char *dynbuf = NULL;
diff --git a/crypto/openssl/crypto/bio/b_sock.c b/crypto/openssl/crypto/bio/b_sock.c
index 7dfcbab..8fb0716 100644
--- a/crypto/openssl/crypto/bio/b_sock.c
+++ b/crypto/openssl/crypto/bio/b_sock.c
@@ -72,9 +72,9 @@
#endif
#ifdef SO_MAXCONN
-#define MAX_LISTEN SOMAXCONN
-#elif defined(SO_MAXCONN)
#define MAX_LISTEN SO_MAXCONN
+#elif defined(SOMAXCONN)
+#define MAX_LISTEN SOMAXCONN
#else
#define MAX_LISTEN 32
#endif
diff --git a/crypto/openssl/crypto/bio/bf_lbuf.c b/crypto/openssl/crypto/bio/bf_lbuf.c
index 7bcf8ed..ec0f7eb 100644
--- a/crypto/openssl/crypto/bio/bf_lbuf.c
+++ b/crypto/openssl/crypto/bio/bf_lbuf.c
@@ -200,7 +200,7 @@ static int linebuffer_write(BIO *b, const char *in, int inl)
}
}
-#ifdef DEBUG
+#if 0
BIO_write(b->next_bio, "<*<", 3);
#endif
i=BIO_write(b->next_bio,
@@ -210,13 +210,13 @@ BIO_write(b->next_bio, "<*<", 3);
ctx->obuf_len = orig_olen;
BIO_copy_next_retry(b);
-#ifdef DEBUG
+#if 0
BIO_write(b->next_bio, ">*>", 3);
#endif
if (i < 0) return((num > 0)?num:i);
if (i == 0) return(num);
}
-#ifdef DEBUG
+#if 0
BIO_write(b->next_bio, ">*>", 3);
#endif
if (i < ctx->obuf_len)
@@ -229,20 +229,20 @@ BIO_write(b->next_bio, ">*>", 3);
buffer if a NL was found and there is anything to write. */
if ((foundnl || p - in > ctx->obuf_size) && p - in > 0)
{
-#ifdef DEBUG
+#if 0
BIO_write(b->next_bio, "<*<", 3);
#endif
i=BIO_write(b->next_bio,in,p - in);
if (i <= 0)
{
BIO_copy_next_retry(b);
-#ifdef DEBUG
+#if 0
BIO_write(b->next_bio, ">*>", 3);
#endif
if (i < 0) return((num > 0)?num:i);
if (i == 0) return(num);
}
-#ifdef DEBUG
+#if 0
BIO_write(b->next_bio, ">*>", 3);
#endif
num+=i;
diff --git a/crypto/openssl/crypto/bio/bio.h b/crypto/openssl/crypto/bio/bio.h
index 3777f28..fd3aaa0 100644
--- a/crypto/openssl/crypto/bio/bio.h
+++ b/crypto/openssl/crypto/bio/bio.h
@@ -356,8 +356,8 @@ typedef struct bio_f_buffer_ctx_struct
#define BIO_set_conn_int_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,3,(char *)port)
#define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0)
#define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1)
-#define BIO_get_conn_ip(b,ip) BIO_ptr_ctrl(b,BIO_C_SET_CONNECT,2)
-#define BIO_get_conn_int_port(b,port) BIO_int_ctrl(b,BIO_C_SET_CONNECT,3,port)
+#define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2)
+#define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3)
#define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
diff --git a/crypto/openssl/crypto/bio/bss_bio.c b/crypto/openssl/crypto/bio/bss_bio.c
index 4614ad4..d836e3b 100644
--- a/crypto/openssl/crypto/bio/bss_bio.c
+++ b/crypto/openssl/crypto/bio/bss_bio.c
@@ -23,7 +23,12 @@
#include <openssl/crypto.h>
#include "openssl/e_os.h"
-#ifndef SSIZE_MAX
+
+/* VxWorks defines SSiZE_MAX with an empty value causing compile errors */
+#if defined(VXWORKS)
+# undef SSIZE_MAX
+# define SSIZE_MAX INT_MAX
+#elif !defined(SSIZE_MAX)
# define SSIZE_MAX INT_MAX
#endif
diff --git a/crypto/openssl/crypto/bio/bss_log.c b/crypto/openssl/crypto/bio/bss_log.c
index 1edf16a..7ba2aca 100644
--- a/crypto/openssl/crypto/bio/bss_log.c
+++ b/crypto/openssl/crypto/bio/bss_log.c
@@ -75,7 +75,7 @@
# include <starlet.h>
#elif defined(__ultrix)
# include <sys/syslog.h>
-#elif !defined(MSDOS) /* Unix */
+#elif !defined(MSDOS) && !defined(VXWORKS) /* Unix */
# include <syslog.h>
#endif
OpenPOWER on IntegriCloud