diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2009-04-07 16:28:30 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2009-04-07 16:28:30 +0000 |
commit | 0d399f97dd227989c657ad080e9ad829f113ce2a (patch) | |
tree | 9319755d0dee17685baf1455424bdd9cfa4ebb7c /ssl/s3_pkt.c | |
parent | 3fdc2c906d9cc710bde85804838b3ace3117a02c (diff) |
Submitted by: Darryl Miles <darryl-mailinglists@netbauds.net>
Approved by: steve@openssl.org
Handle non-blocking I/O properly in SSL_shutdown() call.
Diffstat (limited to 'ssl/s3_pkt.c')
-rw-r--r-- | ssl/s3_pkt.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c index 9476dcddf6..60135ff9ac 100644 --- a/ssl/s3_pkt.c +++ b/ssl/s3_pkt.c @@ -1268,13 +1268,13 @@ int ssl3_do_change_cipher_spec(SSL *s) return(1); } -void ssl3_send_alert(SSL *s, int level, int desc) +int ssl3_send_alert(SSL *s, int level, int desc) { /* Map tls/ssl alert value to correct one */ desc=s->method->ssl3_enc->alert_value(desc); if (s->version == SSL3_VERSION && desc == SSL_AD_PROTOCOL_VERSION) desc = SSL_AD_HANDSHAKE_FAILURE; /* SSL 3.0 does not have protocol_version alerts */ - if (desc < 0) return; + if (desc < 0) return -1; /* If a fatal one, remove from cache */ if ((level == 2) && (s->session != NULL)) SSL_CTX_remove_session(s->ctx,s->session); @@ -1283,9 +1283,10 @@ void ssl3_send_alert(SSL *s, int level, int desc) s->s3->send_alert[0]=level; s->s3->send_alert[1]=desc; if (s->s3->wbuf.left == 0) /* data still being written out? */ - s->method->ssl_dispatch_alert(s); + return s->method->ssl_dispatch_alert(s); /* else data is still being written out, we will get written * some time in the future */ + return -1; } int ssl3_dispatch_alert(SSL *s) |