diff options
author | Nagendra Modadugu <ngm@google.com> | 2009-10-05 17:41:48 -0700 |
---|---|---|
committer | Nagendra Modadugu <ngm@google.com> | 2009-10-05 17:41:48 -0700 |
commit | 8a903428736d72d6272cb91d66fb8ed46aaaeb1f (patch) | |
tree | 24ef24f4e7789b0bd37aba19b68c0d3647b671b6 /ssl/s3_lib.c | |
parent | 1fada29eaaa2a758ba3f68ee9ede8b6715673146 (diff) | |
download | replicant_openssl-8a903428736d72d6272cb91d66fb8ed46aaaeb1f.zip replicant_openssl-8a903428736d72d6272cb91d66fb8ed46aaaeb1f.tar.gz replicant_openssl-8a903428736d72d6272cb91d66fb8ed46aaaeb1f.tar.bz2 |
Modify handshake_patch such that app data is sent along with CCS/Finished.
Diffstat (limited to 'ssl/s3_lib.c')
-rw-r--r-- | ssl/s3_lib.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 8916a0b..63f1342 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -2551,9 +2551,22 @@ int ssl3_write(SSL *s, const void *buf, int len) static int ssl3_read_internal(SSL *s, void *buf, int len, int peek) { - int ret; + int n,ret; clear_sys_error(); + if ((s->s3->flags & SSL3_FLAGS_POP_BUFFER) && (s->wbio == s->bbio)) + { + /* Deal with an application that calls SSL_read() when handshake data + * is yet to be written. + */ + if (BIO_wpending(s->wbio) > 0) + { + s->rwstate=SSL_WRITING; + n=BIO_flush(s->wbio); + if (n <= 0) return(n); + s->rwstate=SSL_NOTHING; + } + } if (s->s3->renegotiate) ssl3_renegotiate_check(s); s->s3->in_read_app_data=1; ret=s->method->ssl_read_bytes(s,SSL3_RT_APPLICATION_DATA,buf,len,peek); |