Slight code cleanup for handling finished labels.
authorBodo Möller <bodo@openssl.org>
Wed, 5 Jan 2000 23:11:51 +0000 (23:11 +0000)
committerBodo Möller <bodo@openssl.org>
Wed, 5 Jan 2000 23:11:51 +0000 (23:11 +0000)
ssl/s3_both.c
ssl/s3_clnt.c
ssl/s3_pkt.c
ssl/s3_srvr.c
ssl/ssl3.h
ssl/ssl_locl.h

index 9de3e45..a6348b6 100644 (file)
@@ -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;
index af4bd15..b8f6a86 100644 (file)
@@ -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;
 
index 7893d03..85b929c 100644 (file)
@@ -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,
index e2526cc..1a4a98b 100644 (file)
@@ -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)
index fdf3dce..41a621b 100644 (file)
@@ -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
index 0bfd57d..e1ac715 100644 (file)
@@ -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);