Blame SOURCES/0002-userpref-GnuTLS-Use-valid-serial-for-3.6.0.patch

79cfc4
From 3c1ca82ba31945de4e673525afb4774189011ce4 Mon Sep 17 00:00:00 2001
79cfc4
From: Bastien Nocera <hadess@hadess.net>
79cfc4
Date: Fri, 15 Sep 2017 16:02:42 +0200
79cfc4
Subject: [PATCH 2/2] userpref: [GnuTLS] Use valid serial for >= 3.6.0
79cfc4
79cfc4
Another change in 3.6.0 is that a serial of '\0' is not valid anymore.
79cfc4
Bump it to one.
79cfc4
---
79cfc4
 common/userpref.c | 6 +++---
79cfc4
 1 file changed, 3 insertions(+), 3 deletions(-)
79cfc4
79cfc4
diff --git a/common/userpref.c b/common/userpref.c
79cfc4
index f496fee..be745cb 100644
79cfc4
--- a/common/userpref.c
79cfc4
+++ b/common/userpref.c
79cfc4
@@ -598,7 +598,7 @@ userpref_error_t pair_record_generate_keys_and_certs(plist_t pair_record, key_da
79cfc4
 
79cfc4
 	/* generate certificates */
79cfc4
 	gnutls_x509_crt_set_key(root_cert, root_privkey);
79cfc4
-	gnutls_x509_crt_set_serial(root_cert, "\x00", 1);
79cfc4
+	gnutls_x509_crt_set_serial(root_cert, "\x01", 1);
79cfc4
 	gnutls_x509_crt_set_version(root_cert, 3);
79cfc4
 	gnutls_x509_crt_set_ca_status(root_cert, 1);
79cfc4
 	gnutls_x509_crt_set_activation_time(root_cert, time(NULL));
79cfc4
@@ -606,7 +606,7 @@ userpref_error_t pair_record_generate_keys_and_certs(plist_t pair_record, key_da
79cfc4
 	gnutls_x509_crt_sign2(root_cert, root_cert, root_privkey, GNUTLS_DIG_SHA1, 0);
79cfc4
 
79cfc4
 	gnutls_x509_crt_set_key(host_cert, host_privkey);
79cfc4
-	gnutls_x509_crt_set_serial(host_cert, "\x00", 1);
79cfc4
+	gnutls_x509_crt_set_serial(host_cert, "\x01", 1);
79cfc4
 	gnutls_x509_crt_set_version(host_cert, 3);
79cfc4
 	gnutls_x509_crt_set_ca_status(host_cert, 0);
79cfc4
 	gnutls_x509_crt_set_key_usage(host_cert, GNUTLS_KEY_KEY_ENCIPHERMENT | GNUTLS_KEY_DIGITAL_SIGNATURE);
79cfc4
@@ -703,7 +703,7 @@ userpref_error_t pair_record_generate_keys_and_certs(plist_t pair_record, key_da
79cfc4
 		if (GNUTLS_E_SUCCESS == gnutls_error) {
79cfc4
 			/* now generate device certificate */
79cfc4
 			gnutls_x509_crt_set_key(dev_cert, fake_privkey);
79cfc4
-			gnutls_x509_crt_set_serial(dev_cert, "\x00", 1);
79cfc4
+			gnutls_x509_crt_set_serial(dev_cert, "\x01", 1);
79cfc4
 			gnutls_x509_crt_set_version(dev_cert, 3);
79cfc4
 			gnutls_x509_crt_set_ca_status(dev_cert, 0);
79cfc4
 			gnutls_x509_crt_set_activation_time(dev_cert, time(NULL));
79cfc4
-- 
79cfc4
2.14.1
79cfc4