Deleted Added
full compact
s23_clnt.c (238405) s23_clnt.c (261037)
1/* ssl/s23_clnt.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 *

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

264 {
265 cipher = sk_SSL_CIPHER_value(ciphers, i);
266 if (cipher->algorithm_ssl == SSL_SSLV2)
267 return 0;
268 }
269 return 1;
270 }
271
1/* ssl/s23_clnt.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 *

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

264 {
265 cipher = sk_SSL_CIPHER_value(ciphers, i);
266 if (cipher->algorithm_ssl == SSL_SSLV2)
267 return 0;
268 }
269 return 1;
270 }
271
272/* Fill a ClientRandom or ServerRandom field of length len. Returns <= 0
273 * on failure, 1 on success. */
274int ssl_fill_hello_random(SSL *s, int server, unsigned char *result, int len)
275 {
276 int send_time = 0;
277
278 if (len < 4)
279 return 0;
280 if (server)
281 send_time = (s->mode & SSL_MODE_SEND_SERVERHELLO_TIME) != 0;
282 else
283 send_time = (s->mode & SSL_MODE_SEND_CLIENTHELLO_TIME) != 0;
284 if (send_time)
285 {
286 unsigned long Time = time(NULL);
287 unsigned char *p = result;
288 l2n(Time, p);
289 return RAND_pseudo_bytes(p, len-4);
290 }
291 else
292 return RAND_pseudo_bytes(result, len);
293 }
294
272static int ssl23_client_hello(SSL *s)
273 {
274 unsigned char *buf;
275 unsigned char *p,*d;
276 int i,ch_len;
295static int ssl23_client_hello(SSL *s)
296 {
297 unsigned char *buf;
298 unsigned char *p,*d;
299 int i,ch_len;
277 unsigned long Time,l;
300 unsigned long l;
278 int ssl2_compat;
279 int version = 0, version_major, version_minor;
280#ifndef OPENSSL_NO_COMP
281 int j;
282 SSL_COMP *comp;
283#endif
284 int ret;
285 unsigned long mask, options = s->options;

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

350 /* don't reuse session-id's */
351 if (!ssl_get_new_session(s,0))
352 {
353 return(-1);
354 }
355#endif
356
357 p=s->s3->client_random;
301 int ssl2_compat;
302 int version = 0, version_major, version_minor;
303#ifndef OPENSSL_NO_COMP
304 int j;
305 SSL_COMP *comp;
306#endif
307 int ret;
308 unsigned long mask, options = s->options;

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

373 /* don't reuse session-id's */
374 if (!ssl_get_new_session(s,0))
375 {
376 return(-1);
377 }
378#endif
379
380 p=s->s3->client_random;
358 Time=(unsigned long)time(NULL); /* Time */
359 l2n(Time,p);
360 if (RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE-4) <= 0)
381 if (ssl_fill_hello_random(s, 0, p, SSL3_RANDOM_SIZE) <= 0)
361 return -1;
362
363 if (version == TLS1_2_VERSION)
364 {
365 version_major = TLS1_2_VERSION_MAJOR;
366 version_minor = TLS1_2_VERSION_MINOR;
367 }
368 else if (version == TLS1_1_VERSION)

--- 411 unchanged lines hidden ---
382 return -1;
383
384 if (version == TLS1_2_VERSION)
385 {
386 version_major = TLS1_2_VERSION_MAJOR;
387 version_minor = TLS1_2_VERSION_MINOR;
388 }
389 else if (version == TLS1_1_VERSION)

--- 411 unchanged lines hidden ---