diff options
| author | 2008-08-03 22:45:15 +0200 | |
|---|---|---|
| committer | 2008-08-05 23:28:10 -0700 | |
| commit | 20a6f8797add1a44aa6ea2cc1d089122d1f39be3 (patch) | |
| tree | 6de90df3a9c8eb115c78758953e95c23253df4e7 /src | |
| parent | 890ac04a0b4b6b6c5e3632de63ac844729f549dc (diff) | |
| download | libimobiledevice-20a6f8797add1a44aa6ea2cc1d089122d1f39be3.tar.gz libimobiledevice-20a6f8797add1a44aa6ea2cc1d089122d1f39be3.tar.bz2 | |
Initialize certificate structure before importing.
Fix return code in lockdownd_init.
Signed-off-by: Matt Colyer <matt@colyer.name>
Diffstat (limited to 'src')
| -rw-r--r-- | src/lockdown.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lockdown.c b/src/lockdown.c index 5f73a49..d5149a9 100644 --- a/src/lockdown.c +++ b/src/lockdown.c | |||
| @@ -233,11 +233,12 @@ int lockdownd_init(iPhone *phone, lockdownd_client **control) | |||
| 233 | public_key = NULL; | 233 | public_key = NULL; |
| 234 | 234 | ||
| 235 | if (ret && host_id && !lockdownd_start_SSL_session(*control, host_id)) { | 235 | if (ret && host_id && !lockdownd_start_SSL_session(*control, host_id)) { |
| 236 | fprintf(stderr, "SSL Session opening failed.\n"); | ||
| 237 | } else { | ||
| 238 | ret = 1; | 236 | ret = 1; |
| 239 | free(host_id); | 237 | free(host_id); |
| 240 | host_id = NULL; | 238 | host_id = NULL; |
| 239 | } else { | ||
| 240 | ret = 0; | ||
| 241 | fprintf(stderr, "SSL Session opening failed.\n"); | ||
| 241 | } | 242 | } |
| 242 | 243 | ||
| 243 | return ret; | 244 | return ret; |
| @@ -369,7 +370,8 @@ int lockdownd_gen_pair_cert(char *public_key_b64, char **device_cert_b64, char * | |||
| 369 | 370 | ||
| 370 | gnutls_x509_privkey_init(&fake_privkey); | 371 | gnutls_x509_privkey_init(&fake_privkey); |
| 371 | gnutls_x509_crt_init(&dev_cert); | 372 | gnutls_x509_crt_init(&dev_cert); |
| 372 | 373 | gnutls_x509_crt_init(&root_cert); | |
| 374 | |||
| 373 | if ( GNUTLS_E_SUCCESS == gnutls_x509_privkey_import_rsa_raw(fake_privkey, &modulus, &exponent, &essentially_null, &essentially_null, &essentially_null, &essentially_null) ) { | 375 | if ( GNUTLS_E_SUCCESS == gnutls_x509_privkey_import_rsa_raw(fake_privkey, &modulus, &exponent, &essentially_null, &essentially_null, &essentially_null, &essentially_null) ) { |
| 374 | 376 | ||
| 375 | gnutls_x509_privkey_init(&root_privkey); | 377 | gnutls_x509_privkey_init(&root_privkey); |
