diff options
| author | 2011-09-14 18:55:59 +0200 | |
|---|---|---|
| committer | 2012-03-19 01:43:29 +0100 | |
| commit | 8b1af4cf80eff619d3465925dce7fe572fc09224 (patch) | |
| tree | 1fc167114f574c2ff3470c97d6ce74938778f9db /src/userpref.h | |
| parent | 294cf69b256419e407b1eac04634752412ee7756 (diff) | |
| download | libimobiledevice-8b1af4cf80eff619d3465925dce7fe572fc09224.tar.gz libimobiledevice-8b1af4cf80eff619d3465925dce7fe572fc09224.tar.bz2 | |
Add OpenSSL support
Diffstat (limited to 'src/userpref.h')
| -rw-r--r-- | src/userpref.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/userpref.h b/src/userpref.h index e16fd65..0e959ba 100644 --- a/src/userpref.h +++ b/src/userpref.h | |||
| @@ -22,7 +22,19 @@ | |||
| 22 | #ifndef USERPREF_H | 22 | #ifndef USERPREF_H |
| 23 | #define USERPREF_H | 23 | #define USERPREF_H |
| 24 | 24 | ||
| 25 | #ifdef HAVE_CONFIG_H | ||
| 26 | #include <config.h> | ||
| 27 | #endif | ||
| 28 | |||
| 29 | #ifdef HAVE_OPENSSL | ||
| 30 | typedef struct { | ||
| 31 | unsigned char *data; | ||
| 32 | unsigned int size; | ||
| 33 | } key_data_t; | ||
| 34 | #else | ||
| 25 | #include <gnutls/gnutls.h> | 35 | #include <gnutls/gnutls.h> |
| 36 | typedef gnutls_datum_t key_data_t; | ||
| 37 | #endif | ||
| 26 | 38 | ||
| 27 | #ifndef LIBIMOBILEDEVICE_INTERNAL | 39 | #ifndef LIBIMOBILEDEVICE_INTERNAL |
| 28 | #ifdef WIN32 | 40 | #ifdef WIN32 |
| @@ -41,10 +53,14 @@ | |||
| 41 | 53 | ||
| 42 | typedef int16_t userpref_error_t; | 54 | typedef int16_t userpref_error_t; |
| 43 | 55 | ||
| 56 | #ifdef HAVE_OPENSSL | ||
| 57 | LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_get_keys_and_certs(key_data_t* root_privkey, key_data_t* root_crt, key_data_t* host_privkey, key_data_t* host_crt); | ||
| 58 | #else | ||
| 44 | LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_get_keys_and_certs(gnutls_x509_privkey_t root_privkey, gnutls_x509_crt_t root_crt, gnutls_x509_privkey_t host_privkey, gnutls_x509_crt_t host_crt); | 59 | LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_get_keys_and_certs(gnutls_x509_privkey_t root_privkey, gnutls_x509_crt_t root_crt, gnutls_x509_privkey_t host_privkey, gnutls_x509_crt_t host_crt); |
| 45 | LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_set_keys_and_certs(gnutls_datum_t * root_key, gnutls_datum_t * root_cert, gnutls_datum_t * host_key, gnutls_datum_t * host_cert); | 60 | #endif |
| 46 | LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_get_certs_as_pem(gnutls_datum_t *pem_root_cert, gnutls_datum_t *pem_host_cert); | 61 | LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_set_keys_and_certs(key_data_t * root_key, key_data_t * root_cert, key_data_t * host_key, key_data_t * host_cert); |
| 47 | LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_set_device_public_key(const char *uuid, gnutls_datum_t public_key); | 62 | LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_get_certs_as_pem(key_data_t *pem_root_cert, key_data_t *pem_host_cert); |
| 63 | LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_set_device_public_key(const char *uuid, key_data_t public_key); | ||
| 48 | userpref_error_t userpref_remove_device_public_key(const char *uuid); | 64 | userpref_error_t userpref_remove_device_public_key(const char *uuid); |
| 49 | LIBIMOBILEDEVICE_INTERNAL int userpref_has_device_public_key(const char *uuid); | 65 | LIBIMOBILEDEVICE_INTERNAL int userpref_has_device_public_key(const char *uuid); |
| 50 | userpref_error_t userpref_get_paired_uuids(char ***list, unsigned int *count); | 66 | userpref_error_t userpref_get_paired_uuids(char ***list, unsigned int *count); |
