Commit 54f51116 authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

Update from HEAD.

parent b0d90958
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1096,7 +1096,9 @@ static void print_stuff(BIO *bio, SSL *s, int full)
	SSL_CIPHER *c;
	X509_NAME *xn;
	int j,i;
#ifndef OPENSSL_NO_COMP
	const COMP_METHOD *comp, *expansion;
#endif

	if (full)
		{
@@ -1199,12 +1201,14 @@ static void print_stuff(BIO *bio, SSL *s, int full)
							 EVP_PKEY_bits(pktmp));
		EVP_PKEY_free(pktmp);
	}
#ifndef OPENSSL_NO_COMP
	comp=SSL_get_current_compression(s);
	expansion=SSL_get_current_expansion(s);
	BIO_printf(bio,"Compression: %s\n",
		comp ? SSL_COMP_get_name(comp) : "NONE");
	BIO_printf(bio,"Expansion: %s\n",
		expansion ? SSL_COMP_get_name(expansion) : "NONE");
#endif
	SSL_SESSION_print(bio,SSL_get_session(s));
	BIO_printf(bio,"---\n");
	if (peer != NULL)
+4 −0
Original line number Diff line number Diff line
@@ -371,11 +371,15 @@ int dtls1_connect(SSL *s)
			s->init_num=0;

			s->session->cipher=s->s3->tmp.new_cipher;
#ifdef OPENSSL_NO_COMP
			s->session->compress_meth=0;
#else
			if (s->s3->tmp.new_compression == NULL)
				s->session->compress_meth=0;
			else
				s->session->compress_meth=
					s->s3->tmp.new_compression->id;
