mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Merge branch 'development' into dtls
* development: (100 commits) Update Changelog for the mem-measure branch Fix issues introduced when rebasing Fix compile error in memory_buffer_alloc_selftest Code cosmetics Add curve25519 to ecc-heap.sh Add curve25519 to the benchmark program Fix compile issue when buffer_alloc not available New script ecc-heap.sh Fix unused variable issue in some configs Rm usunused member in private struct Add heap usage for PK in benchmark Use memory_buffer_alloc() in benchmark if available Only define mode_func if mode is enabled (CBC etc) PKCS8 encrypted key depend on PKCS5 or PKCS12 Disable SRV_C for client measurement Output stack+heap usage with massif Enable NIST_OPTIM by default for config-suite-b Refactor memory.sh Adapt memory.sh to config-suite-b Adapt mini-client for config-suite-b.h ... Conflicts: ChangeLog include/polarssl/net.h library/Makefile library/error.c library/ssl_tls.c programs/Makefile programs/ssl/ssl_client2.c programs/ssl/ssl_server2.c tests/Makefile
This commit is contained in:
@ -29,23 +29,21 @@
|
||||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#define polarssl_printf printf
|
||||
#include <stdio.h>
|
||||
#define polarssl_fprintf fprintf
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
|
||||
#if !defined(_MSC_VER) || defined(EFIX64) || defined(EFI32)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_CERTS_C) && \
|
||||
defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SSL_TLS_C) && \
|
||||
defined(POLARSSL_SSL_SRV_C) && defined(POLARSSL_NET_C) && \
|
||||
defined(POLARSSL_RSA_C) && defined(POLARSSL_CTR_DRBG_C) && \
|
||||
defined(POLARSSL_X509_CRT_PARSE_C) && defined(POLARSSL_TIMING_C) && \
|
||||
defined(POLARSSL_FS_IO)
|
||||
#include "polarssl/entropy.h"
|
||||
#include "polarssl/ctr_drbg.h"
|
||||
#include "polarssl/certs.h"
|
||||
@ -54,6 +52,15 @@
|
||||
#include "polarssl/net.h"
|
||||
#include "polarssl/timing.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || defined(EFIX64) || defined(EFI32)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#define HTTP_RESPONSE \
|
||||
"HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n" \
|
||||
"<h2>mbed TLS Test Server</h2>\r\n" \
|
||||
@ -63,7 +70,8 @@
|
||||
!defined(POLARSSL_ENTROPY_C) || !defined(POLARSSL_SSL_TLS_C) || \
|
||||
!defined(POLARSSL_SSL_SRV_C) || !defined(POLARSSL_NET_C) || \
|
||||
!defined(POLARSSL_RSA_C) || !defined(POLARSSL_CTR_DRBG_C) || \
|
||||
!defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_TIMING_C)
|
||||
!defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_TIMING_C) || \
|
||||
!defined(POLARSSL_FS_IO)
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
((void) argc);
|
||||
@ -77,11 +85,8 @@ int main( int argc, char *argv[] )
|
||||
return( 0 );
|
||||
}
|
||||
#elif defined(_WIN32)
|
||||
int main( int argc, char *argv[] )
|
||||
int main( void )
|
||||
{
|
||||
((void) argc);
|
||||
((void) argv);
|
||||
|
||||
polarssl_printf("_WIN32 defined. This application requires fork() and signals "
|
||||
"to work correctly.\n");
|
||||
return( 0 );
|
||||
@ -99,7 +104,7 @@ static void my_debug( void *ctx, int level, const char *str )
|
||||
}
|
||||
}
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
int main( void )
|
||||
{
|
||||
int ret, len, cnt = 0, pid;
|
||||
int listen_fd;
|
||||
@ -113,9 +118,6 @@ int main( int argc, char *argv[] )
|
||||
x509_crt srvcert;
|
||||
pk_context pkey;
|
||||
|
||||
((void) argc);
|
||||
((void) argv);
|
||||
|
||||
memset( &ssl, 0, sizeof(ssl_context) );
|
||||
|
||||
entropy_init( &entropy );
|
||||
@ -340,8 +342,11 @@ int main( int argc, char *argv[] )
|
||||
|
||||
len = ret;
|
||||
polarssl_printf( " %d bytes read\n\n%s", len, (char *) buf );
|
||||
|
||||
if( ret > 0 )
|
||||
break;
|
||||
}
|
||||
while( 0 );
|
||||
while( 1 );
|
||||
|
||||
/*
|
||||
* 7. Write the 200 Response
|
||||
|
Reference in New Issue
Block a user