The SSL structure contained a "type" variable that was set to either
SSL_ST_ACCEPT or SSL_ST_CONNECT depending on whether we are the server or
the client. This duplicates the capability of the "server" variable and was
actually rarely used.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
/*
* Copy the finished so we can use it for renegotiation checks
*/
/*
* Copy the finished so we can use it for renegotiation checks
*/
- if (s->type == SSL_ST_CONNECT) {
OPENSSL_assert(i <= EVP_MAX_MD_SIZE);
memcpy(s->s3->previous_client_finished, s->s3->tmp.finish_md, i);
s->s3->previous_client_finished_len = i;
OPENSSL_assert(i <= EVP_MAX_MD_SIZE);
memcpy(s->s3->previous_client_finished, s->s3->tmp.finish_md, i);
s->s3->previous_client_finished_len = i;
/*
* Copy the finished so we can use it for renegotiation checks
*/
/*
* Copy the finished so we can use it for renegotiation checks
*/
- if (s->type == SSL_ST_ACCEPT) {
OPENSSL_assert(i <= EVP_MAX_MD_SIZE);
memcpy(s->s3->previous_client_finished, s->s3->tmp.peer_finish_md, i);
s->s3->previous_client_finished_len = i;
OPENSSL_assert(i <= EVP_MAX_MD_SIZE);
memcpy(s->s3->previous_client_finished, s->s3->tmp.peer_finish_md, i);
s->s3->previous_client_finished_len = i;
STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *s)
{
STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *s)
{
- if (s->type == SSL_ST_CONNECT) { /* we are in the client */
+ if (!s->server) { /* we are in the client */
if (((s->version >> 8) == SSL3_VERSION_MAJOR) && (s->s3 != NULL))
return (s->s3->tmp.ca_names);
else
if (((s->version >> 8) == SSL3_VERSION_MAJOR) && (s->s3 != NULL))
return (s->s3->tmp.ca_names);
else
statem_clear(s);
s->version = s->method->version;
statem_clear(s);
s->version = s->method->version;
return (NULL);
ret->version = s->version;
return (NULL);
ret->version = s->version;
ret->method = s->method;
if (s->session != NULL) {
ret->method = s->method;
if (s->session != NULL) {
* DTLS1_VERSION)
*/
int version;
* DTLS1_VERSION)
*/
int version;
- /* SSL_ST_CONNECT or SSL_ST_ACCEPT */
- int type;
/* SSLv3 */
const SSL_METHOD *method;
/*
/* SSLv3 */
const SSL_METHOD *method;
/*
* handshake_func is == 0 until then, we use this test instead of an
* "init" member.
*/
* handshake_func is == 0 until then, we use this test instead of an
* "init" member.
*/
- /* are we the server side? - mostly used by SSL_clear */
+ /* are we the server side? */
int server;
/*
* Generate a new session or reuse an old one.
int server;
/*
* Generate a new session or reuse an old one.
- if (server)
- s->type = SSL_ST_ACCEPT;
- else
- s->type = SSL_ST_CONNECT;
-
if (s->init_buf == NULL) {
if ((buf = BUF_MEM_new()) == NULL) {
goto end;
if (s->init_buf == NULL) {
if ((buf = BUF_MEM_new()) == NULL) {
goto end;