summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bio')
-rw-r--r--src/lib/libcrypto/bio/Makefile214
-rw-r--r--src/lib/libcrypto/bio/Makefile.ssl216
-rw-r--r--src/lib/libcrypto/bio/b_print.c13
-rw-r--r--src/lib/libcrypto/bio/bio_err.c130
-rw-r--r--src/lib/libcrypto/bio/bss_conn.c2
-rw-r--r--src/lib/libcrypto/bio/bss_rtcp.c294
6 files changed, 795 insertions, 74 deletions
diff --git a/src/lib/libcrypto/bio/Makefile b/src/lib/libcrypto/bio/Makefile
new file mode 100644
index 0000000000..a565154499
--- /dev/null
+++ b/src/lib/libcrypto/bio/Makefile
@@ -0,0 +1,214 @@
1#
2# OpenSSL/crypto/bio/Makefile
3#
4
5DIR= bio
6TOP= ../..
7CC= cc
8INCLUDES= -I.. -I$(TOP) -I../../include
9CFLAG=-g
10INSTALL_PREFIX=
11OPENSSLDIR= /usr/local/ssl
12INSTALLTOP=/usr/local/ssl
13MAKEDEPPROG= makedepend
14MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
15MAKEFILE= Makefile
16AR= ar r
17
18CFLAGS= $(INCLUDES) $(CFLAG)
19
20GENERAL=Makefile
21TEST=
22APPS=
23
24LIB=$(TOP)/libcrypto.a
25LIBSRC= bio_lib.c bio_cb.c bio_err.c \
26 bss_mem.c bss_null.c bss_fd.c \
27 bss_file.c bss_sock.c bss_conn.c \
28 bf_null.c bf_buff.c b_print.c b_dump.c \
29 b_sock.c bss_acpt.c bf_nbio.c bss_log.c bss_bio.c
30# bf_lbuf.c
31LIBOBJ= bio_lib.o bio_cb.o bio_err.o \
32 bss_mem.o bss_null.o bss_fd.o \
33 bss_file.o bss_sock.o bss_conn.o \
34 bf_null.o bf_buff.o b_print.o b_dump.o \
35 b_sock.o bss_acpt.o bf_nbio.o bss_log.o bss_bio.o
36# bf_lbuf.o
37
38SRC= $(LIBSRC)
39
40EXHEADER= bio.h
41HEADER= bss_file.c $(EXHEADER)
42
43ALL= $(GENERAL) $(SRC) $(HEADER)
44
45top:
46 (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
47
48all: lib
49
50lib: $(LIBOBJ)
51 $(AR) $(LIB) $(LIBOBJ)
52 $(RANLIB) $(LIB) || echo Never mind.
53 @touch lib
54
55files:
56 $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
57
58links:
59 @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
60 @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
61 @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
62
63install:
64 @headerlist="$(EXHEADER)"; for i in $$headerlist; \
65 do \
66 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
67 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
68 done;
69
70tags:
71 ctags $(SRC)
72
73tests:
74
75lint:
76 lint -DLINT $(INCLUDES) $(SRC)>fluff
77
78depend:
79 $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
80
81dclean:
82 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
83 mv -f Makefile.new $(MAKEFILE)
84
85clean:
86 rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
87
88# DO NOT DELETE THIS LINE -- make depend depends on it.
89
90b_dump.o: ../../e_os.h ../../include/openssl/bio.h
91b_dump.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
92b_dump.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
93b_dump.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
94b_dump.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
95b_dump.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
96b_dump.o: ../cryptlib.h b_dump.c
97b_print.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h
98b_print.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
99b_print.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
100b_print.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
101b_print.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
102b_print.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
103b_print.o: ../cryptlib.h b_print.c
104b_sock.o: ../../e_os.h ../../include/openssl/bio.h
105b_sock.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
106b_sock.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
107b_sock.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
108b_sock.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
109b_sock.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
110b_sock.o: ../cryptlib.h b_sock.c
111bf_buff.o: ../../e_os.h ../../include/openssl/bio.h
112bf_buff.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
113bf_buff.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
114bf_buff.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
115bf_buff.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
116bf_buff.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
117bf_buff.o: ../cryptlib.h bf_buff.c
118bf_nbio.o: ../../e_os.h ../../include/openssl/bio.h
119bf_nbio.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
120bf_nbio.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
121bf_nbio.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
122bf_nbio.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
123bf_nbio.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
124bf_nbio.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
125bf_nbio.o: ../cryptlib.h bf_nbio.c
126bf_null.o: ../../e_os.h ../../include/openssl/bio.h
127bf_null.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
128bf_null.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
129bf_null.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
130bf_null.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
131bf_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
132bf_null.o: ../cryptlib.h bf_null.c
133bio_cb.o: ../../e_os.h ../../include/openssl/bio.h
134bio_cb.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
135bio_cb.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
136bio_cb.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
137bio_cb.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
138bio_cb.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
139bio_cb.o: ../cryptlib.h bio_cb.c
140bio_err.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
141bio_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
142bio_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
143bio_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
144bio_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
145bio_err.o: bio_err.c
146bio_lib.o: ../../e_os.h ../../include/openssl/bio.h
147bio_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
148bio_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
149bio_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
150bio_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
151bio_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
152bio_lib.o: ../cryptlib.h bio_lib.c
153bss_acpt.o: ../../e_os.h ../../include/openssl/bio.h
154bss_acpt.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
155bss_acpt.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
156bss_acpt.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
157bss_acpt.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
158bss_acpt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
159bss_acpt.o: ../cryptlib.h bss_acpt.c
160bss_bio.o: ../../e_os.h ../../include/openssl/bio.h
161bss_bio.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
162bss_bio.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
163bss_bio.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
164bss_bio.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
165bss_bio.o: ../../include/openssl/symhacks.h bss_bio.c
166bss_conn.o: ../../e_os.h ../../include/openssl/bio.h
167bss_conn.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
168bss_conn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
169bss_conn.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
170bss_conn.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
171bss_conn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
172bss_conn.o: ../cryptlib.h bss_conn.c
173bss_fd.o: ../../e_os.h ../../include/openssl/bio.h
174bss_fd.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
175bss_fd.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
176bss_fd.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
177bss_fd.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
178bss_fd.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
179bss_fd.o: ../cryptlib.h bss_fd.c
180bss_file.o: ../../e_os.h ../../include/openssl/bio.h
181bss_file.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
182bss_file.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
183bss_file.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
184bss_file.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
185bss_file.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
186bss_file.o: ../cryptlib.h bss_file.c
187bss_log.o: ../../e_os.h ../../include/openssl/bio.h
188bss_log.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
189bss_log.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
190bss_log.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
191bss_log.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
192bss_log.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
193bss_log.o: ../cryptlib.h bss_log.c
194bss_mem.o: ../../e_os.h ../../include/openssl/bio.h
195bss_mem.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
196bss_mem.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
197bss_mem.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
198bss_mem.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
199bss_mem.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
200bss_mem.o: ../cryptlib.h bss_mem.c
201bss_null.o: ../../e_os.h ../../include/openssl/bio.h
202bss_null.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
203bss_null.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
204bss_null.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
205bss_null.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
206bss_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
207bss_null.o: ../cryptlib.h bss_null.c
208bss_sock.o: ../../e_os.h ../../include/openssl/bio.h
209bss_sock.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
210bss_sock.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
211bss_sock.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
212bss_sock.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
213bss_sock.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
214bss_sock.o: ../cryptlib.h bss_sock.c
diff --git a/src/lib/libcrypto/bio/Makefile.ssl b/src/lib/libcrypto/bio/Makefile.ssl
new file mode 100644
index 0000000000..d0b9e297b0
--- /dev/null
+++ b/src/lib/libcrypto/bio/Makefile.ssl
@@ -0,0 +1,216 @@
1#
2# SSLeay/crypto/bio/Makefile
3#
4
5DIR= bio
6TOP= ../..
7CC= cc
8INCLUDES= -I.. -I$(TOP) -I../../include
9CFLAG=-g
10INSTALL_PREFIX=
11OPENSSLDIR= /usr/local/ssl
12INSTALLTOP=/usr/local/ssl
13MAKE= make -f Makefile.ssl
14MAKEDEPPROG= makedepend
15MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
16MAKEFILE= Makefile.ssl
17AR= ar r
18
19CFLAGS= $(INCLUDES) $(CFLAG)
20
21GENERAL=Makefile
22TEST=
23APPS=
24
25LIB=$(TOP)/libcrypto.a
26LIBSRC= bio_lib.c bio_cb.c bio_err.c \
27 bss_mem.c bss_null.c bss_fd.c \
28 bss_file.c bss_sock.c bss_conn.c \
29 bf_null.c bf_buff.c b_print.c b_dump.c \
30 b_sock.c bss_acpt.c bf_nbio.c bss_log.c bss_bio.c
31# bf_lbuf.c
32LIBOBJ= bio_lib.o bio_cb.o bio_err.o \
33 bss_mem.o bss_null.o bss_fd.o \
34 bss_file.o bss_sock.o bss_conn.o \
35 bf_null.o bf_buff.o b_print.o b_dump.o \
36 b_sock.o bss_acpt.o bf_nbio.o bss_log.o bss_bio.o
37# bf_lbuf.o
38
39SRC= $(LIBSRC)
40
41EXHEADER= bio.h
42HEADER= bss_file.c $(EXHEADER)
43
44ALL= $(GENERAL) $(SRC) $(HEADER)
45
46top:
47 (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
48
49all: lib
50
51lib: $(LIBOBJ)
52 $(AR) $(LIB) $(LIBOBJ)
53 $(RANLIB) $(LIB) || echo Never mind.
54 @touch lib
55
56files:
57 $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
58
59links:
60 @sh $(TOP)/util/point.sh Makefile.ssl Makefile
61 @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
62 @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
63 @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
64
65install:
66 @for i in $(EXHEADER); \
67 do \
68 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
69 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
70 done;
71
72tags:
73 ctags $(SRC)
74
75tests:
76
77lint:
78 lint -DLINT $(INCLUDES) $(SRC)>fluff
79
80depend:
81 $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
82
83dclean:
84 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
85 mv -f Makefile.new $(MAKEFILE)
86
87clean:
88 rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
89
90# DO NOT DELETE THIS LINE -- make depend depends on it.
91
92b_dump.o: ../../e_os.h ../../include/openssl/bio.h
93b_dump.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
94b_dump.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
95b_dump.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
96b_dump.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
97b_dump.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
98b_dump.o: ../cryptlib.h b_dump.c
99b_print.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h
100b_print.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
101b_print.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
102b_print.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
103b_print.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
104b_print.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
105b_print.o: ../cryptlib.h b_print.c
106b_sock.o: ../../e_os.h ../../include/openssl/bio.h
107b_sock.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
108b_sock.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
109b_sock.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
110b_sock.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
111b_sock.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
112b_sock.o: ../cryptlib.h b_sock.c
113bf_buff.o: ../../e_os.h ../../include/openssl/bio.h
114bf_buff.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
115bf_buff.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
116bf_buff.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
117bf_buff.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
118bf_buff.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
119bf_buff.o: ../cryptlib.h bf_buff.c
120bf_nbio.o: ../../e_os.h ../../include/openssl/bio.h
121bf_nbio.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
122bf_nbio.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
123bf_nbio.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
124bf_nbio.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
125bf_nbio.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
126bf_nbio.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
127bf_nbio.o: ../cryptlib.h bf_nbio.c
128bf_null.o: ../../e_os.h ../../include/openssl/bio.h
129bf_null.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
130bf_null.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
131bf_null.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
132bf_null.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
133bf_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
134bf_null.o: ../cryptlib.h bf_null.c
135bio_cb.o: ../../e_os.h ../../include/openssl/bio.h
136bio_cb.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
137bio_cb.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
138bio_cb.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
139bio_cb.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
140bio_cb.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
141bio_cb.o: ../cryptlib.h bio_cb.c
142bio_err.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
143bio_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
144bio_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
145bio_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
146bio_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
147bio_err.o: bio_err.c
148bio_lib.o: ../../e_os.h ../../include/openssl/bio.h
149bio_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
150bio_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
151bio_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
152bio_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
153bio_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
154bio_lib.o: ../cryptlib.h bio_lib.c
155bss_acpt.o: ../../e_os.h ../../include/openssl/bio.h
156bss_acpt.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
157bss_acpt.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
158bss_acpt.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
159bss_acpt.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
160bss_acpt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
161bss_acpt.o: ../cryptlib.h bss_acpt.c
162bss_bio.o: ../../e_os.h ../../include/openssl/bio.h
163bss_bio.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
164bss_bio.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
165bss_bio.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
166bss_bio.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
167bss_bio.o: ../../include/openssl/symhacks.h bss_bio.c
168bss_conn.o: ../../e_os.h ../../include/openssl/bio.h
169bss_conn.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
170bss_conn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
171bss_conn.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
172bss_conn.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
173bss_conn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
174bss_conn.o: ../cryptlib.h bss_conn.c
175bss_fd.o: ../../e_os.h ../../include/openssl/bio.h
176bss_fd.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
177bss_fd.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
178bss_fd.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
179bss_fd.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
180bss_fd.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
181bss_fd.o: ../cryptlib.h bss_fd.c
182bss_file.o: ../../e_os.h ../../include/openssl/bio.h
183bss_file.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
184bss_file.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
185bss_file.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
186bss_file.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
187bss_file.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
188bss_file.o: ../cryptlib.h bss_file.c
189bss_log.o: ../../e_os.h ../../include/openssl/bio.h
190bss_log.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
191bss_log.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
192bss_log.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
193bss_log.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
194bss_log.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
195bss_log.o: ../cryptlib.h bss_log.c
196bss_mem.o: ../../e_os.h ../../include/openssl/bio.h
197bss_mem.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
198bss_mem.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
199bss_mem.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
200bss_mem.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
201bss_mem.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
202bss_mem.o: ../cryptlib.h bss_mem.c
203bss_null.o: ../../e_os.h ../../include/openssl/bio.h
204bss_null.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
205bss_null.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
206bss_null.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
207bss_null.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
208bss_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
209bss_null.o: ../cryptlib.h bss_null.c
210bss_sock.o: ../../e_os.h ../../include/openssl/bio.h
211bss_sock.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
212bss_sock.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
213bss_sock.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
214bss_sock.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
215bss_sock.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
216bss_sock.o: ../cryptlib.h bss_sock.c
diff --git a/src/lib/libcrypto/bio/b_print.c b/src/lib/libcrypto/bio/b_print.c
index 165f046295..8b753e7ca0 100644
--- a/src/lib/libcrypto/bio/b_print.c
+++ b/src/lib/libcrypto/bio/b_print.c
@@ -576,7 +576,7 @@ abs_val(LDOUBLE value)
576} 576}
577 577
578static LDOUBLE 578static LDOUBLE
579pow_10(int in_exp) 579pow10(int in_exp)
580{ 580{
581 LDOUBLE result = 1; 581 LDOUBLE result = 1;
582 while (in_exp) { 582 while (in_exp) {
@@ -639,11 +639,11 @@ fmtfp(
639 639
640 /* we "cheat" by converting the fractional part to integer by 640 /* we "cheat" by converting the fractional part to integer by
641 multiplying by a factor of 10 */ 641 multiplying by a factor of 10 */
642 fracpart = roundv((pow_10(max)) * (ufvalue - intpart)); 642 fracpart = roundv((pow10(max)) * (ufvalue - intpart));
643 643
644 if (fracpart >= (long)pow_10(max)) { 644 if (fracpart >= (long)pow10(max)) {
645 intpart++; 645 intpart++;
646 fracpart -= (long)pow_10(max); 646 fracpart -= (long)pow10(max);
647 } 647 }
648 648
649 /* convert integer part */ 649 /* convert integer part */
@@ -806,6 +806,7 @@ int BIO_vprintf (BIO *bio, const char *format, va_list args)
806 } 806 }
807 807
808/* As snprintf is not available everywhere, we provide our own implementation. 808/* As snprintf is not available everywhere, we provide our own implementation.
809 * In case of overflow or error, this returns -1.
809 * This function has nothing to do with BIOs, but it's closely related 810 * This function has nothing to do with BIOs, but it's closely related
810 * to BIO_printf, and we need *some* name prefix ... 811 * to BIO_printf, and we need *some* name prefix ...
811 * (XXX the function should be renamed, but to what?) */ 812 * (XXX the function should be renamed, but to what?) */
@@ -830,10 +831,10 @@ int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
830 _dopr(&buf, NULL, &n, &retlen, &truncated, format, args); 831 _dopr(&buf, NULL, &n, &retlen, &truncated, format, args);
831 832
832 if (truncated) 833 if (truncated)
833 /* In case of truncation, return -1 like traditional snprintf. 834 /* In case of truncation, return -1 unlike traditional snprintf.
834 * (Current drafts for ISO/IEC 9899 say snprintf should return 835 * (Current drafts for ISO/IEC 9899 say snprintf should return
835 * the number of characters that would have been written, 836 * the number of characters that would have been written,
836 * had the buffer been large enough.) */ 837 * had the buffer been large enough, as it did historically.) */
837 return -1; 838 return -1;
838 else 839 else
839 return (retlen <= INT_MAX) ? (int)retlen : -1; 840 return (retlen <= INT_MAX) ? (int)retlen : -1;
diff --git a/src/lib/libcrypto/bio/bio_err.c b/src/lib/libcrypto/bio/bio_err.c
index 8859a58ae4..68a119d895 100644
--- a/src/lib/libcrypto/bio/bio_err.c
+++ b/src/lib/libcrypto/bio/bio_err.c
@@ -1,6 +1,6 @@
1/* crypto/bio/bio_err.c */ 1/* crypto/bio/bio_err.c */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
@@ -64,77 +64,73 @@
64 64
65/* BEGIN ERROR CODES */ 65/* BEGIN ERROR CODES */
66#ifndef OPENSSL_NO_ERR 66#ifndef OPENSSL_NO_ERR
67
68#define ERR_FUNC(func) ERR_PACK(ERR_LIB_BIO,func,0)
69#define ERR_REASON(reason) ERR_PACK(ERR_LIB_BIO,0,reason)
70
71static ERR_STRING_DATA BIO_str_functs[]= 67static ERR_STRING_DATA BIO_str_functs[]=
72 { 68 {
73{ERR_FUNC(BIO_F_ACPT_STATE), "ACPT_STATE"}, 69{ERR_PACK(0,BIO_F_ACPT_STATE,0), "ACPT_STATE"},
74{ERR_FUNC(BIO_F_BIO_ACCEPT), "BIO_accept"}, 70{ERR_PACK(0,BIO_F_BIO_ACCEPT,0), "BIO_accept"},
75{ERR_FUNC(BIO_F_BIO_BER_GET_HEADER), "BIO_BER_GET_HEADER"}, 71{ERR_PACK(0,BIO_F_BIO_BER_GET_HEADER,0), "BIO_BER_GET_HEADER"},
76{ERR_FUNC(BIO_F_BIO_CTRL), "BIO_ctrl"}, 72{ERR_PACK(0,BIO_F_BIO_CTRL,0), "BIO_ctrl"},
77{ERR_FUNC(BIO_F_BIO_GETHOSTBYNAME), "BIO_gethostbyname"}, 73{ERR_PACK(0,BIO_F_BIO_GETHOSTBYNAME,0), "BIO_gethostbyname"},
78{ERR_FUNC(BIO_F_BIO_GETS), "BIO_gets"}, 74{ERR_PACK(0,BIO_F_BIO_GETS,0), "BIO_gets"},
79{ERR_FUNC(BIO_F_BIO_GET_ACCEPT_SOCKET), "BIO_get_accept_socket"}, 75{ERR_PACK(0,BIO_F_BIO_GET_ACCEPT_SOCKET,0), "BIO_get_accept_socket"},
80{ERR_FUNC(BIO_F_BIO_GET_HOST_IP), "BIO_get_host_ip"}, 76{ERR_PACK(0,BIO_F_BIO_GET_HOST_IP,0), "BIO_get_host_ip"},
81{ERR_FUNC(BIO_F_BIO_GET_PORT), "BIO_get_port"}, 77{ERR_PACK(0,BIO_F_BIO_GET_PORT,0), "BIO_get_port"},
82{ERR_FUNC(BIO_F_BIO_MAKE_PAIR), "BIO_MAKE_PAIR"}, 78{ERR_PACK(0,BIO_F_BIO_MAKE_PAIR,0), "BIO_MAKE_PAIR"},
83{ERR_FUNC(BIO_F_BIO_NEW), "BIO_new"}, 79{ERR_PACK(0,BIO_F_BIO_NEW,0), "BIO_new"},
84{ERR_FUNC(BIO_F_BIO_NEW_FILE), "BIO_new_file"}, 80{ERR_PACK(0,BIO_F_BIO_NEW_FILE,0), "BIO_new_file"},
85{ERR_FUNC(BIO_F_BIO_NEW_MEM_BUF), "BIO_new_mem_buf"}, 81{ERR_PACK(0,BIO_F_BIO_NEW_MEM_BUF,0), "BIO_new_mem_buf"},
86{ERR_FUNC(BIO_F_BIO_NREAD), "BIO_nread"}, 82{ERR_PACK(0,BIO_F_BIO_NREAD,0), "BIO_nread"},
87{ERR_FUNC(BIO_F_BIO_NREAD0), "BIO_nread0"}, 83{ERR_PACK(0,BIO_F_BIO_NREAD0,0), "BIO_nread0"},
88{ERR_FUNC(BIO_F_BIO_NWRITE), "BIO_nwrite"}, 84{ERR_PACK(0,BIO_F_BIO_NWRITE,0), "BIO_nwrite"},
89{ERR_FUNC(BIO_F_BIO_NWRITE0), "BIO_nwrite0"}, 85{ERR_PACK(0,BIO_F_BIO_NWRITE0,0), "BIO_nwrite0"},
90{ERR_FUNC(BIO_F_BIO_PUTS), "BIO_puts"}, 86{ERR_PACK(0,BIO_F_BIO_PUTS,0), "BIO_puts"},
91{ERR_FUNC(BIO_F_BIO_READ), "BIO_read"}, 87{ERR_PACK(0,BIO_F_BIO_READ,0), "BIO_read"},
92{ERR_FUNC(BIO_F_BIO_SOCK_INIT), "BIO_sock_init"}, 88{ERR_PACK(0,BIO_F_BIO_SOCK_INIT,0), "BIO_sock_init"},
93{ERR_FUNC(BIO_F_BIO_WRITE), "BIO_write"}, 89{ERR_PACK(0,BIO_F_BIO_WRITE,0), "BIO_write"},
94{ERR_FUNC(BIO_F_BUFFER_CTRL), "BUFFER_CTRL"}, 90{ERR_PACK(0,BIO_F_BUFFER_CTRL,0), "BUFFER_CTRL"},
95{ERR_FUNC(BIO_F_CONN_CTRL), "CONN_CTRL"}, 91{ERR_PACK(0,BIO_F_CONN_CTRL,0), "CONN_CTRL"},
96{ERR_FUNC(BIO_F_CONN_STATE), "CONN_STATE"}, 92{ERR_PACK(0,BIO_F_CONN_STATE,0), "CONN_STATE"},
97{ERR_FUNC(BIO_F_FILE_CTRL), "FILE_CTRL"}, 93{ERR_PACK(0,BIO_F_FILE_CTRL,0), "FILE_CTRL"},
98{ERR_FUNC(BIO_F_FILE_READ), "FILE_READ"}, 94{ERR_PACK(0,BIO_F_FILE_READ,0), "FILE_READ"},
99{ERR_FUNC(BIO_F_LINEBUFFER_CTRL), "LINEBUFFER_CTRL"}, 95{ERR_PACK(0,BIO_F_LINEBUFFER_CTRL,0), "LINEBUFFER_CTRL"},
100{ERR_FUNC(BIO_F_MEM_READ), "MEM_READ"}, 96{ERR_PACK(0,BIO_F_MEM_READ,0), "MEM_READ"},
101{ERR_FUNC(BIO_F_MEM_WRITE), "MEM_WRITE"}, 97{ERR_PACK(0,BIO_F_MEM_WRITE,0), "MEM_WRITE"},
102{ERR_FUNC(BIO_F_SSL_NEW), "SSL_new"}, 98{ERR_PACK(0,BIO_F_SSL_NEW,0), "SSL_new"},
103{ERR_FUNC(BIO_F_WSASTARTUP), "WSASTARTUP"}, 99{ERR_PACK(0,BIO_F_WSASTARTUP,0), "WSASTARTUP"},
104{0,NULL} 100{0,NULL}
105 }; 101 };
106 102
107static ERR_STRING_DATA BIO_str_reasons[]= 103static ERR_STRING_DATA BIO_str_reasons[]=
108 { 104 {
109{ERR_REASON(BIO_R_ACCEPT_ERROR) ,"accept error"}, 105{BIO_R_ACCEPT_ERROR ,"accept error"},
110{ERR_REASON(BIO_R_BAD_FOPEN_MODE) ,"bad fopen mode"}, 106{BIO_R_BAD_FOPEN_MODE ,"bad fopen mode"},
111{ERR_REASON(BIO_R_BAD_HOSTNAME_LOOKUP) ,"bad hostname lookup"}, 107{BIO_R_BAD_HOSTNAME_LOOKUP ,"bad hostname lookup"},
112{ERR_REASON(BIO_R_BROKEN_PIPE) ,"broken pipe"}, 108{BIO_R_BROKEN_PIPE ,"broken pipe"},
113{ERR_REASON(BIO_R_CONNECT_ERROR) ,"connect error"}, 109{BIO_R_CONNECT_ERROR ,"connect error"},
114{ERR_REASON(BIO_R_EOF_ON_MEMORY_BIO) ,"EOF on memory BIO"}, 110{BIO_R_EOF_ON_MEMORY_BIO ,"EOF on memory BIO"},
115{ERR_REASON(BIO_R_ERROR_SETTING_NBIO) ,"error setting nbio"}, 111{BIO_R_ERROR_SETTING_NBIO ,"error setting nbio"},
116{ERR_REASON(BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET),"error setting nbio on accepted socket"}, 112{BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET,"error setting nbio on accepted socket"},
117{ERR_REASON(BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET),"error setting nbio on accept socket"}, 113{BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET,"error setting nbio on accept socket"},
118{ERR_REASON(BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET),"gethostbyname addr is not af inet"}, 114{BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET ,"gethostbyname addr is not af inet"},
119{ERR_REASON(BIO_R_INVALID_ARGUMENT) ,"invalid argument"}, 115{BIO_R_INVALID_ARGUMENT ,"invalid argument"},
120{ERR_REASON(BIO_R_INVALID_IP_ADDRESS) ,"invalid ip address"}, 116{BIO_R_INVALID_IP_ADDRESS ,"invalid ip address"},
121{ERR_REASON(BIO_R_IN_USE) ,"in use"}, 117{BIO_R_IN_USE ,"in use"},
122{ERR_REASON(BIO_R_KEEPALIVE) ,"keepalive"}, 118{BIO_R_KEEPALIVE ,"keepalive"},
123{ERR_REASON(BIO_R_NBIO_CONNECT_ERROR) ,"nbio connect error"}, 119{BIO_R_NBIO_CONNECT_ERROR ,"nbio connect error"},
124{ERR_REASON(BIO_R_NO_ACCEPT_PORT_SPECIFIED),"no accept port specified"}, 120{BIO_R_NO_ACCEPT_PORT_SPECIFIED ,"no accept port specified"},
125{ERR_REASON(BIO_R_NO_HOSTNAME_SPECIFIED) ,"no hostname specified"}, 121{BIO_R_NO_HOSTNAME_SPECIFIED ,"no hostname specified"},
126{ERR_REASON(BIO_R_NO_PORT_DEFINED) ,"no port defined"}, 122{BIO_R_NO_PORT_DEFINED ,"no port defined"},
127{ERR_REASON(BIO_R_NO_PORT_SPECIFIED) ,"no port specified"}, 123{BIO_R_NO_PORT_SPECIFIED ,"no port specified"},
128{ERR_REASON(BIO_R_NO_SUCH_FILE) ,"no such file"}, 124{BIO_R_NO_SUCH_FILE ,"no such file"},
129{ERR_REASON(BIO_R_NULL_PARAMETER) ,"null parameter"}, 125{BIO_R_NULL_PARAMETER ,"null parameter"},
130{ERR_REASON(BIO_R_TAG_MISMATCH) ,"tag mismatch"}, 126{BIO_R_TAG_MISMATCH ,"tag mismatch"},
131{ERR_REASON(BIO_R_UNABLE_TO_BIND_SOCKET) ,"unable to bind socket"}, 127{BIO_R_UNABLE_TO_BIND_SOCKET ,"unable to bind socket"},
132{ERR_REASON(BIO_R_UNABLE_TO_CREATE_SOCKET),"unable to create socket"}, 128{BIO_R_UNABLE_TO_CREATE_SOCKET ,"unable to create socket"},
133{ERR_REASON(BIO_R_UNABLE_TO_LISTEN_SOCKET),"unable to listen socket"}, 129{BIO_R_UNABLE_TO_LISTEN_SOCKET ,"unable to listen socket"},
134{ERR_REASON(BIO_R_UNINITIALIZED) ,"uninitialized"}, 130{BIO_R_UNINITIALIZED ,"uninitialized"},
135{ERR_REASON(BIO_R_UNSUPPORTED_METHOD) ,"unsupported method"}, 131{BIO_R_UNSUPPORTED_METHOD ,"unsupported method"},
136{ERR_REASON(BIO_R_WRITE_TO_READ_ONLY_BIO),"write to read only BIO"}, 132{BIO_R_WRITE_TO_READ_ONLY_BIO ,"write to read only BIO"},
137{ERR_REASON(BIO_R_WSASTARTUP) ,"WSAStartup"}, 133{BIO_R_WSASTARTUP ,"WSAStartup"},
138{0,NULL} 134{0,NULL}
139 }; 135 };
140 136
@@ -148,8 +144,8 @@ void ERR_load_BIO_strings(void)
148 { 144 {
149 init=0; 145 init=0;
150#ifndef OPENSSL_NO_ERR 146#ifndef OPENSSL_NO_ERR
151 ERR_load_strings(0,BIO_str_functs); 147 ERR_load_strings(ERR_LIB_BIO,BIO_str_functs);
152 ERR_load_strings(0,BIO_str_reasons); 148 ERR_load_strings(ERR_LIB_BIO,BIO_str_reasons);
153#endif 149#endif
154 150
155 } 151 }
diff --git a/src/lib/libcrypto/bio/bss_conn.c b/src/lib/libcrypto/bio/bss_conn.c
index 216780ed5e..f5d0e759e2 100644
--- a/src/lib/libcrypto/bio/bss_conn.c
+++ b/src/lib/libcrypto/bio/bss_conn.c
@@ -469,7 +469,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr)
469 break; 469 break;
470 case BIO_C_DO_STATE_MACHINE: 470 case BIO_C_DO_STATE_MACHINE:
471 /* use this one to start the connection */ 471 /* use this one to start the connection */
472 if (data->state != BIO_CONN_S_OK) 472 if (!data->state != BIO_CONN_S_OK)
473 ret=(long)conn_state(b,data); 473 ret=(long)conn_state(b,data);
474 else 474 else
475 ret=1; 475 ret=1;
diff --git a/src/lib/libcrypto/bio/bss_rtcp.c b/src/lib/libcrypto/bio/bss_rtcp.c
new file mode 100644
index 0000000000..7dae485564
--- /dev/null
+++ b/src/lib/libcrypto/bio/bss_rtcp.c
@@ -0,0 +1,294 @@
1/* crypto/bio/bss_rtcp.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59/* Written by David L. Jones <jonesd@kcgl1.eng.ohio-state.edu>
60 * Date: 22-JUL-1996
61 * Revised: 25-SEP-1997 Update for 0.8.1, BIO_CTRL_SET -> BIO_C_SET_FD
62 */
63/* VMS */
64#include <stdio.h>
65#include <stdlib.h>
66#include <string.h>
67#include <errno.h>
68#include "cryptlib.h"
69#include <openssl/bio.h>
70
71#include <iodef.h> /* VMS IO$_ definitions */
72#include <starlet.h>
73
74typedef unsigned short io_channel;
75/*************************************************************************/
76struct io_status { short status, count; long flags; };
77
78struct rpc_msg { /* Should have member alignment inhibited */
79 char channel; /* 'A'-app data. 'R'-remote client 'G'-global */
80 char function; /* 'G'-get, 'P'-put, 'C'-confirm, 'X'-close */
81 unsigned short int length; /* Amount of data returned or max to return */
82 char data[4092]; /* variable data */
83};
84#define RPC_HDR_SIZE (sizeof(struct rpc_msg) - 4092)
85
86struct rpc_ctx {
87 int filled, pos;
88 struct rpc_msg msg;
89};
90
91static int rtcp_write(BIO *h,const char *buf,int num);
92static int rtcp_read(BIO *h,char *buf,int size);
93static int rtcp_puts(BIO *h,const char *str);
94static int rtcp_gets(BIO *h,char *str,int size);
95static long rtcp_ctrl(BIO *h,int cmd,long arg1,void *arg2);
96static int rtcp_new(BIO *h);
97static int rtcp_free(BIO *data);
98
99static BIO_METHOD rtcp_method=
100 {
101 BIO_TYPE_FD,
102 "RTCP",
103 rtcp_write,
104 rtcp_read,
105 rtcp_puts,
106 rtcp_gets,
107 rtcp_ctrl,
108 rtcp_new,
109 rtcp_free,
110 NULL,
111 };
112
113BIO_METHOD *BIO_s_rtcp(void)
114 {
115 return(&rtcp_method);
116 }
117/*****************************************************************************/
118/* Decnet I/O routines.
119 */
120
121#ifdef __DECC
122#pragma message save
123#pragma message disable DOLLARID
124#endif
125
126static int get ( io_channel chan, char *buffer, int maxlen, int *length )
127{
128 int status;
129 struct io_status iosb;
130 status = sys$qiow ( 0, chan, IO$_READVBLK, &iosb, 0, 0,
131 buffer, maxlen, 0, 0, 0, 0 );
132 if ( (status&1) == 1 ) status = iosb.status;
133 if ( (status&1) == 1 ) *length = iosb.count;
134 return status;
135}
136
137static int put ( io_channel chan, char *buffer, int length )
138{
139 int status;
140 struct io_status iosb;
141 status = sys$qiow ( 0, chan, IO$_WRITEVBLK, &iosb, 0, 0,
142 buffer, length, 0, 0, 0, 0 );
143 if ( (status&1) == 1 ) status = iosb.status;
144 return status;
145}
146
147#ifdef __DECC
148#pragma message restore
149#endif
150
151/***************************************************************************/
152
153static int rtcp_new(BIO *bi)
154{
155 struct rpc_ctx *ctx;
156 bi->init=1;
157 bi->num=0;
158 bi->flags = 0;
159 bi->ptr=OPENSSL_malloc(sizeof(struct rpc_ctx));
160 ctx = (struct rpc_ctx *) bi->ptr;
161 ctx->filled = 0;
162 ctx->pos = 0;
163 return(1);
164}
165
166static int rtcp_free(BIO *a)
167{
168 if (a == NULL) return(0);
169 if ( a->ptr ) OPENSSL_free ( a->ptr );
170 a->ptr = NULL;
171 return(1);
172}
173
174static int rtcp_read(BIO *b, char *out, int outl)
175{
176 int status, length;
177 struct rpc_ctx *ctx;
178 /*
179 * read data, return existing.
180 */
181 ctx = (struct rpc_ctx *) b->ptr;
182 if ( ctx->pos < ctx->filled ) {
183 length = ctx->filled - ctx->pos;
184 if ( length > outl ) length = outl;
185 memmove ( out, &ctx->msg.data[ctx->pos], length );
186 ctx->pos += length;
187 return length;
188 }
189 /*
190 * Requst more data from R channel.
191 */
192 ctx->msg.channel = 'R';
193 ctx->msg.function = 'G';
194 ctx->msg.length = sizeof(ctx->msg.data);
195 status = put ( b->num, (char *) &ctx->msg, RPC_HDR_SIZE );
196 if ( (status&1) == 0 ) {
197 return -1;
198 }
199 /*
200 * Read.
201 */
202 ctx->pos = ctx->filled = 0;
203 status = get ( b->num, (char *) &ctx->msg, sizeof(ctx->msg), &length );
204 if ( (status&1) == 0 ) length = -1;
205 if ( ctx->msg.channel != 'R' || ctx->msg.function != 'C' ) {
206 length = -1;
207 }
208 ctx->filled = length - RPC_HDR_SIZE;
209
210 if ( ctx->pos < ctx->filled ) {
211 length = ctx->filled - ctx->pos;
212 if ( length > outl ) length = outl;
213 memmove ( out, ctx->msg.data, length );
214 ctx->pos += length;
215 return length;
216 }
217
218 return length;
219}
220
221static int rtcp_write(BIO *b, const char *in, int inl)
222{
223 int status, i, segment, length;
224 struct rpc_ctx *ctx;
225 /*
226 * Output data, send in chunks no larger that sizeof(ctx->msg.data).
227 */
228 ctx = (struct rpc_ctx *) b->ptr;
229 for ( i = 0; i < inl; i += segment ) {
230 segment = inl - i;
231 if ( segment > sizeof(ctx->msg.data) ) segment = sizeof(ctx->msg.data);
232 ctx->msg.channel = 'R';
233 ctx->msg.function = 'P';
234 ctx->msg.length = segment;
235 memmove ( ctx->msg.data, &in[i], segment );
236 status = put ( b->num, (char *) &ctx->msg, segment + RPC_HDR_SIZE );
237 if ((status&1) == 0 ) { i = -1; break; }
238
239 status = get ( b->num, (char *) &ctx->msg, sizeof(ctx->msg), &length );
240 if ( ((status&1) == 0) || (length < RPC_HDR_SIZE) ) { i = -1; break; }
241 if ( (ctx->msg.channel != 'R') || (ctx->msg.function != 'C') ) {
242 printf("unexpected response when confirming put %c %c\n",
243 ctx->msg.channel, ctx->msg.function );
244
245 }
246 }
247 return(i);
248}
249
250static long rtcp_ctrl(BIO *b, int cmd, long num, void *ptr)
251 {
252 long ret=1;
253
254 switch (cmd)
255 {
256 case BIO_CTRL_RESET:
257 case BIO_CTRL_EOF:
258 ret = 1;
259 break;
260 case BIO_C_SET_FD:
261 b->num = num;
262 ret = 1;
263 break;
264 case BIO_CTRL_SET_CLOSE:
265 case BIO_CTRL_FLUSH:
266 case BIO_CTRL_DUP:
267 ret=1;
268 break;
269 case BIO_CTRL_GET_CLOSE:
270 case BIO_CTRL_INFO:
271 case BIO_CTRL_GET:
272 case BIO_CTRL_PENDING:
273 case BIO_CTRL_WPENDING:
274 default:
275 ret=0;
276 break;
277 }
278 return(ret);
279 }
280
281static int rtcp_gets(BIO *bp, char *buf, int size)
282 {
283 return(0);
284 }
285
286static int rtcp_puts(BIO *bp, const char *str)
287{
288 int length;
289 if (str == NULL) return(0);
290 length = strlen ( str );
291 if ( length == 0 ) return (0);
292 return rtcp_write ( bp,str, length );
293}
294