s3_lib.c (59191) | s3_lib.c (68651) |
---|---|
1/* ssl/s3_lib.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 * --- 634 unchanged lines hidden (view full) --- 643 { 644 return(s->s3->rrec.length); 645 } 646 647int ssl3_new(SSL *s) 648 { 649 SSL3_STATE *s3; 650 | 1/* ssl/s3_lib.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 * --- 634 unchanged lines hidden (view full) --- 643 { 644 return(s->s3->rrec.length); 645 } 646 647int ssl3_new(SSL *s) 648 { 649 SSL3_STATE *s3; 650 |
651 if ((s3=Malloc(sizeof *s3)) == NULL) goto err; | 651 if ((s3=OPENSSL_malloc(sizeof *s3)) == NULL) goto err; |
652 memset(s3,0,sizeof *s3); 653 654 s->s3=s3; 655 656 s->method->ssl_clear(s); 657 return(1); 658err: 659 return(0); 660 } 661 662void ssl3_free(SSL *s) 663 { 664 if(s == NULL) 665 return; 666 667 ssl3_cleanup_key_block(s); 668 if (s->s3->rbuf.buf != NULL) | 652 memset(s3,0,sizeof *s3); 653 654 s->s3=s3; 655 656 s->method->ssl_clear(s); 657 return(1); 658err: 659 return(0); 660 } 661 662void ssl3_free(SSL *s) 663 { 664 if(s == NULL) 665 return; 666 667 ssl3_cleanup_key_block(s); 668 if (s->s3->rbuf.buf != NULL) |
669 Free(s->s3->rbuf.buf); | 669 OPENSSL_free(s->s3->rbuf.buf); |
670 if (s->s3->wbuf.buf != NULL) | 670 if (s->s3->wbuf.buf != NULL) |
671 Free(s->s3->wbuf.buf); | 671 OPENSSL_free(s->s3->wbuf.buf); |
672 if (s->s3->rrec.comp != NULL) | 672 if (s->s3->rrec.comp != NULL) |
673 Free(s->s3->rrec.comp); | 673 OPENSSL_free(s->s3->rrec.comp); |
674#ifndef NO_DH 675 if (s->s3->tmp.dh != NULL) 676 DH_free(s->s3->tmp.dh); 677#endif 678 if (s->s3->tmp.ca_names != NULL) 679 sk_X509_NAME_pop_free(s->s3->tmp.ca_names,X509_NAME_free); 680 memset(s->s3,0,sizeof *s->s3); | 674#ifndef NO_DH 675 if (s->s3->tmp.dh != NULL) 676 DH_free(s->s3->tmp.dh); 677#endif 678 if (s->s3->tmp.ca_names != NULL) 679 sk_X509_NAME_pop_free(s->s3->tmp.ca_names,X509_NAME_free); 680 memset(s->s3,0,sizeof *s->s3); |
681 Free(s->s3); | 681 OPENSSL_free(s->s3); |
682 s->s3=NULL; 683 } 684 685void ssl3_clear(SSL *s) 686 { 687 unsigned char *rp,*wp; 688 689 ssl3_cleanup_key_block(s); 690 if (s->s3->tmp.ca_names != NULL) 691 sk_X509_NAME_pop_free(s->s3->tmp.ca_names,X509_NAME_free); 692 693 if (s->s3->rrec.comp != NULL) 694 { | 682 s->s3=NULL; 683 } 684 685void ssl3_clear(SSL *s) 686 { 687 unsigned char *rp,*wp; 688 689 ssl3_cleanup_key_block(s); 690 if (s->s3->tmp.ca_names != NULL) 691 sk_X509_NAME_pop_free(s->s3->tmp.ca_names,X509_NAME_free); 692 693 if (s->s3->rrec.comp != NULL) 694 { |
695 Free(s->s3->rrec.comp); | 695 OPENSSL_free(s->s3->rrec.comp); |
696 s->s3->rrec.comp=NULL; 697 } 698#ifndef NO_DH 699 if (s->s3->tmp.dh != NULL) 700 DH_free(s->s3->tmp.dh); 701#endif 702 703 rp=s->s3->rbuf.buf; --- 332 unchanged lines hidden (view full) --- 1036 init=0; 1037 } 1038 1039 id=0x03000000L|((unsigned long)p[0]<<8L)|(unsigned long)p[1]; 1040 c.id=id; 1041 cpp=(SSL_CIPHER **)OBJ_bsearch((char *)&cp, 1042 (char *)sorted, 1043 SSL3_NUM_CIPHERS,sizeof(SSL_CIPHER *), | 696 s->s3->rrec.comp=NULL; 697 } 698#ifndef NO_DH 699 if (s->s3->tmp.dh != NULL) 700 DH_free(s->s3->tmp.dh); 701#endif 702 703 rp=s->s3->rbuf.buf; --- 332 unchanged lines hidden (view full) --- 1036 init=0; 1037 } 1038 1039 id=0x03000000L|((unsigned long)p[0]<<8L)|(unsigned long)p[1]; 1040 c.id=id; 1041 cpp=(SSL_CIPHER **)OBJ_bsearch((char *)&cp, 1042 (char *)sorted, 1043 SSL3_NUM_CIPHERS,sizeof(SSL_CIPHER *), |
1044 (int (*)())ssl_cipher_ptr_id_cmp); | 1044 FP_ICC ssl_cipher_ptr_id_cmp); |
1045 if ((cpp == NULL) || !(*cpp)->valid) 1046 return(NULL); 1047 else 1048 return(*cpp); 1049 } 1050 1051int ssl3_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p) 1052 { --- 287 unchanged lines hidden --- | 1045 if ((cpp == NULL) || !(*cpp)->valid) 1046 return(NULL); 1047 else 1048 return(*cpp); 1049 } 1050 1051int ssl3_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p) 1052 { --- 287 unchanged lines hidden --- |