s3_enc.c (100928) | s3_enc.c (100936) |
---|---|
1/* ssl/s3_enc.c */ 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 * All rights reserved. 4 * 5 * This package is an SSL implementation written 6 * by Eric Young (eay@cryptsoft.com). 7 * The implementation was written so as to conform with Netscapes SSL. 8 * --- 347 unchanged lines hidden (view full) --- 356 if ((p=OPENSSL_malloc(num)) == NULL) 357 goto err; 358 359 s->s3->tmp.key_block_length=num; 360 s->s3->tmp.key_block=p; 361 362 ssl3_generate_key_block(s,p,num); 363 | 1/* ssl/s3_enc.c */ 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 * All rights reserved. 4 * 5 * This package is an SSL implementation written 6 * by Eric Young (eay@cryptsoft.com). 7 * The implementation was written so as to conform with Netscapes SSL. 8 * --- 347 unchanged lines hidden (view full) --- 356 if ((p=OPENSSL_malloc(num)) == NULL) 357 goto err; 358 359 s->s3->tmp.key_block_length=num; 360 s->s3->tmp.key_block=p; 361 362 ssl3_generate_key_block(s,p,num); 363 |
364 /* enable vulnerability countermeasure for CBC ciphers with 365 * known-IV problem (http://www.openssl.org/~bodo/tls-cbc.txt) */ 366 s->s3->need_empty_fragments = 1; | 364 if (!(s->options & SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS)) 365 { 366 /* enable vulnerability countermeasure for CBC ciphers with 367 * known-IV problem (http://www.openssl.org/~bodo/tls-cbc.txt) 368 */ 369 s->s3->need_empty_fragments = 1; 370 371 if (s->session->cipher != NULL) 372 { 373 if ((s->session->cipher->algorithms & SSL_ENC_MASK) == SSL_eNULL) 374 s->s3->need_empty_fragments = 0; 375 |
367#ifndef NO_RC4 | 376#ifndef NO_RC4 |
368 if ((s->session->cipher != NULL) && ((s->session->cipher->algorithms & SSL_ENC_MASK) == SSL_RC4)) 369 s->s3->need_empty_fragments = 0; | 377 if ((s->session->cipher->algorithms & SSL_ENC_MASK) == SSL_RC4) 378 s->s3->need_empty_fragments = 0; |
370#endif | 379#endif |
380 } 381 } |
|
371 372 return(1); 373err: 374 SSLerr(SSL_F_SSL3_SETUP_KEY_BLOCK,ERR_R_MALLOC_FAILURE); 375 return(0); 376 } 377 378void ssl3_cleanup_key_block(SSL *s) --- 282 unchanged lines hidden --- | 382 383 return(1); 384err: 385 SSLerr(SSL_F_SSL3_SETUP_KEY_BLOCK,ERR_R_MALLOC_FAILURE); 386 return(0); 387 } 388 389void ssl3_cleanup_key_block(SSL *s) --- 282 unchanged lines hidden --- |