#endif
			if (!s->method->ssl3_enc->setup_key_block(s))
				{
				ret= -1;
+4 −0
Original line number Diff line number Diff line
@@ -705,10 +705,14 @@ int dtls1_send_server_hello(SSL *s)
		p+=i;

		/* put the compression method */
#ifdef OPENSSL_NO_COMP
		*(p++)=0;
#else
		if (s->s3->tmp.new_compression == NULL)
			*(p++)=0;
		else
			*(p++)=s->s3->tmp.new_compression->id;
#endif

		/* do the header */
		l=(p-d);
+23 −1
Original line number Diff line number Diff line
@@ -369,11 +369,15 @@ int ssl3_connect(SSL *s)
			s->init_num=0;

			s->session->cipher=s->s3->tmp.new_cipher;
#ifdef OPENSSL_NO_COMP
			s->session->compress_meth=0;
#else
			if (s->s3->tmp.new_compression == NULL)
				s->session->compress_meth=0;
			else
				s->session->compress_meth=
					s->s3->tmp.new_compression->id;
#endif
			if (!s->method->ssl3_enc->setup_key_block(s))
				{
				ret= -1;
@@ -517,9 +521,12 @@ int ssl3_client_hello(SSL *s)
	{
	unsigned char *buf;
	unsigned char *p,*d;
	int i,j;
	int i;
	unsigned long Time,l;
#ifndef OPENSSL_NO_COMP
	int j;
	SSL_COMP *comp;
#endif

	buf=(unsigned char *)s->init_buf->data;
	if (s->state == SSL3_ST_CW_CLNT_HELLO_A)
@@ -578,6 +585,9 @@ int ssl3_client_hello(SSL *s)
		p+=i;

		/* COMPRESSION */
#ifdef OPENSSL_NO_COMP
		*(p++)=1;
#else
		if (s->ctx->comp_methods == NULL)
			j=0;
		else
@@ -588,6 +598,7 @@ int ssl3_client_hello(SSL *s)
			comp=sk_SSL_COMP_value(s->ctx->comp_methods,i);
			*(p++)=comp->id;
			}
#endif
		*(p++)=0; /* Add the NULL method */
		
		l=(p-d);
@@ -615,7 +626,9 @@ int ssl3_get_server_hello(SSL *s)
	int i,al,ok;
	unsigned int j;
	long n;
#ifndef OPENSSL_NO_COMP
	SSL_COMP *comp;
#endif

	n=s->method->ssl_get_message(s,
		SSL3_ST_CR_SRVR_HELLO_A,
@@ -746,6 +759,14 @@ int ssl3_get_server_hello(SSL *s)

	/* lets get the compression algorithm */
	/* COMPRESSION */
#ifdef OPENSSL_NO_COMP
	if (*(p++) != 0)
		{
		al=SSL_AD_ILLEGAL_PARAMETER;
		SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM);
		goto f_err;
		}
#else
	j= *(p++);
	if (j == 0)
		comp=NULL;
@@ -762,6 +783,7 @@ int ssl3_get_server_hello(SSL *s)
		{
		s->s3->tmp.new_compression=comp;
		}
#endif

	if (p != (d+n))
		{
+14 −0
Original line number Diff line number Diff line
@@ -196,7 +196,9 @@ int ssl3_change_cipher_state(SSL *s, int which)
	unsigned char *ms,*key,*iv,*er1,*er2;
	EVP_CIPHER_CTX *dd;
	const EVP_CIPHER *c;
#ifndef OPENSSL_NO_COMP
	COMP_METHOD *comp;
#endif
	const EVP_MD *m;
	EVP_MD_CTX md;
	int is_exp,n,i,j,k,cl;
@@ -205,10 +207,12 @@ int ssl3_change_cipher_state(SSL *s, int which)
	is_exp=SSL_C_IS_EXPORT(s->s3->tmp.new_cipher);
	c=s->s3->tmp.new_sym_enc;
	m=s->s3->tmp.new_hash;
#ifndef OPENSSL_NO_COMP
	if (s->s3->tmp.new_compression == NULL)
		comp=NULL;
	else
		comp=s->s3->tmp.new_compression->method;
#endif
	key_block=s->s3->tmp.key_block;

	if (which & SSL3_CC_READ)
@@ -219,6 +223,7 @@ int ssl3_change_cipher_state(SSL *s, int which)
			goto err;
		dd= s->enc_read_ctx;
		s->read_hash=m;
#ifndef OPENSSL_NO_COMP
		/* COMPRESS */
		if (s->expand != NULL)
			{
@@ -239,6 +244,7 @@ int ssl3_change_cipher_state(SSL *s, int which)
			if (s->s3->rrec.comp == NULL)
				goto err;
			}
#endif
		memset(&(s->s3->read_sequence[0]),0,8);
		mac_secret= &(s->s3->read_mac_secret[0]);
		}
@@ -250,6 +256,7 @@ int ssl3_change_cipher_state(SSL *s, int which)
			goto err;
		dd= s->enc_write_ctx;
		s->write_hash=m;
#ifndef OPENSSL_NO_COMP
		/* COMPRESS */
		if (s->compress != NULL)
			{
@@ -265,6 +272,7 @@ int ssl3_change_cipher_state(SSL *s, int which)
				goto err2;
				}
			}
#endif
		memset(&(s->s3->write_sequence[0]),0,8);
		mac_secret= &(s->s3->write_mac_secret[0]);
		}
@@ -350,7 +358,9 @@ int ssl3_setup_key_block(SSL *s)
	const EVP_MD *hash;
	int num;
	int ret = 0;
#ifdef OPENSSL_NO_COMP
	SSL_COMP *comp;
#endif

	if (s->s3->tmp.key_block_length != 0)
		return(1);
@@ -363,7 +373,11 @@ int ssl3_setup_key_block(SSL *s)

	s->s3->tmp.new_sym_enc=c;
	s->s3->tmp.new_hash=hash;
#ifdef OPENSSL_NO_COMP
	s->s3->tmp.new_compression=NULL;
#else
	s->s3->tmp.new_compression=comp;
#endif

	num=EVP_CIPHER_key_length(c)+EVP_MD_size(hash)+EVP_CIPHER_iv_length(c);
	num*=2;
Loading