diff options
| author | 2017-09-15 16:02:42 +0200 | |
|---|---|---|
| committer | 2018-04-27 19:24:36 +0200 | |
| commit | 99f4a332bbfa6886e300318381cb9efa972ca0ac (patch) | |
| tree | 248712fdcebd32ce966499a3838963fb4ee75c7b /common | |
| parent | 90d4399c93ad73871db02eec115f0ac7f6137213 (diff) | |
| download | libimobiledevice-99f4a332bbfa6886e300318381cb9efa972ca0ac.tar.gz libimobiledevice-99f4a332bbfa6886e300318381cb9efa972ca0ac.tar.bz2 | |
userpref: [GnuTLS] Use valid serial for >= 3.6.0
Another change in 3.6.0 is that a serial of '\0' is not valid anymore.
Bump it to one.
Diffstat (limited to 'common')
| -rw-r--r-- | common/userpref.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/userpref.c b/common/userpref.c index f496fee..be745cb 100644 --- a/common/userpref.c +++ b/common/userpref.c | |||
| @@ -598,7 +598,7 @@ userpref_error_t pair_record_generate_keys_and_certs(plist_t pair_record, key_da | |||
| 598 | 598 | ||
| 599 | /* generate certificates */ | 599 | /* generate certificates */ |
| 600 | gnutls_x509_crt_set_key(root_cert, root_privkey); | 600 | gnutls_x509_crt_set_key(root_cert, root_privkey); |
| 601 | gnutls_x509_crt_set_serial(root_cert, "\x00", 1); | 601 | gnutls_x509_crt_set_serial(root_cert, "\x01", 1); |
| 602 | gnutls_x509_crt_set_version(root_cert, 3); | 602 | gnutls_x509_crt_set_version(root_cert, 3); |
| 603 | gnutls_x509_crt_set_ca_status(root_cert, 1); | 603 | gnutls_x509_crt_set_ca_status(root_cert, 1); |
| 604 | gnutls_x509_crt_set_activation_time(root_cert, time(NULL)); | 604 | gnutls_x509_crt_set_activation_time(root_cert, time(NULL)); |
| @@ -606,7 +606,7 @@ userpref_error_t pair_record_generate_keys_and_certs(plist_t pair_record, key_da | |||
| 606 | gnutls_x509_crt_sign2(root_cert, root_cert, root_privkey, GNUTLS_DIG_SHA1, 0); | 606 | gnutls_x509_crt_sign2(root_cert, root_cert, root_privkey, GNUTLS_DIG_SHA1, 0); |
| 607 | 607 | ||
| 608 | gnutls_x509_crt_set_key(host_cert, host_privkey); | 608 | gnutls_x509_crt_set_key(host_cert, host_privkey); |
| 609 | gnutls_x509_crt_set_serial(host_cert, "\x00", 1); | 609 | gnutls_x509_crt_set_serial(host_cert, "\x01", 1); |
| 610 | gnutls_x509_crt_set_version(host_cert, 3); | 610 | gnutls_x509_crt_set_version(host_cert, 3); |
| 611 | gnutls_x509_crt_set_ca_status(host_cert, 0); | 611 | gnutls_x509_crt_set_ca_status(host_cert, 0); |
| 612 | gnutls_x509_crt_set_key_usage(host_cert, GNUTLS_KEY_KEY_ENCIPHERMENT | GNUTLS_KEY_DIGITAL_SIGNATURE); | 612 | gnutls_x509_crt_set_key_usage(host_cert, GNUTLS_KEY_KEY_ENCIPHERMENT | GNUTLS_KEY_DIGITAL_SIGNATURE); |
| @@ -703,7 +703,7 @@ userpref_error_t pair_record_generate_keys_and_certs(plist_t pair_record, key_da | |||
| 703 | if (GNUTLS_E_SUCCESS == gnutls_error) { | 703 | if (GNUTLS_E_SUCCESS == gnutls_error) { |
| 704 | /* now generate device certificate */ | 704 | /* now generate device certificate */ |
| 705 | gnutls_x509_crt_set_key(dev_cert, fake_privkey); | 705 | gnutls_x509_crt_set_key(dev_cert, fake_privkey); |
| 706 | gnutls_x509_crt_set_serial(dev_cert, "\x00", 1); | 706 | gnutls_x509_crt_set_serial(dev_cert, "\x01", 1); |
| 707 | gnutls_x509_crt_set_version(dev_cert, 3); | 707 | gnutls_x509_crt_set_version(dev_cert, 3); |
| 708 | gnutls_x509_crt_set_ca_status(dev_cert, 0); | 708 | gnutls_x509_crt_set_ca_status(dev_cert, 0); |
| 709 | gnutls_x509_crt_set_activation_time(dev_cert, time(NULL)); | 709 | gnutls_x509_crt_set_activation_time(dev_cert, time(NULL)); |
