diff options
author | Jonathan Beck | 2008-08-03 22:45:15 +0200 |
---|---|---|
committer | Matt Colyer | 2008-08-05 23:28:10 -0700 |
commit | 20a6f8797add1a44aa6ea2cc1d089122d1f39be3 (patch) | |
tree | 6de90df3a9c8eb115c78758953e95c23253df4e7 | |
parent | 890ac04a0b4b6b6c5e3632de63ac844729f549dc (diff) | |
download | libplist-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>
-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) 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); |