summaryrefslogtreecommitdiffstats
path: root/ssl/s3_clnt.c
diff options
context:
space:
mode:
authorScott Deboy <sdeboy@secondstryke.com>2014-02-04 13:08:43 -0800
committerScott Deboy <sdeboy@secondstryke.com>2014-02-08 16:19:01 -0800
commit7612511b3b54e5d729caa9897a1cfb5beb224266 (patch)
treec6d09d8a19b67c47918085fc9b5cc0778d5a26cd /ssl/s3_clnt.c
parent19a28a8aa3df6680545bcc4496110aed4a112bc5 (diff)
Re-add alert variables removed during rebase
Whitespace fixes (cherry picked from commit e9add063b50e8a460d5636055156d2760c2fe29f) Conflicts: ssl/s3_clnt.c
Diffstat (limited to 'ssl/s3_clnt.c')
-rw-r--r--ssl/s3_clnt.c56
1 files changed, 31 insertions, 25 deletions
diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c
index d39cbba49b..08531f951c 100644
--- a/ssl/s3_clnt.c
+++ b/ssl/s3_clnt.c
@@ -689,6 +689,7 @@ int ssl3_client_hello(SSL *s)
unsigned char *p,*d;
int i;
unsigned long l;
+ int al = 0;
#ifndef OPENSSL_NO_COMP
int j;
SSL_COMP *comp;
@@ -891,9 +892,9 @@ int ssl3_client_hello(SSL *s)
SSLerr(SSL_F_SSL3_CLIENT_HELLO,SSL_R_CLIENTHELLO_TLSEXT);
goto err;
}
- if ((p = ssl_add_clienthello_tlsext(s, p, buf+SSL3_RT_MAX_PLAIN_LENGTH, &al)) == NULL)
+ if ((p = ssl_add_clienthello_tlsext(s, p, buf+SSL3_RT_MAX_PLAIN_LENGTH, &al)) == NULL)
{
- ssl3_send_alert(s,SSL3_AL_FATAL,al);
+ ssl3_send_alert(s,SSL3_AL_FATAL,al);
SSLerr(SSL_F_SSL3_CLIENT_HELLO,ERR_R_INTERNAL_ERROR);
goto err;
}
@@ -3618,7 +3619,7 @@ int ssl_do_client_cert_cb(SSL *s, X509 **px509, EVP_PKEY **ppkey)
#ifndef OPENSSL_NO_TLSEXT
int tls1_send_client_supplemental_data(SSL *s, int *skip)
{
- int al = 0;
+ int al = 0;
if (s->ctx->cli_supp_data_records_count)
{
unsigned char *p = NULL;
@@ -3638,21 +3639,21 @@ int tls1_send_client_supplemental_data(SSL *s, int *skip)
if (!record->fn2)
continue;
cb_retval = record->fn2(s, record->supp_data_type,
- &out, &outlen, &al,
- record->arg);
+ &out, &outlen, &al,
+ record->arg);
if (cb_retval == -1)
continue; /* skip this supp data entry */
if (cb_retval == 0)
{
SSLerr(SSL_F_TLS1_SEND_CLIENT_SUPPLEMENTAL_DATA,ERR_R_BUF_LIB);
- goto f_err;
+ goto f_err;
}
if (outlen == 0 || TLSEXT_MAXLEN_supplemental_data < outlen + 4 + length)
{
SSLerr(SSL_F_TLS1_SEND_CLIENT_SUPPLEMENTAL_DATA,ERR_R_BUF_LIB);
return 0;
- }
- //if first entry, write handshake message type
+ }
+ /* if first entry, write handshake message type */
if (length == 0)
{
if (!BUF_MEM_grow_clean(s->init_buf, 4))
@@ -3662,9 +3663,12 @@ int tls1_send_client_supplemental_data(SSL *s, int *skip)
}
p = (unsigned char *)s->init_buf->data;
*(p++) = SSL3_MT_SUPPLEMENTAL_DATA;
- //update message length when all callbacks complete
+ /* update message length when all
+ * callbacks complete */
size_loc = p;
- //skip over handshake length field (3 bytes) and supp_data length field (3 bytes)
+ /* skip over handshake length field (3
+ * bytes) and supp_data length field
+ * (3 bytes) */
p += 3 + 3;
length += 1 +3 +3;
}
@@ -3698,10 +3702,10 @@ int tls1_send_client_supplemental_data(SSL *s, int *skip)
s->init_off = 0;
return 1;
-f_err:
- ssl3_send_alert(s,SSL3_AL_FATAL,al);
- return 0;
-}
+ f_err:
+ ssl3_send_alert(s,SSL3_AL_FATAL,al);
+ return 0;
+ }
int tls1_get_server_supplemental_data(SSL *s)
{
@@ -3716,12 +3720,12 @@ int tls1_get_server_supplemental_data(SSL *s)
int cb_retval = 0;
n=s->method->ssl_get_message(s,
- SSL3_ST_CR_SUPPLEMENTAL_DATA_A,
- SSL3_ST_CR_SUPPLEMENTAL_DATA_B,
- SSL3_MT_SUPPLEMENTAL_DATA,
- /* use default limit */
- TLSEXT_MAXLEN_supplemental_data,
- &ok);
+ SSL3_ST_CR_SUPPLEMENTAL_DATA_A,
+ SSL3_ST_CR_SUPPLEMENTAL_DATA_B,
+ SSL3_MT_SUPPLEMENTAL_DATA,
+ /* use default limit */
+ TLSEXT_MAXLEN_supplemental_data,
+ &ok);
if (!ok) return((int)n);
@@ -3742,9 +3746,11 @@ int tls1_get_server_supplemental_data(SSL *s)
//if there is a callback for this supp data type, send it
for (i=0; i < s->ctx->cli_supp_data_records_count; i++)
{
- if (s->ctx->cli_supp_data_records[i].supp_data_type == supp_data_entry_type && s->ctx->cli_supp_data_records[i].fn1)
+ if (s->ctx->cli_supp_data_records[i].supp_data_type == supp_data_entry_type &&
+ s->ctx->cli_supp_data_records[i].fn1)
{
- cb_retval = s->ctx->cli_supp_data_records[i].fn1(s, supp_data_entry_type, p, supp_data_entry_len, &al, s->ctx->cli_supp_data_records[i].arg);
+ cb_retval = s->ctx->cli_supp_data_records[i].fn1(s, supp_data_entry_type, p,
+ supp_data_entry_len, &al, s->ctx->cli_supp_data_records[i].arg);
if (cb_retval == 0)
{
SSLerr(SSL_F_TLS1_GET_SERVER_SUPPLEMENTAL_DATA, ERR_R_SSL_LIB);
@@ -3755,8 +3761,8 @@ int tls1_get_server_supplemental_data(SSL *s)
p+=supp_data_entry_len;
}
return 1;
-f_err:
- ssl3_send_alert(s,SSL3_AL_FATAL,al);
- return -1;
+ f_err:
+ ssl3_send_alert(s,SSL3_AL_FATAL,al);
+ return -1;
}
#endif