提交 c44f7540 编写于 作者: B Bodo Möller

Slight code cleanup for handling finished labels.

上级 023f7700
......@@ -64,8 +64,7 @@
#include <openssl/x509.h>
#include "ssl_locl.h"
int ssl3_send_finished(SSL *s, int a, int b, unsigned char *sender,
int slen)
int ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen)
{
unsigned char *p,*d;
int i;
......
......@@ -325,8 +325,8 @@ int ssl3_connect(SSL *s)
case SSL3_ST_CW_FINISHED_B:
ret=ssl3_send_finished(s,
SSL3_ST_CW_FINISHED_A,SSL3_ST_CW_FINISHED_B,
s->method->ssl3_enc->client_finished,
s->method->ssl3_enc->client_finished_len);
s->method->ssl3_enc->client_finished_label,
s->method->ssl3_enc->client_finished_label_len);
if (ret <= 0) goto end;
s->state=SSL3_ST_CW_FLUSH;
......
......@@ -935,7 +935,7 @@ err:
static int do_change_cipher_spec(SSL *s)
{
int i;
unsigned char *sender;
const char *sender;
int slen;
if (s->state & SSL_ST_ACCEPT)
......@@ -957,13 +957,13 @@ static int do_change_cipher_spec(SSL *s)
* the finished message */
if (s->state & SSL_ST_CONNECT)
{
sender=s->method->ssl3_enc->server_finished;
slen=s->method->ssl3_enc->server_finished_len;
sender=s->method->ssl3_enc->server_finished_label;
slen=s->method->ssl3_enc->server_finished_label_len;
}
else
{
sender=s->method->ssl3_enc->client_finished;
slen=s->method->ssl3_enc->client_finished_len;
sender=s->method->ssl3_enc->client_finished_label;
slen=s->method->ssl3_enc->client_finished_label_len;
}
s->method->ssl3_enc->final_finish_mac(s,
......
......@@ -425,8 +425,8 @@ int ssl3_accept(SSL *s)
case SSL3_ST_SW_FINISHED_B:
ret=ssl3_send_finished(s,
SSL3_ST_SW_FINISHED_A,SSL3_ST_SW_FINISHED_B,
s->method->ssl3_enc->server_finished,
s->method->ssl3_enc->server_finished_len);
s->method->ssl3_enc->server_finished_label,
s->method->ssl3_enc->server_finished_label_len);
if (ret <= 0) goto end;
s->state=SSL3_ST_SW_FLUSH;
if (s->hit)
......
......@@ -174,8 +174,8 @@ extern "C" {
#define SSL3_RS_PART_READ 4
#define SSL3_RS_PART_WRITE 5
#define SSL3_MD_CLIENT_FINISHED_CONST {0x43,0x4C,0x4E,0x54}
#define SSL3_MD_SERVER_FINISHED_CONST {0x53,0x52,0x56,0x52}
#define SSL3_MD_CLIENT_FINISHED_CONST "\x43\x4C\x4E\x54"
#define SSL3_MD_SERVER_FINISHED_CONST "\x53\x52\x56\x52"
#define SSL3_VERSION 0x0300
#define SSL3_VERSION_MAJOR 0x03
......
......@@ -330,10 +330,10 @@ typedef struct ssl3_enc_method
int (*final_finish_mac)();
int finish_mac_length;
int (*cert_verify_mac)();
unsigned char client_finished[20];
int client_finished_len;
unsigned char server_finished[20];
int server_finished_len;
const char *client_finished_label;
int client_finished_label_len;
const char *server_finished_label;
int server_finished_label_len;
int (*alert_value)();
} SSL3_ENC_METHOD;
......@@ -433,7 +433,7 @@ int ssl3_generate_master_secret(SSL *s, unsigned char *out,
unsigned char *p, int len);
int ssl3_get_req_cert_type(SSL *s,unsigned char *p);
long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok);
int ssl3_send_finished(SSL *s, int a, int b, unsigned char *sender,int slen);
int ssl3_send_finished(SSL *s, int a, int b, const char *sender,int slen);
int ssl3_num_ciphers(void);
SSL_CIPHER *ssl3_get_cipher(unsigned int u);
int ssl3_renegotiate(SSL *ssl);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册