diff options
author | 2021-07-27 03:36:45 +0200 | |
---|---|---|
committer | 2021-07-27 03:36:45 +0200 | |
commit | ab1c815340afc2883c9ef08795eebd9bed1858c5 (patch) | |
tree | a188e92dfdff14e501bf42b5d880155468cffbdd /src/idevice.h | |
parent | 19eca85f90d9950596e1c6021d7b0f89407f5d7f (diff) | |
download | libimobiledevice-ab1c815340afc2883c9ef08795eebd9bed1858c5.tar.gz libimobiledevice-ab1c815340afc2883c9ef08795eebd9bed1858c5.tar.bz2 |
Add support for MbedTLS
Diffstat (limited to 'src/idevice.h')
-rw-r--r-- | src/idevice.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/idevice.h b/src/idevice.h index 4e53a7f..7a8f4ce 100644 --- a/src/idevice.h +++ b/src/idevice.h | |||
@@ -26,11 +26,15 @@ | |||
26 | #include <config.h> | 26 | #include <config.h> |
27 | #endif | 27 | #endif |
28 | 28 | ||
29 | #ifdef HAVE_OPENSSL | 29 | #if defined(HAVE_OPENSSL) |
30 | #include <openssl/ssl.h> | 30 | #include <openssl/ssl.h> |
31 | #else | 31 | #elif defined(HAVE_GNUTLS) |
32 | #include <gnutls/gnutls.h> | 32 | #include <gnutls/gnutls.h> |
33 | #include <gnutls/x509.h> | 33 | #include <gnutls/x509.h> |
34 | #elif defined(HAVE_MBEDTLS) | ||
35 | #include <mbedtls/ssl.h> | ||
36 | #include <mbedtls/entropy.h> | ||
37 | #include <mbedtls/ctr_drbg.h> | ||
34 | #endif | 38 | #endif |
35 | 39 | ||
36 | #ifdef WIN32 | 40 | #ifdef WIN32 |
@@ -49,16 +53,23 @@ | |||
49 | #define DEVICE_VERSION(maj, min, patch) (((maj & 0xFF) << 16) | ((min & 0xFF) << 8) | (patch & 0xFF)) | 53 | #define DEVICE_VERSION(maj, min, patch) (((maj & 0xFF) << 16) | ((min & 0xFF) << 8) | (patch & 0xFF)) |
50 | 54 | ||
51 | struct ssl_data_private { | 55 | struct ssl_data_private { |
52 | #ifdef HAVE_OPENSSL | 56 | #if defined(HAVE_OPENSSL) |
53 | SSL *session; | 57 | SSL *session; |
54 | SSL_CTX *ctx; | 58 | SSL_CTX *ctx; |
55 | #else | 59 | #elif defined(HAVE_GNUTLS) |
56 | gnutls_certificate_credentials_t certificate; | 60 | gnutls_certificate_credentials_t certificate; |
57 | gnutls_session_t session; | 61 | gnutls_session_t session; |
58 | gnutls_x509_privkey_t root_privkey; | 62 | gnutls_x509_privkey_t root_privkey; |
59 | gnutls_x509_crt_t root_cert; | 63 | gnutls_x509_crt_t root_cert; |
60 | gnutls_x509_privkey_t host_privkey; | 64 | gnutls_x509_privkey_t host_privkey; |
61 | gnutls_x509_crt_t host_cert; | 65 | gnutls_x509_crt_t host_cert; |
66 | #elif defined(HAVE_MBEDTLS) | ||
67 | mbedtls_ssl_context ctx; | ||
68 | mbedtls_ssl_config config; | ||
69 | mbedtls_entropy_context entropy; | ||
70 | mbedtls_ctr_drbg_context ctr_drbg; | ||
71 | mbedtls_x509_crt certificate; | ||
72 | mbedtls_pk_context root_privkey; | ||
62 | #endif | 73 | #endif |
63 | }; | 74 | }; |
64 | typedef struct ssl_data_private *ssl_data_t; | 75 | typedef struct ssl_data_private *ssl_data_t; |