Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #115 from Parlane/polarssl_detect_support
Makes the detection of shared PolarSSL more inline with usage.
  • Loading branch information
delroth committed Feb 28, 2014
2 parents ea34ae0 + 17ea34f commit c8a169a
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions CMakeTests/FindPolarSSL.cmake
Expand Up @@ -34,8 +34,10 @@ if (POLARSSL_FOUND)
set(CMAKE_REQUIRED_LIBRARIES ${POLARSSL_LIBRARY})
unset(POLARSSL_WORKS CACHE)
check_cxx_source_compiles("
#include <polarssl/ssl.h>
#include <polarssl/ctr_drbg.h>
#include <polarssl/entropy.h>
#include <polarssl/net.h>
#include <polarssl/ssl.h>
#include <polarssl/version.h>
#if POLARSSL_VERSION_NUMBER < 0x01030000
Expand All @@ -47,15 +49,27 @@ if (POLARSSL_FOUND)
ssl_context ctx;
ssl_session session;
entropy_context entropy;
ctr_drbg_context ctr_drbg;
x509_crt cacert;
x509_crt clicert;
pk_context pk;
ssl_init(&ctx);
entropy_init(&entropy);
ssl_set_rng(&ctx, entropy_func, &entropy);
const char* pers = \"dolphin-emu\";
ctr_drbg_init(&ctr_drbg, entropy_func,
&entropy,
(const unsigned char*)pers,
strlen(pers));
ssl_set_rng(&ctx, ctr_drbg_random, &ctr_drbg);
ssl_set_session(&ctx, &session);
ssl_close_notify(&ctx);
ssl_session_free(&session);
ssl_free(&ctx);
entropy_free(&entropy);
return 0;
}"
Expand Down

0 comments on commit c8a169a

Please sign in to comment.