List Info

Thread: OpenSSL: OpenSSL_0_9_8-stable: openssl/ssl/ d1_clnt.c




OpenSSL: OpenSSL_0_9_8-stable: openssl/ssl/ d1_clnt.c
country flaguser name
Germany
2007-09-30 14:15:47
  OpenSSL CVS Repository
  http://cvs.openssl.org/
 
____________________________________________________________
________________

  Server: cvs.openssl.org                  Name:   Andy
Polyakov
  Root:   /v/openssl/cvs                   Email:  approopenssl.org
  Module: openssl                          Date:  
30-Sep-2007 21:15:47
  Branch: OpenSSL_0_9_8-stable             Handle:
2007093020154600

  Modified files:           (Branch: OpenSSL_0_9_8-stable)
    openssl/ssl             d1_clnt.c

  Log:
    DTLS RFC4347 requires client to use rame random field in
reply to
    HelloVerifyRequest [from HEAD].

  Summary:
    Revision    Changes     Path
    1.3.2.8     +14 -3      openssl/ssl/d1_clnt.c
 
____________________________________________________________
________________

  patch -p0 <<' .'
  Index: openssl/ssl/d1_clnt.c
 
============================================================
================
  $ cvs diff -u -r1.3.2.7 -r1.3.2.8 d1_clnt.c
  --- openssl/ssl/d1_clnt.c	30 Sep 2007 18:55:59
-0000	1.3.2.7
  +++ openssl/ssl/d1_clnt.c	30 Sep 2007 19:15:46
-0000	1.3.2.8
   -219,6 +219,8 
   			s->state=SSL3_ST_CW_CLNT_HELLO_A;
   			s->ctx->stats.sess_connect++;
   			s->init_num=0;
  +			/* mark client_random uninitialized */
 
+			memset(s->s3->client_random,0,sizeof(s->s3->
client_random));
   			break;
   
   		case SSL3_ST_CW_CLNT_HELLO_A:
   -422,6 +424,9 
   				s->s3->tmp.next_state=SSL3_ST_CR_FINISHED_A;
   				}
   			s->init_num=0;
  +			/* mark client_random uninitialized */
  +			memset
(s->s3->client_random,0,sizeof(s->s3->client_ran
dom));
  +
   			break;
   
   		case SSL3_ST_CR_FINISHED_A:
   -544,9 +549,15 
   		/* else use the pre-loaded session */
   
   		p=s->s3->client_random;
  -		Time=(unsigned long)time(NULL);			/* Time */
  -		l2n(Time,p);
  -		RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE-sizeof(Time));
  +		/* if client_random is initialized, reuse it, we are
  +		 * required to use same upon reply to HelloVerify */
  +		for (i=0;p[i]=='' &&
i<sizeof(s->s3->client_random);i++) ;
  +		if (i==sizeof(s->s3->client_random))
  +			{
  +			Time=(unsigned long)time(NULL);	/* Time */
  +			l2n(Time,p);
  +			RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE-4);
  +			}
   
   		/* Do the message type and length last */
   		d=p= &(buf[DTLS1_HM_HEADER_LENGTH]);
   .
____________________________________________________________
__________
OpenSSL Project                                 http://www.openssl.org
CVS Repository Commit List                    
openssl-cvsopenssl.org
Automated List Manager                          
majordomoopenssl.org

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )