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 9de3e45f50bef7a8c925924f71d553b564d05471..a6348b6260361c68d8bc0c56138c452a0fa1c3b3 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 af4bd15194f2abad19e2a36f9bc65179bb06c65e..b8f6a8673ec09d9bec59c08557a8da54651007c7 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 7893d03123df324f7a3dd9e1c176315f4110000a..85b929cb9ce039a336e0e5ca0be07657dce14dd9 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 e2526cc5c4f2192e77b29684c44d78486dfdeb99..1a4a98bbd7ef05c4e79394dad1e3d71c39b6fe32 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 fdf3dce8f8ffab4671b06c2d3f18ac9d536d4b53..41a621bffc601b732df15c2f486a52c573a60cd3 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 0bfd57db32675520204bf401198a784827cb1059..e1ac715d16e25eddc30c141373379dd628c84f92 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);