2011-07-27 00:27:22 +04:00
|
|
|
/* server.c
|
|
|
|
*
|
2012-02-13 23:54:10 +04:00
|
|
|
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
2011-07-27 00:27:22 +04:00
|
|
|
*
|
|
|
|
* This file is part of CyaSSL.
|
|
|
|
*
|
|
|
|
* CyaSSL is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* CyaSSL is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
|
|
*/
|
|
|
|
|
2011-08-25 03:37:16 +04:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include <config.h>
|
|
|
|
#endif
|
2011-08-05 02:42:55 +04:00
|
|
|
|
2011-08-25 02:54:58 +04:00
|
|
|
#include <cyassl/openssl/ssl.h>
|
2011-08-26 01:28:57 +04:00
|
|
|
#include <cyassl/test.h>
|
2011-02-05 22:14:47 +03:00
|
|
|
|
2012-09-20 10:38:41 +04:00
|
|
|
#include "examples/server/server.h"
|
|
|
|
|
2011-02-05 22:14:47 +03:00
|
|
|
|
|
|
|
#ifdef CYASSL_CALLBACKS
|
|
|
|
int srvHandShakeCB(HandShakeInfo*);
|
|
|
|
int srvTimeoutCB(TimeoutInfo*);
|
|
|
|
Timeval srvTo;
|
|
|
|
#endif
|
|
|
|
|
2012-10-18 00:13:58 +04:00
|
|
|
static void NonBlockingSSL_Accept(SSL* ssl)
|
|
|
|
{
|
|
|
|
#ifndef CYASSL_CALLBACKS
|
|
|
|
int ret = SSL_accept(ssl);
|
|
|
|
#else
|
|
|
|
int ret = CyaSSL_accept_ex(ssl, srvHandShakeCB, srvTimeoutCB, srvTo);
|
|
|
|
#endif
|
|
|
|
int error = SSL_get_error(ssl, 0);
|
|
|
|
SOCKET_T sockfd = (SOCKET_T)CyaSSL_get_fd(ssl);
|
|
|
|
int select_ret;
|
|
|
|
|
|
|
|
while (ret != SSL_SUCCESS && (error == SSL_ERROR_WANT_READ ||
|
|
|
|
error == SSL_ERROR_WANT_WRITE)) {
|
2012-10-19 21:14:26 +04:00
|
|
|
if (error == SSL_ERROR_WANT_READ)
|
|
|
|
printf("... server would read block\n");
|
|
|
|
else
|
|
|
|
printf("... server would write block\n");
|
2012-10-18 00:13:58 +04:00
|
|
|
|
|
|
|
if (CyaSSL_dtls(ssl))
|
|
|
|
select_ret = tcp_select(sockfd,
|
|
|
|
CyaSSL_dtls_get_current_timeout(ssl));
|
|
|
|
else
|
|
|
|
select_ret = tcp_select(sockfd, 1);
|
|
|
|
|
|
|
|
if ((select_ret == TEST_RECV_READY) ||
|
|
|
|
(select_ret == TEST_ERROR_READY)) {
|
|
|
|
#ifndef CYASSL_CALLBACKS
|
|
|
|
ret = SSL_accept(ssl);
|
|
|
|
#else
|
|
|
|
ret = CyaSSL_accept_ex(ssl,
|
|
|
|
srvHandShakeCB, srvTimeoutCB, srvTo);
|
|
|
|
#endif
|
|
|
|
error = SSL_get_error(ssl, 0);
|
|
|
|
}
|
|
|
|
else if (select_ret == TEST_TIMEOUT &&
|
|
|
|
(!CyaSSL_dtls(ssl) ||
|
|
|
|
(CyaSSL_dtls_got_timeout(ssl) >= 0))) {
|
|
|
|
error = SSL_ERROR_WANT_READ;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
error = SSL_FATAL_ERROR;
|
2011-02-05 22:14:47 +03:00
|
|
|
}
|
|
|
|
}
|
2012-10-18 00:13:58 +04:00
|
|
|
if (ret != SSL_SUCCESS)
|
|
|
|
err_sys("SSL_accept failed");
|
|
|
|
}
|
2011-02-05 22:14:47 +03:00
|
|
|
|
|
|
|
|
2012-07-30 22:58:57 +04:00
|
|
|
static void Usage(void)
|
|
|
|
{
|
2012-08-02 04:33:49 +04:00
|
|
|
printf("server " LIBCYASSL_VERSION_STRING
|
|
|
|
" NOTE: All files relative to CyaSSL home dir\n");
|
2012-07-30 22:58:57 +04:00
|
|
|
printf("-? Help, print this usage\n");
|
|
|
|
printf("-p <num> Port to listen on, default %d\n", yasslPort);
|
|
|
|
printf("-v <num> SSL version [0-3], SSLv3(0) - TLS1.2(3)), default %d\n",
|
|
|
|
SERVER_DEFAULT_VERSION);
|
|
|
|
printf("-l <str> Cipher list\n");
|
|
|
|
printf("-c <file> Certificate file, default %s\n", svrCert);
|
|
|
|
printf("-k <file> Key file, default %s\n", svrKey);
|
|
|
|
printf("-A <file> Certificate Authority file, default %s\n", cliCert);
|
|
|
|
printf("-d Disable client cert check\n");
|
|
|
|
printf("-b Bind to any interface instead of localhost only\n");
|
|
|
|
printf("-s Use pre Shared keys\n");
|
2012-08-02 22:54:49 +04:00
|
|
|
printf("-u Use UDP DTLS\n");
|
2012-10-18 01:06:50 +04:00
|
|
|
printf("-N Use Non-blocking sockets\n");
|
2012-07-30 22:58:57 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-04-27 02:41:16 +04:00
|
|
|
THREAD_RETURN CYASSL_THREAD server_test(void* args)
|
2011-02-05 22:14:47 +03:00
|
|
|
{
|
|
|
|
SOCKET_T sockfd = 0;
|
|
|
|
int clientfd = 0;
|
|
|
|
|
|
|
|
SSL_METHOD* method = 0;
|
|
|
|
SSL_CTX* ctx = 0;
|
|
|
|
SSL* ssl = 0;
|
|
|
|
|
2012-07-30 22:58:57 +04:00
|
|
|
char msg[] = "I hear you fa shizzle!";
|
|
|
|
char input[1024];
|
|
|
|
int idx;
|
|
|
|
int ch;
|
|
|
|
int version = SERVER_DEFAULT_VERSION;
|
|
|
|
int doCliCertCheck = 1;
|
|
|
|
int useAnyAddr = 0;
|
|
|
|
int port = yasslPort;
|
|
|
|
int usePsk = 0;
|
2012-08-02 22:54:49 +04:00
|
|
|
int doDTLS = 0;
|
2012-08-08 04:18:56 +04:00
|
|
|
int useNtruKey = 0;
|
2012-10-18 00:13:58 +04:00
|
|
|
int nonBlocking = 0;
|
2012-07-30 22:58:57 +04:00
|
|
|
char* cipherList = NULL;
|
|
|
|
char* verifyCert = (char*)cliCert;
|
|
|
|
char* ourCert = (char*)svrCert;
|
|
|
|
char* ourKey = (char*)svrKey;
|
|
|
|
int argc = ((func_args*)args)->argc;
|
|
|
|
char** argv = ((func_args*)args)->argv;
|
|
|
|
|
2011-02-05 22:14:47 +03:00
|
|
|
((func_args*)args)->return_code = -1; /* error state */
|
2012-07-30 22:58:57 +04:00
|
|
|
|
2012-10-18 00:13:58 +04:00
|
|
|
while ((ch = mygetopt(argc, argv, "?dbsnNup:v:l:A:c:k:")) != -1) {
|
2012-07-30 22:58:57 +04:00
|
|
|
switch (ch) {
|
|
|
|
case '?' :
|
|
|
|
Usage();
|
|
|
|
exit(EXIT_SUCCESS);
|
|
|
|
|
|
|
|
case 'd' :
|
|
|
|
doCliCertCheck = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'b' :
|
|
|
|
useAnyAddr = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 's' :
|
|
|
|
usePsk = 1;
|
|
|
|
break;
|
|
|
|
|
2012-08-08 04:18:56 +04:00
|
|
|
case 'n' :
|
|
|
|
useNtruKey = 1;
|
|
|
|
break;
|
|
|
|
|
2012-08-02 22:54:49 +04:00
|
|
|
case 'u' :
|
|
|
|
doDTLS = 1;
|
|
|
|
version = -1; /* DTLS flag */
|
|
|
|
break;
|
|
|
|
|
2012-07-30 22:58:57 +04:00
|
|
|
case 'p' :
|
2012-08-02 04:33:49 +04:00
|
|
|
port = atoi(myoptarg);
|
2012-07-30 22:58:57 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'v' :
|
2012-08-02 04:33:49 +04:00
|
|
|
version = atoi(myoptarg);
|
2012-07-30 22:58:57 +04:00
|
|
|
if (version < 0 || version > 3) {
|
|
|
|
Usage();
|
2012-08-02 04:33:49 +04:00
|
|
|
exit(MY_EX_USAGE);
|
2012-07-30 22:58:57 +04:00
|
|
|
}
|
2012-08-02 22:54:49 +04:00
|
|
|
if (doDTLS)
|
|
|
|
version = -1; /* stay with DTLS */
|
2012-07-30 22:58:57 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'l' :
|
2012-08-02 04:33:49 +04:00
|
|
|
cipherList = myoptarg;
|
2012-07-30 22:58:57 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'A' :
|
2012-08-02 04:33:49 +04:00
|
|
|
verifyCert = myoptarg;
|
2012-07-30 22:58:57 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'c' :
|
2012-08-02 04:33:49 +04:00
|
|
|
ourCert = myoptarg;
|
2012-07-30 22:58:57 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'k' :
|
2012-08-02 04:33:49 +04:00
|
|
|
ourKey = myoptarg;
|
2012-07-30 22:58:57 +04:00
|
|
|
break;
|
|
|
|
|
2012-10-18 00:13:58 +04:00
|
|
|
case 'N':
|
|
|
|
nonBlocking = 1;
|
|
|
|
break;
|
|
|
|
|
2012-07-30 22:58:57 +04:00
|
|
|
default:
|
|
|
|
Usage();
|
2012-08-02 04:33:49 +04:00
|
|
|
exit(MY_EX_USAGE);
|
2012-07-30 22:58:57 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-02 04:33:49 +04:00
|
|
|
myoptind = 0; /* reset for test cases */
|
2012-07-30 22:58:57 +04:00
|
|
|
|
|
|
|
switch (version) {
|
2012-11-27 06:40:43 +04:00
|
|
|
#ifndef NO_OLD_TLS
|
2012-07-30 22:58:57 +04:00
|
|
|
case 0:
|
|
|
|
method = SSLv3_server_method();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
method = TLSv1_server_method();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
method = TLSv1_1_server_method();
|
|
|
|
break;
|
2012-11-27 06:40:43 +04:00
|
|
|
#endif
|
2012-07-30 22:58:57 +04:00
|
|
|
|
|
|
|
case 3:
|
|
|
|
method = TLSv1_2_server_method();
|
|
|
|
break;
|
|
|
|
|
2012-08-02 22:54:49 +04:00
|
|
|
#ifdef CYASSL_DTLS
|
|
|
|
case -1:
|
|
|
|
method = DTLSv1_server_method();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
2012-07-30 22:58:57 +04:00
|
|
|
default:
|
|
|
|
err_sys("Bad SSL version");
|
|
|
|
}
|
|
|
|
|
2012-07-31 05:15:08 +04:00
|
|
|
if (method == NULL)
|
|
|
|
err_sys("unable to get method");
|
|
|
|
|
2012-07-30 22:58:57 +04:00
|
|
|
ctx = SSL_CTX_new(method);
|
2012-07-31 05:15:08 +04:00
|
|
|
if (ctx == NULL)
|
|
|
|
err_sys("unable to get ctx");
|
2012-07-30 22:58:57 +04:00
|
|
|
|
|
|
|
if (cipherList)
|
2012-07-31 05:15:08 +04:00
|
|
|
if (SSL_CTX_set_cipher_list(ctx, cipherList) != SSL_SUCCESS)
|
|
|
|
err_sys("can't set cipher list");
|
2012-07-30 22:58:57 +04:00
|
|
|
|
2012-10-30 23:51:14 +04:00
|
|
|
#ifdef CYASSL_LEANPSK
|
|
|
|
usePsk = 1;
|
|
|
|
#endif
|
|
|
|
|
2012-10-30 02:39:42 +04:00
|
|
|
#ifndef NO_FILESYSTEM
|
|
|
|
if (!usePsk) {
|
|
|
|
if (SSL_CTX_use_certificate_file(ctx, ourCert, SSL_FILETYPE_PEM)
|
|
|
|
!= SSL_SUCCESS)
|
|
|
|
err_sys("can't load server cert file, check file and run from"
|
|
|
|
" CyaSSL home dir");
|
|
|
|
}
|
|
|
|
#endif
|
2012-08-08 04:18:56 +04:00
|
|
|
|
|
|
|
#ifdef HAVE_NTRU
|
|
|
|
if (useNtruKey) {
|
|
|
|
if (CyaSSL_CTX_use_NTRUPrivateKey_file(ctx, ourKey)
|
|
|
|
!= SSL_SUCCESS)
|
|
|
|
err_sys("can't load ntru key file, "
|
|
|
|
"Please run from CyaSSL home dir");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-10-30 02:39:42 +04:00
|
|
|
#ifndef NO_FILESYSTEM
|
|
|
|
if (!useNtruKey && !usePsk) {
|
2012-08-08 04:18:56 +04:00
|
|
|
if (SSL_CTX_use_PrivateKey_file(ctx, ourKey, SSL_FILETYPE_PEM)
|
|
|
|
!= SSL_SUCCESS)
|
|
|
|
err_sys("can't load server cert file, check file and run from"
|
2012-07-30 22:58:57 +04:00
|
|
|
" CyaSSL home dir");
|
2012-08-08 04:18:56 +04:00
|
|
|
}
|
2012-10-30 02:39:42 +04:00
|
|
|
#endif
|
2011-02-05 22:14:47 +03:00
|
|
|
|
2012-07-30 22:58:57 +04:00
|
|
|
if (usePsk) {
|
2012-10-30 23:51:14 +04:00
|
|
|
#ifndef NO_PSK
|
2012-07-30 22:58:57 +04:00
|
|
|
SSL_CTX_set_psk_server_callback(ctx, my_psk_server_cb);
|
|
|
|
SSL_CTX_use_psk_identity_hint(ctx, "cyassl server");
|
2012-10-30 23:51:14 +04:00
|
|
|
if (cipherList == NULL) {
|
|
|
|
const char *defaultCipherList;
|
|
|
|
#ifdef HAVE_NULL_CIPHER
|
|
|
|
defaultCipherList = "PSK-NULL-SHA";
|
|
|
|
#else
|
|
|
|
defaultCipherList = "PSK-AES256-CBC-SHA";
|
|
|
|
#endif
|
|
|
|
if (SSL_CTX_set_cipher_list(ctx, defaultCipherList) != SSL_SUCCESS)
|
2012-07-31 05:15:08 +04:00
|
|
|
err_sys("can't set cipher list");
|
2012-10-30 23:51:14 +04:00
|
|
|
}
|
2011-02-05 22:14:47 +03:00
|
|
|
#endif
|
2012-10-30 23:51:14 +04:00
|
|
|
}
|
2011-02-05 22:14:47 +03:00
|
|
|
|
2012-10-30 02:39:42 +04:00
|
|
|
#ifndef NO_FILESYSTEM
|
2012-07-30 22:58:57 +04:00
|
|
|
/* if not using PSK, verify peer with certs */
|
|
|
|
if (doCliCertCheck && usePsk == 0) {
|
|
|
|
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER |
|
|
|
|
SSL_VERIFY_FAIL_IF_NO_PEER_CERT,0);
|
|
|
|
if (SSL_CTX_load_verify_locations(ctx, verifyCert, 0) != SSL_SUCCESS)
|
|
|
|
err_sys("can't load ca file, Please run from CyaSSL home dir");
|
|
|
|
}
|
2012-10-30 02:39:42 +04:00
|
|
|
#endif
|
2012-07-30 22:58:57 +04:00
|
|
|
|
2011-02-05 22:14:47 +03:00
|
|
|
#ifdef OPENSSL_EXTRA
|
|
|
|
SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
|
|
|
|
#endif
|
|
|
|
|
2012-06-29 21:59:48 +04:00
|
|
|
#if defined(CYASSL_SNIFFER) && !defined(HAVE_NTRU) && !defined(HAVE_ECC)
|
|
|
|
/* don't use EDH, can't sniff tmp keys */
|
2012-09-01 00:28:07 +04:00
|
|
|
if (cipherList == NULL) {
|
|
|
|
if (SSL_CTX_set_cipher_list(ctx, "AES256-SHA") != SSL_SUCCESS)
|
|
|
|
err_sys("can't set cipher list");
|
|
|
|
}
|
2012-06-29 21:59:48 +04:00
|
|
|
#endif
|
|
|
|
|
2011-02-05 22:14:47 +03:00
|
|
|
ssl = SSL_new(ctx);
|
2012-07-31 05:15:08 +04:00
|
|
|
if (ssl == NULL)
|
|
|
|
err_sys("unable to get SSL");
|
|
|
|
|
2012-05-23 04:25:15 +04:00
|
|
|
#ifdef HAVE_CRL
|
|
|
|
CyaSSL_EnableCRL(ssl, 0);
|
|
|
|
CyaSSL_LoadCRL(ssl, crlPemDir, SSL_FILETYPE_PEM, CYASSL_CRL_MONITOR |
|
|
|
|
CYASSL_CRL_START_MON);
|
|
|
|
CyaSSL_SetCRL_Cb(ssl, CRL_CallBack);
|
|
|
|
#endif
|
2012-08-02 22:54:49 +04:00
|
|
|
tcp_accept(&sockfd, &clientfd, (func_args*)args, port, useAnyAddr, doDTLS);
|
|
|
|
if (!doDTLS)
|
|
|
|
CloseSocket(sockfd);
|
2011-02-05 22:14:47 +03:00
|
|
|
|
|
|
|
SSL_set_fd(ssl, clientfd);
|
2012-10-19 23:54:15 +04:00
|
|
|
if (usePsk == 0) {
|
|
|
|
#if !defined(NO_FILESYSTEM) && defined(OPENSSL_EXTRA)
|
|
|
|
CyaSSL_SetTmpDH_file(ssl, dhParam, SSL_FILETYPE_PEM);
|
2012-11-01 23:36:47 +04:00
|
|
|
#elif !defined(NO_CERTS)
|
2012-10-19 23:54:15 +04:00
|
|
|
SetDH(ssl); /* repick suites with DHE, higher priority than PSK */
|
|
|
|
#endif
|
|
|
|
}
|
2011-02-05 22:14:47 +03:00
|
|
|
|
2012-10-18 00:13:58 +04:00
|
|
|
#ifndef CYASSL_CALLBACKS
|
|
|
|
if (nonBlocking) {
|
|
|
|
CyaSSL_set_using_nonblock(ssl, 1);
|
|
|
|
tcp_set_nonblocking(&clientfd);
|
2011-02-05 22:14:47 +03:00
|
|
|
NonBlockingSSL_Accept(ssl);
|
2012-10-18 00:13:58 +04:00
|
|
|
} else if (SSL_accept(ssl) != SSL_SUCCESS) {
|
|
|
|
int err = SSL_get_error(ssl, 0);
|
|
|
|
char buffer[80];
|
|
|
|
printf("error = %d, %s\n", err, ERR_error_string(err, buffer));
|
|
|
|
err_sys("SSL_accept failed");
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
NonBlockingSSL_Accept(ssl);
|
2011-02-05 22:14:47 +03:00
|
|
|
#endif
|
|
|
|
showPeer(ssl);
|
|
|
|
|
|
|
|
idx = SSL_read(ssl, input, sizeof(input));
|
|
|
|
if (idx > 0) {
|
|
|
|
input[idx] = 0;
|
|
|
|
printf("Client message: %s\n", input);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (SSL_write(ssl, msg, sizeof(msg)) != sizeof(msg))
|
|
|
|
err_sys("SSL_write failed");
|
|
|
|
|
|
|
|
SSL_shutdown(ssl);
|
|
|
|
SSL_free(ssl);
|
|
|
|
SSL_CTX_free(ctx);
|
|
|
|
|
|
|
|
CloseSocket(clientfd);
|
|
|
|
((func_args*)args)->return_code = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* so overall tests can pull in test function */
|
|
|
|
#ifndef NO_MAIN_DRIVER
|
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
|
|
|
func_args args;
|
|
|
|
|
|
|
|
StartTCP();
|
|
|
|
|
|
|
|
args.argc = argc;
|
|
|
|
args.argv = argv;
|
|
|
|
|
2011-06-09 00:19:39 +04:00
|
|
|
CyaSSL_Init();
|
2011-02-05 22:14:47 +03:00
|
|
|
#ifdef DEBUG_CYASSL
|
|
|
|
CyaSSL_Debugging_ON();
|
|
|
|
#endif
|
2011-09-26 03:35:54 +04:00
|
|
|
if (CurrentDir("server") || CurrentDir("build"))
|
2011-09-24 03:13:02 +04:00
|
|
|
ChangeDirBack(2);
|
|
|
|
|
2011-02-05 22:14:47 +03:00
|
|
|
server_test(&args);
|
2011-06-09 00:19:39 +04:00
|
|
|
CyaSSL_Cleanup();
|
2011-02-05 22:14:47 +03:00
|
|
|
|
|
|
|
return args.return_code;
|
|
|
|
}
|
|
|
|
|
2012-08-02 04:33:49 +04:00
|
|
|
int myoptind = 0;
|
|
|
|
char* myoptarg = NULL;
|
|
|
|
|
2011-02-05 22:14:47 +03:00
|
|
|
#endif /* NO_MAIN_DRIVER */
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef CYASSL_CALLBACKS
|
|
|
|
|
|
|
|
int srvHandShakeCB(HandShakeInfo* info)
|
|
|
|
{
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int srvTimeoutCB(TimeoutInfo* info)
|
|
|
|
{
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|