summaryrefslogtreecommitdiffstats
path: root/ssl/s3_both.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2000-02-21 11:14:40 +0000
committerBodo Möller <bodo@openssl.org>2000-02-21 11:14:40 +0000
commite7ecc7d4ddcfc5d2a09dde220e3fc0b5e4b46289 (patch)
treed0395cc5545ca238d73febee1dfe7874cf3fb540 /ssl/s3_both.c
parent8bd5b7944e87b55f22f8277072331cb333bcbefc (diff)
Move ssl3_do_write from s3_pkt.c to s3_both.c.
Diffstat (limited to 'ssl/s3_both.c')
-rw-r--r--ssl/s3_both.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ssl/s3_both.c b/ssl/s3_both.c
index 7efe2dc792..f1a9282f0e 100644
--- a/ssl/s3_both.c
+++ b/ssl/s3_both.c
@@ -65,6 +65,26 @@
#include <openssl/x509.h>
#include "ssl_locl.h"
+/* send s->init_buf in records of type 'type' */
+int ssl3_do_write(SSL *s, int type)
+ {
+ int ret;
+
+ ret=ssl3_write_bytes(s,type,&s->init_buf->data[s->init_off],
+ s->init_num);
+ if (ret < 0) return(-1);
+ if (type == SSL3_RT_HANDSHAKE)
+ /* should not be done for 'Hello Request's, but in that case
+ * we'll ignore the result anyway */
+ ssl3_finish_mac(s,&s->init_buf->data[s->init_off],ret);
+
+ if (ret == s->init_num)
+ return(1);
+ s->init_off+=ret;
+ s->init_num-=ret;
+ return(0);
+ }
+
int ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen)
{
unsigned char *p,*d;