diff --git a/ssl/d1_both.c b/ssl/d1_both.c index 4e854a20..570514b3 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -439,7 +439,7 @@ long dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) goto f_err; } *ok=1; - s->init_msg = s->init_buf->data + DTLS1_HM_HEADER_LENGTH; + s->init_msg = (uint8_t*)s->init_buf->data + DTLS1_HM_HEADER_LENGTH; s->init_num = (int)s->s3->tmp.message_size; return s->init_num; } @@ -481,7 +481,7 @@ again: if (!s->d1->listen) s->d1->handshake_read_seq++; - s->init_msg = s->init_buf->data + DTLS1_HM_HEADER_LENGTH; + s->init_msg = (uint8_t*)s->init_buf->data + DTLS1_HM_HEADER_LENGTH; return s->init_num; f_err: diff --git a/ssl/d1_clnt.c b/ssl/d1_clnt.c index 2e025722..15e02a1f 100644 --- a/ssl/d1_clnt.c +++ b/ssl/d1_clnt.c @@ -622,7 +622,7 @@ static int dtls1_get_hello_verify(SSL *s) return(1); } - data = (unsigned char *)s->init_msg; + data = s->init_msg; #if 0 if (s->method->version != DTLS_ANY_VERSION && ((data[0] != (s->version>>8)) || (data[1] != (s->version&0xff)))) diff --git a/ssl/s3_both.c b/ssl/s3_both.c index cdbcb661..d4698aab 100644 --- a/ssl/s3_both.c +++ b/ssl/s3_both.c @@ -254,7 +254,7 @@ int ssl3_get_finished(SSL *s, int a, int b) } s->s3->change_cipher_spec=0; - p = (unsigned char *)s->init_msg; + p = s->init_msg; i = s->s3->tmp.peer_finish_md_len; if (i != n) @@ -358,7 +358,7 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) goto f_err; } *ok=1; - s->init_msg = s->init_buf->data + 4; + s->init_msg = (uint8_t*)s->init_buf->data + 4; s->init_num = (int)s->s3->tmp.message_size; return s->init_num; } @@ -445,7 +445,7 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) s->s3->tmp.message_size=l; s->state=stn; - s->init_msg = s->init_buf->data + 4; + s->init_msg = (uint8_t*)s->init_buf->data + 4; s->init_num = 0; } diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index a28fd33d..a998a1ec 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -913,7 +913,7 @@ int ssl3_get_server_hello(SSL *s) goto f_err; } - d=p=(unsigned char *)s->init_msg; + d = p = s->init_msg; if (s->method->version == DTLS_ANY_VERSION) { /* Work out correct protocol version to use */ @@ -1120,7 +1120,7 @@ int ssl3_get_server_certificate(SSL *s) if (!ok) return((int)n); - CBS_init(&cbs, (uint8_t *)s->init_msg, n); + CBS_init(&cbs, s->init_msg, n); if ((sk=sk_X509_new_null()) == NULL) { @@ -1316,7 +1316,7 @@ int ssl3_get_key_exchange(SSL *s) return(1); } - param=p=(unsigned char *)s->init_msg; + param = p = s->init_msg; if (s->session->sess_cert != NULL) { if (s->session->sess_cert->peer_rsa_tmp != NULL) @@ -1822,7 +1822,7 @@ int ssl3_get_certificate_request(SSL *s) } } - CBS_init(&cbs, (uint8_t *)s->init_msg, n); + CBS_init(&cbs, s->init_msg, n); ca_sk = sk_X509_NAME_new(ca_dn_cmp); if (ca_sk == NULL) @@ -1964,7 +1964,7 @@ int ssl3_get_new_session_ticket(SSL *s) goto f_err; } - p=d=(unsigned char *)s->init_msg; + p = d = s->init_msg; n2l(p, s->session->tlsext_tick_lifetime_hint); n2s(p, ticklen); /* ticket_lifetime_hint + ticket_length + ticket */ @@ -2038,7 +2038,7 @@ int ssl3_get_cert_status(SSL *s) OPENSSL_PUT_ERROR(SSL, ssl3_get_cert_status, SSL_R_LENGTH_MISMATCH); goto f_err; } - p = (unsigned char *)s->init_msg; + p = s->init_msg; if (*p++ != TLSEXT_STATUSTYPE_ocsp) { al = SSL_AD_DECODE_ERROR; diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index b7c1072d..eec86808 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -889,7 +889,7 @@ int ssl3_get_client_hello(SSL *s) if (SSL_get_options(s) & SSL_OP_COOKIE_EXCHANGE) { unsigned int session_length, cookie_length; - p = (unsigned char *) s->init_msg; + p = s->init_msg; if (n < 2 + SSL3_RANDOM_SIZE) return 1; @@ -945,7 +945,7 @@ int ssl3_get_client_hello(SSL *s) return -1; } - d=p=(unsigned char *)s->init_msg; + d = p = s->init_msg; /* use version from inside client hello, not from record header * (may differ: see RFC 2246, Appendix E, second paragraph) */ @@ -2054,7 +2054,7 @@ int ssl3_get_client_key_exchange(SSL *s) &ok); if (!ok) return((int)n); - p=(unsigned char *)s->init_msg; + p = s->init_msg; alg_k=s->s3->tmp.new_cipher->algorithm_mkey; alg_a=s->s3->tmp.new_cipher->algorithm_auth; @@ -2675,7 +2675,7 @@ int ssl3_get_cert_verify(SSL *s) } /* we now have a signature that we need to verify */ - p=(unsigned char *)s->init_msg; + p = s->init_msg; if (SSL_USE_SIGALGS(s)) { int rv = tls12_check_peer_sigalg(&md, s, p, pkey); @@ -2864,7 +2864,7 @@ int ssl3_get_client_certificate(SSL *s) goto f_err; } - CBS_init(&certificate_msg, (uint8_t *)s->init_msg, n); + CBS_init(&certificate_msg, s->init_msg, n); if ((sk=sk_X509_new_null()) == NULL) { @@ -3221,7 +3221,7 @@ int ssl3_get_next_proto(SSL *s) return -1; } - CBS_init(&next_protocol, (uint8_t *)s->init_msg, n); + CBS_init(&next_protocol, s->init_msg, n); /* The payload looks like: * uint8 proto_len; @@ -3294,7 +3294,7 @@ int ssl3_get_channel_id(SSL *s) return -1; } - CBS_init(&encrypted_extensions, (uint8_t *)s->init_msg, n); + CBS_init(&encrypted_extensions, s->init_msg, n); /* EncryptedExtensions could include multiple extensions, but * the only extension that could be negotiated is ChannelID, diff --git a/ssl/ssl.h b/ssl/ssl.h index fa2fffce..7f23cc73 100644 --- a/ssl/ssl.h +++ b/ssl/ssl.h @@ -1312,7 +1312,7 @@ struct ssl_st int rstate; /* where we are when reading */ BUF_MEM *init_buf; /* buffer used during init */ - void *init_msg; /* pointer to handshake message body, set by ssl3_get_message() */ + uint8_t *init_msg; /* pointer to handshake message body, set by ssl3_get_message() */ int init_num; /* amount read/written */ int init_off; /* amount read/written */