Deleted Added
full compact
s23_lib.c (76870) s23_lib.c (110007)
1/* ssl/s23_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 *

--- 40 unchanged lines hidden (view full) ---

49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
1/* ssl/s23_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 *

--- 40 unchanged lines hidden (view full) ---

49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 *
58 * $FreeBSD: head/crypto/openssl/ssl/s23_lib.c 76870 2001-05-20 03:17:35Z kris $
59 */
60
61#include <stdio.h>
62#include <openssl/objects.h>
63#include "ssl_locl.h"
64
65static int ssl23_num_ciphers(void );
66static SSL_CIPHER *ssl23_get_cipher(unsigned int u);

--- 41 unchanged lines hidden (view full) ---

108SSL_METHOD *sslv23_base_method(void)
109 {
110 return(&SSLv23_data);
111 }
112
113static int ssl23_num_ciphers(void)
114 {
115 return(ssl3_num_ciphers()
57 */
58
59#include <stdio.h>
60#include <openssl/objects.h>
61#include "ssl_locl.h"
62
63static int ssl23_num_ciphers(void );
64static SSL_CIPHER *ssl23_get_cipher(unsigned int u);

--- 41 unchanged lines hidden (view full) ---

106SSL_METHOD *sslv23_base_method(void)
107 {
108 return(&SSLv23_data);
109 }
110
111static int ssl23_num_ciphers(void)
112 {
113 return(ssl3_num_ciphers()
116#ifndef NO_SSL2
114#ifndef OPENSSL_NO_SSL2
117 + ssl2_num_ciphers()
118#endif
119 );
120 }
121
122static SSL_CIPHER *ssl23_get_cipher(unsigned int u)
123 {
124 unsigned int uu=ssl3_num_ciphers();
125
126 if (u < uu)
127 return(ssl3_get_cipher(u));
128 else
115 + ssl2_num_ciphers()
116#endif
117 );
118 }
119
120static SSL_CIPHER *ssl23_get_cipher(unsigned int u)
121 {
122 unsigned int uu=ssl3_num_ciphers();
123
124 if (u < uu)
125 return(ssl3_get_cipher(u));
126 else
129#ifndef NO_SSL2
127#ifndef OPENSSL_NO_SSL2
130 return(ssl2_get_cipher(u-uu));
131#else
132 return(NULL);
133#endif
134 }
135
136/* This function needs to check if the ciphers required are actually
137 * available */
138static SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p)
139 {
140 SSL_CIPHER c,*cp;
141 unsigned long id;
142 int n;
143
144 n=ssl3_num_ciphers();
145 id=0x03000000|((unsigned long)p[0]<<16L)|
146 ((unsigned long)p[1]<<8L)|(unsigned long)p[2];
147 c.id=id;
148 cp=ssl3_get_cipher_by_char(p);
128 return(ssl2_get_cipher(u-uu));
129#else
130 return(NULL);
131#endif
132 }
133
134/* This function needs to check if the ciphers required are actually
135 * available */
136static SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p)
137 {
138 SSL_CIPHER c,*cp;
139 unsigned long id;
140 int n;
141
142 n=ssl3_num_ciphers();
143 id=0x03000000|((unsigned long)p[0]<<16L)|
144 ((unsigned long)p[1]<<8L)|(unsigned long)p[2];
145 c.id=id;
146 cp=ssl3_get_cipher_by_char(p);
149#ifndef NO_SSL2
147#ifndef OPENSSL_NO_SSL2
150 if (cp == NULL)
151 cp=ssl2_get_cipher_by_char(p);
152#endif
153 return(cp);
154 }
155
156static int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p)
157 {

--- 81 unchanged lines hidden ---
148 if (cp == NULL)
149 cp=ssl2_get_cipher_by_char(p);
150#endif
151 return(cp);
152 }
153
154static int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p)
155 {

--- 81 unchanged lines hidden ---