s_server.c revision 9dc0df1bac950d6e491f9a7c7e4888f2b301cb15
/* apps/s_server.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
/* ====================================================================
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
* ECC cipher suite support in OpenSSL originally developed by
* SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
*/
/* Until the key-gen callbacks are modified to use newer prototypes, we allow
* deprecated functions for openssl-internal code */
#ifdef OPENSSL_NO_DEPRECATED
#endif
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef OPENSSL_NO_STDIO
#define APPS_WIN16
#endif
#if !defined(OPENSSL_SYS_NETWARE) /* conflicts with winsock2 stuff on netware */
#endif
/* With IPv6, it looks like Digital has mixed up the proper order of
recursive header file inclusion, resulting in the compiler complaining
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
is needed to have fileno() declared correctly... So let's define u_int */
#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__U_INT)
#define __U_INT
typedef unsigned int u_int;
#endif
#define USE_SOCKETS
#include "apps.h"
#ifndef OPENSSL_NO_DH
#endif
#ifndef OPENSSL_NO_RSA
#endif
#include "s_apps.h"
#include "timeouts.h"
#ifdef OPENSSL_SYS_WINCE
/* Windows CE incorrectly defines fileno as returning void*, so to avoid problems below... */
#ifdef fileno
#endif
#endif
/* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */
#endif
#ifndef OPENSSL_NO_RSA
#endif
static void close_accept_socket(void );
static void sv_usage(void);
static int init_ssl_connection(SSL *s);
unsigned int *id_len);
#ifndef OPENSSL_NO_DH
#endif
#ifdef MONOLITH
static void s_server_init(void);
#endif
#ifndef S_ISDIR
# else
# endif
#endif
#ifndef OPENSSL_NO_DH
static unsigned char dh512_p[]={
0xDA,0x58,0x3C,0x16,0xD9,0x85,0x22,0x89,0xD0,0xE4,0xAF,0x75,
0x6F,0x4C,0xCA,0x92,0xDD,0x4B,0xE5,0x33,0xB8,0x04,0xFB,0x0F,
0xED,0x94,0xEF,0x9C,0x8A,0x44,0x03,0xED,0x57,0x46,0x50,0xD3,
0x69,0x99,0xDB,0x29,0xD7,0x76,0x27,0x6B,0xA2,0xD3,0xD4,0x12,
0xE2,0x18,0xF4,0xDD,0x1E,0x08,0x4C,0xF6,0xD8,0x00,0x3E,0x7C,
0x47,0x74,0xE8,0x33,
};
static unsigned char dh512_g[]={
0x02,
};
{
return(NULL);
return(dh);
}
#endif
/* static int load_CA(SSL_CTX *ctx, char *file);*/
static int accept_socket= -1;
#define TEST_CERT "server.pem"
#define PROG s_server_main
extern int verify_depth;
static int s_server_verify=SSL_VERIFY_NONE;
#ifdef FIONBIO
static int s_nbio=0;
#endif
static int s_nbio_test=0;
int s_crlf=0;
static int www=0;
static int s_debug=0;
static int s_msg=0;
static int s_quiet=0;
static int hack=0;
#ifndef OPENSSL_NO_ENGINE
#endif
static const char *session_id_prefix=NULL;
static int enable_timeouts = 0;
#ifdef mtu
#endif
static long mtu;
static int cert_chain = 0;
#ifdef MONOLITH
static void s_server_init(void)
{
accept_socket=-1;
#ifdef FIONBIO
s_nbio=0;
#endif
s_nbio_test=0;
www=0;
s_debug=0;
s_msg=0;
s_quiet=0;
hack=0;
#ifndef OPENSSL_NO_ENGINE
#endif
}
#endif
static void sv_usage(void)
{
#ifndef OPENSSL_NO_ECDH
" Use \"openssl ecparam -list_curves\" for all names\n" \
" (default is sect163r2).\n");
#endif
#ifdef FIONBIO
#endif
#ifndef OPENSSL_NO_DH
#endif
#ifndef OPENSSL_NO_ECDH
#endif
#ifndef OPENSSL_NO_ENGINE
#endif
}
static int local_argc=0;
static char **local_argv;
#ifdef CHARSET_EBCDIC
static int ebcdic_free(BIO *a);
static BIO_METHOD methods_ebcdic=
{
};
typedef struct
{
char buff[1];
{
return(&methods_ebcdic);
}
{
return(1);
}
static int ebcdic_free(BIO *a)
{
if (a == NULL) return(0);
OPENSSL_free(a->ptr);
a->init=0;
a->flags=0;
return(1);
}
{
int ret=0;
if (ret > 0)
return(ret);
}
{
int ret=0;
int num;
unsigned char n;
{
}
return(ret);
}
{
long ret;
switch (cmd)
{
case BIO_CTRL_DUP:
ret=0L;
break;
default:
break;
}
return(ret);
}
{
int i, ret=0;
/* return(BIO_gets(bp->next_bio,buf,size));*/
for (i=0; i<size-1; ++i)
{
if (ret <= 0)
break;
else if (buf[i] == '\n')
{
++i;
break;
}
}
if (i < size)
buf[i] = '\0';
}
{
}
#endif
int MAIN(int, char **);
{
int vflags = 0;
#ifndef OPENSSL_NO_ECDH
char *named_curve = NULL;
#endif
int ret=1;
int off=0;
int state=0;
#ifdef sock_type
#endif
int sock_type=SOCK_STREAM;
#ifndef OPENSSL_NO_ENGINE
#endif
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
#elif !defined(OPENSSL_NO_SSL3)
#elif !defined(OPENSSL_NO_SSL2)
#endif
apps_startup();
#ifdef MONOLITH
#endif
goto end;
verify_depth=0;
#ifdef FIONBIO
s_nbio=0;
#endif
s_nbio_test=0;
argc--;
argv++;
while (argc >= 1)
{
{
goto bad;
}
{
}
{
}
{
}
{
s_cert_file= *(++argv);
}
{
}
{
s_key_file= *(++argv);
}
{
}
{
}
{
}
#ifndef OPENSSL_NO_ECDH
{
named_curve = *(++argv);
}
#endif
{
}
{
s_dcert_file= *(++argv);
}
{
}
{
}
{
s_dkey_file= *(++argv);
}
{
nocert=1;
}
{
}
{
}
{
}
{
}
{
}
#ifdef FIONBIO
{ s_nbio=1; }
#endif
{
#ifdef FIONBIO
s_nbio=1;
#endif
s_nbio_test=1;
}
{ s_debug=1; }
{ s_msg=1; }
{ hack=1; }
{ state=1; }
{ s_crlf=1; }
{ s_quiet=1; }
{ bugs=1; }
{ no_tmp_rsa=1; }
{ no_dhe=1; }
{ no_ecdhe=1; }
{ www=1; }
{ www=2; }
{ www=3; }
{ off|=SSL_OP_NO_SSLv2; }
{ off|=SSL_OP_NO_SSLv3; }
{ off|=SSL_OP_NO_TLSv1; }
#ifndef OPENSSL_NO_SSL2
{ meth=SSLv2_server_method(); }
#endif
#ifndef OPENSSL_NO_SSL3
{ meth=SSLv3_server_method(); }
#endif
#ifndef OPENSSL_NO_TLS1
{ meth=TLSv1_server_method(); }
#endif
#ifndef OPENSSL_NO_DTLS1
{
}
enable_timeouts = 1;
{
}
cert_chain = 1;
#endif
{
session_id_prefix = *(++argv);
}
#ifndef OPENSSL_NO_ENGINE
{
}
#endif
{
}
else
{
badop=1;
break;
}
argc--;
argv++;
}
if (badop)
{
bad:
sv_usage();
goto end;
}
#ifndef OPENSSL_NO_ENGINE
#endif
{
goto end;
}
if (s_key_file == NULL)
if (nocert == 0)
{
"server certificate private key file");
if (!s_key)
{
goto end;
}
NULL, e, "server certificate file");
if (!s_cert)
{
goto end;
}
}
if (s_dcert_file)
{
if (s_dkey_file == NULL)
0, dpass, e,
"second certificate private key file");
if (!s_dkey)
{
goto end;
}
NULL, e, "second server certificate file");
if (!s_dcert)
{
goto end;
}
}
&& !RAND_status())
{
}
{
{
}
else
{
}
}
if (nocert)
#endif
{
}
{
goto end;
}
if (session_id_prefix)
{
"warning: id_prefix is too long, only one new session will be possible\n");
"warning: id_prefix is too long if you use SSLv2\n");
{
goto end;
}
}
/* DTLS: partial reads end up discarding unread UDP bytes :-(
* Setting read ahead solves this problem.
*/
#if 0
#endif
#if 0
if (s_cert_file == NULL)
{
goto end;
}
#endif
{
/* BIO_printf(bio_err,"X509_load_verify_locations\n"); */
/* goto end; */
}
#ifndef OPENSSL_NO_DH
if (!no_dhe)
{
if (dhfile)
else if (s_cert_file)
{
}
else
{
}
}
#endif
#ifndef OPENSSL_NO_ECDH
if (!no_ecdhe)
{
if (named_curve)
{
if (nid == 0)
{
goto end;
}
{
goto end;
}
}
{
}
else
{
{
goto end;
}
}
}
#endif
goto end;
{
goto end;
}
#ifndef OPENSSL_NO_RSA
#if 1
if (!no_tmp_rsa)
#else
{
{
goto end;
}
}
#endif
#endif
goto end;
}
sizeof s_server_session_id_context);
if (www)
else
ret=0;
end:
if (s_cert)
if (s_dcert)
if (s_key)
if (s_dkey)
if (pass)
if (dpass)
{
}
}
{
}
{
int k,i;
unsigned long l;
#endif
{
goto err;
}
#ifdef FIONBIO
if (s_nbio)
{
unsigned long sl=1;
if (!s_quiet)
}
#endif
#ifndef OPENSSL_NO_KRB5
{
KRB5SVC);
}
#endif /* OPENSSL_NO_KRB5 */
if(context)
}
{
if ( enable_timeouts)
{
}
if ( mtu > 0)
{
}
else
/* want to do MTU discovery */
/* turn on cookie exchange */
}
else
if (s_nbio_test)
{
}
/* SSL_set_fd(con,s); */
if (s_debug)
{
}
if (s_msg)
{
}
width=s+1;
for (;;)
{
int read_from_terminal;
int read_from_sslcon;
read_from_terminal = 0;
if (!read_from_sslcon)
{
#endif
/* Note: under VMS with SOCKETSHR the second parameter is
* currently of type (int *) whereas under other systems
* it is (void *) if you don't have a cast it will choke
* the compiler: if you do have a cast then you can either
* go for (int *) or (void *).
*/
/* Under DOS (non-djgpp) and Windows we can't select on stdin: only
* on sockets. As a workaround we timeout the select every
* second and check for any keypress. In a proper Windows
* application we wouldn't do this because it is inefficient.
*/
if((i < 0) || (!i && !_kbhit() ) )continue;
if(_kbhit())
read_from_terminal = 1;
#else
if (i <= 0) continue;
read_from_terminal = 1;
#endif
read_from_sslcon = 1;
}
if (read_from_terminal)
{
if (s_crlf)
{
int j, lf_num;
lf_num = 0;
/* both loops are skipped when i <= 0 */
for (j = 0; j < i; j++)
if (buf[j] == '\n')
lf_num++;
for (j = i-1; j >= 0; j--)
{
if (buf[j] == '\n')
{
lf_num--;
i++;
}
}
}
else
if (!s_quiet)
{
if ((i <= 0) || (buf[0] == 'Q'))
{
SHUTDOWN(s);
ret= -11;
goto err;
}
if ((i <= 0) || (buf[0] == 'q'))
{
SHUTDOWN(s);
/* close_accept_socket();
ret= -11;*/
goto err;
}
if ((buf[0] == 'r') &&
{
i=SSL_do_handshake(con);
printf("SSL_do_handshake -> %d\n",i);
i=0; /*13; */
continue;
/* strcpy(buf,"server side RE-NEGOTIATE\n"); */
}
if ((buf[0] == 'R') &&
{
i=SSL_do_handshake(con);
printf("SSL_do_handshake -> %d\n",i);
i=0; /* 13; */
continue;
/* strcpy(buf,"server side RE-NEGOTIATE asking for client cert\n"); */
}
if (buf[0] == 'P')
{
static const char *str="Lets print some clear text\n";
}
if (buf[0] == 'S')
{
}
}
#ifdef CHARSET_EBCDIC
#endif
l=k=0;
for (;;)
{
/* should do a select for the write */
#ifdef RENEG
#endif
switch (SSL_get_error(con,k))
{
case SSL_ERROR_NONE:
break;
case SSL_ERROR_WANT_WRITE:
case SSL_ERROR_WANT_READ:
break;
case SSL_ERROR_SYSCALL:
case SSL_ERROR_SSL:
ret=1;
goto err;
/* break; */
case SSL_ERROR_ZERO_RETURN:
ret=1;
goto err;
}
l+=k;
i-=k;
if (i <= 0) break;
}
}
if (read_from_sslcon)
{
if (!SSL_is_init_finished(con))
{
if (i < 0)
{
ret=0;
goto err;
}
else if (i == 0)
{
ret=1;
goto err;
}
}
else
{
switch (SSL_get_error(con,i))
{
case SSL_ERROR_NONE:
#ifdef CHARSET_EBCDIC
#endif
(unsigned int)i);
break;
case SSL_ERROR_WANT_WRITE:
case SSL_ERROR_WANT_READ:
break;
case SSL_ERROR_SYSCALL:
case SSL_ERROR_SSL:
ret=1;
goto err;
case SSL_ERROR_ZERO_RETURN:
ret=1;
goto err;
}
}
}
}
err:
#if 1
#else
#endif
{
}
if (ret >= 0)
return(ret);
}
static void close_accept_socket(void)
{
if (accept_socket >= 0)
{
}
}
{
int i;
const char *str;
long verify_error;
if ((i=SSL_accept(con)) <= 0)
{
if (BIO_sock_should_retry(i))
{
return(1);
}
if (verify_error != X509_V_OK)
{
}
else
return(0);
}
{
}
#ifndef OPENSSL_NO_KRB5
{
}
#endif /* OPENSSL_NO_KRB5 */
return(1);
}
#ifndef OPENSSL_NO_DH
{
goto err;
err:
return(ret);
}
#endif
#if 0
{
return(0);
for (;;)
{
break;
}
return(1);
}
#endif
{
int ret=1;
SSL_CIPHER *c;
long total_bytes;
#ifdef FIONBIO
if (s_nbio)
{
unsigned long sl=1;
if (!s_quiet)
}
#endif
/* lets make the output buffer a reasonable size */
#ifndef OPENSSL_NO_KRB5
{
}
#endif /* OPENSSL_NO_KRB5 */
if (s_nbio_test)
{
}
/* SSL_set_fd(con,s); */
#ifdef CHARSET_EBCDIC
#endif
if (s_debug)
{
}
if (s_msg)
{
}
blank=0;
for (;;)
{
if (hack)
{
i=SSL_accept(con);
switch (SSL_get_error(con,i))
{
case SSL_ERROR_NONE:
break;
case SSL_ERROR_WANT_WRITE:
case SSL_ERROR_WANT_READ:
continue;
case SSL_ERROR_SYSCALL:
case SSL_ERROR_SSL:
case SSL_ERROR_ZERO_RETURN:
ret=1;
goto err;
/* break; */
}
}
if (i < 0) /* error */
{
if (!BIO_should_retry(io))
{
if (!s_quiet)
goto err;
}
else
{
#if defined(OPENSSL_SYS_NETWARE)
delay(1000);
sleep(1);
#endif
continue;
}
}
else if (i == 0) /* end of input */
{
ret=1;
goto end;
}
/* else we have data */
{
char *p;
static const char *space=" ";
/* BIO_puts(io,SSLeay_version(SSLEAY_VERSION));*/
for (i=0; i<local_argc; i++)
{
}
/* The following is evil and should not really
* be done */
j=sk_SSL_CIPHER_num(sk);
for (i=0; i<j; i++)
{
c=sk_SSL_CIPHER_value(sk,i);
SSL_CIPHER_get_name(c));
if ((((i+1)%2) == 0) && (i+1 != j))
}
if (p != NULL)
{
j=i=0;
while (*p)
{
if (*p == ':')
{
i++;
j=0;
}
else
{
j++;
}
p++;
}
}
?"---\nReused, "
:"---\nNew, "));
SSL_CIPHER_get_name(c));
{
}
else
break;
}
{
char *p,*e;
/* skip the '/' */
p= &(buf[5]);
dot = 1;
for (e=p; *e != '\0'; e++)
{
if (e[0] == ' ')
break;
switch (dot)
{
case 1:
break;
case 2:
break;
case 3:
break;
}
if (dot == 0)
}
if (*e == '\0')
{
break;
}
*e='\0';
if (dot)
{
break;
}
if (*p == '/')
{
break;
}
#if 0
/* append if a directory lookup */
if (e[-1] == '/')
strcat(p,"index.html");
#endif
/* if a directory, do the index thang */
{
break;
}
{
#if 0 /* must check buffer size */
strcat(p,"/index.html");
#else
break;
#endif
}
{
break;
}
if (!s_quiet)
if (www == 2)
{
i=strlen(p);
else
}
/* send the file */
total_bytes=0;
for (;;)
{
if (i <= 0) break;
#ifdef RENEG
total_bytes+=i;
{
total_bytes=0;
}
#endif
for (j=0; j<i; )
{
#ifdef RENEG
#endif
if (k <= 0)
{
if (!BIO_should_retry(io))
goto write_error;
else
{
}
}
else
{
j+=k;
}
}
}
break;
}
}
for (;;)
{
if (i <= 0)
{
if (!BIO_should_retry(io))
break;
}
else
break;
}
end:
#if 1
/* make sure we re-use sessions */
#else
/* This kills performance */
/* SSL_shutdown(con); A shutdown gets sent in the
* BIO_free_all(io) procession */
#endif
err:
if (ret >= 0)
/* if (ssl_bio != NULL) BIO_free(ssl_bio);*/
return(ret);
}
#ifndef OPENSSL_NO_RSA
{
{
if (!s_quiet)
{
}
{
}
if (!s_quiet)
{
}
}
return(rsa_tmp);
}
#endif
#define MAX_SESSION_ID_ATTEMPTS 10
unsigned int *id_len)
{
unsigned int count = 0;
do {
/* Prefix the session_id with the required prefix. NB: If our
* prefix is too long, clip it - but there will be worse effects
* anyway, eg. the server could only possibly create 1 session
* ID (ie. the prefix!) so all future session negotiations will
* fail due to conflicts. */
}
(++count < MAX_SESSION_ID_ATTEMPTS));
if(count >= MAX_SESSION_ID_ATTEMPTS)
return 0;
return 1;
}