summaryrefslogtreecommitdiffstats
path: root/src/lockdown.c
diff options
context:
space:
mode:
authorGravatar Jonathan Beck2008-08-03 22:45:15 +0200
committerGravatar Matt Colyer2008-08-05 23:28:10 -0700
commit20a6f8797add1a44aa6ea2cc1d089122d1f39be3 (patch)
tree6de90df3a9c8eb115c78758953e95c23253df4e7 /src/lockdown.c
parent890ac04a0b4b6b6c5e3632de63ac844729f549dc (diff)
downloadlibplist-20a6f8797add1a44aa6ea2cc1d089122d1f39be3.tar.gz
libplist-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/lockdown.c')
-rw-r--r--src/lockdown.c8
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)
public_key = NULL;
if (ret && host_id && !lockdownd_start_SSL_session(*control, host_id)) {
- fprintf(stderr, "SSL Session opening failed.\n");
- } else {
ret = 1;
free(host_id);
host_id = NULL;
+ } else {
+ ret = 0;
+ fprintf(stderr, "SSL Session opening failed.\n");
}
return ret;
@@ -369,7 +370,8 @@ int lockdownd_gen_pair_cert(char *public_key_b64, char **device_cert_b64, char *
gnutls_x509_privkey_init(&fake_privkey);
gnutls_x509_crt_init(&dev_cert);
-
+ gnutls_x509_crt_init(&root_cert);
+
if ( GNUTLS_E_SUCCESS == gnutls_x509_privkey_import_rsa_raw(fake_privkey, &modulus, &exponent, &essentially_null, &essentially_null, &essentially_null, &essentially_null) ) {
gnutls_x509_privkey_init(&root_privkey);