Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp7057497rdb; Fri, 15 Dec 2023 17:06:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHwux97wI1r51GtaGIwAj78zi3MOwo1JOK7yKhgBnFtIWYFMAYYgJj/wZ4o1Y0lAYLlwc+/ X-Received: by 2002:ad4:5cc4:0:b0:67f:42b:4a68 with SMTP id iu4-20020ad45cc4000000b0067f042b4a68mr5390550qvb.4.1702688780871; Fri, 15 Dec 2023 17:06:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702688780; cv=none; d=google.com; s=arc-20160816; b=PHqd00zGcjvZaJR0DiIIz9xis/f53uPmhgoFUdLeQJFT6bAHaZJG67K2QsBfw451te ZBezillq3h28/fpYHw96NM1U/t9l2ym0OX5JjApgNeqjZwsRNBO/AizJGpeouFGfBVdc 8IWemGOddkS9JBKUMjDk4vPKlzrExZKleifkqtQ2jb05vxle9YsrfmVjeYMvQJXzQNWY 4l8Hqhc9X0X0MqdFJIR9BXBHkE4/DwxdNKXHcoBuamqddWj/I3s4MLIvtZjdHwEj/D5G KrXKDaCKbAWBGupFmTfmiavsgrCen6pVKW/g1UlneZEBbVoceD9OJ0tss3TkMLGm46sH ZHGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:autocrypt:from:references:cc:to:content-language :subject:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:dkim-signature:dkim-signature:message-id; bh=T/wKCh+bfYL4EG0Iec6CYGXhoynGsEYAIN9VGsVepxo=; fh=XYR0Tisu70vYOBzPGyU0WVOZ38H8t/SXpYVyLQ10Xbg=; b=kjrapKMaNy0EVU65rFv3Z+MxSmqL6DEiYjUkVSnM3myVA5VIMDR3lcDXwMyliF/K7Y Mc5MD8Hr8zdEikuQeZe3veE+ZNN32Rcdwon/W31SsNLNPT5oMMzVLHNrLpcvYugGRsAC NskfxaeNo4punUzHx/ckAyavndkMEl6UMniV0pSlCuMzkLUeybjnMvDNzc7HtdSRuwB+ 3Lx/JrE9hwQNFb2KyEXE2uCAICZotSQarD1nG3KoI1uf7lZFQYHvlLBG9XgRS0h6WqAl kV2ti8eM23Bnn1MApHlcY0JASv5hbFrmZCTNGlJbSdBhFTQVmo8SriCKFKWu54QL6P6z Yxvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@archlinux.org header.s=dkim-rsa header.b=qOBxJVY0; dkim=neutral (no key) header.i=@archlinux.org header.s=dkim-ed25519; spf=pass (google.com: domain of linux-bluetooth+bounces-628-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-628-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=archlinux.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id k4-20020a0cf284000000b0067f29a19dd9si50685qvl.120.2023.12.15.17.06.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 17:06:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-628-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@archlinux.org header.s=dkim-rsa header.b=qOBxJVY0; dkim=neutral (no key) header.i=@archlinux.org header.s=dkim-ed25519; spf=pass (google.com: domain of linux-bluetooth+bounces-628-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-628-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=archlinux.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 90C901C233C3 for ; Sat, 16 Dec 2023 01:06:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9741F1116; Sat, 16 Dec 2023 01:06:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=archlinux.org header.i=@archlinux.org header.b="qOBxJVY0"; dkim=permerror (0-bit key) header.d=archlinux.org header.i=@archlinux.org header.b="mjA5mTu0" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail.archlinux.org (mail.archlinux.org [95.216.189.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B436515AF for ; Sat, 16 Dec 2023 01:06:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=archlinux.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=archlinux.org Message-ID: <55903fdb-e970-4b89-b620-daa93bad7811@archlinux.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=archlinux.org; s=dkim-rsa; t=1702688169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=T/wKCh+bfYL4EG0Iec6CYGXhoynGsEYAIN9VGsVepxo=; b=qOBxJVY08lquLUQmwuFeRDqyoaxQs3BcJdkgmQnBvhpcp92cvbPqsylhJoNdNznIJilkAD J5LWJ1u2oWg8m7VVSRtYaIXo/BNc0gStu8Z9sEjwlKtv/QHVtWpkTDVog0nxgzoFGQuMbp 4JHAfiCroDs6Xcm359tZck4FDQUyuVou4J7oxDBR1mU4D+hJmxZex18as9s0zhp+qtRgl6 z/6kPH/A0kR5c+N/zxwyP44g8AQRYpRsfxUUpilXPav5XbxfY0uDIo1Sp7QXmFnKnVIXRQ 0vwLZOobMVVqiJbT77qZiXxpeWMch4EfnWrBR/OXYXoCagFn6GvGKMwc3eHfV5ahsKYC04 /LczPDeMDTmJgtjox1FYszOtbmEZiwZFaei5CAma0Nyg6WcEQc8PlZIeaudakf88x7Oexz ebyEtgXo8D4+qF51byye6CCYB3kn7DokGh5jmRwBMBqrt4msy8b+at248wOmIZkiRWKQuI cho71qLDfsvmIZVLyMjBFareT0SWXrcM8eZ9+BZxEqPpKBXq63nshm9IhxEX/6XdaPLgNd VxiBlFHvTFmsvCt9OLa1Fu5q6ssVPSpzBuYvYvICBpO0Uv649f+L89DJiT+dwIIGJFvfJ9 i4tEjcPwWTow6xyjJzz2HIeh8olcMui8VOHQ/TJnTx/KreTCa2ZQA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=archlinux.org; s=dkim-ed25519; t=1702688169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=T/wKCh+bfYL4EG0Iec6CYGXhoynGsEYAIN9VGsVepxo=; b=mjA5mTu0sJscUzEk9nkygvm2dEvx2KXutvPOgdw9GGa4bkRuB3pm2A/YZbGtOYkgC3M3Ef KUd1x/OS7aBs2RDA== Authentication-Results: mail.archlinux.org; auth=pass smtp.auth=antiz smtp.mailfrom=antiz@archlinux.org Date: Sat, 16 Dec 2023 01:59:51 +0100 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH 1/2] adapter: Fix addr_type for smp_irk/ltk_info/link_key Content-Language: en-US, fr To: Xiao Yao , linux-bluetooth@vger.kernel.org Cc: Xiao Yao References: <20231211162729.1183207-1-xiaokeqinhealth@126.com> From: Robin Candau Autoc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ClW00WJ4WfEV6YjAM4aWa Tlp+r1ju2H88o1adVRFqzccJCuP7OyHsha4Y1xKrouukqFV5iYgmhpQYfosZj5aXaNINFItM xxTKmiIf+xvqQosvABEBAAHCwXwEGAEIACYWIQQmKljsbFH36jlbLi39wwQLkqynSAUCY9Fd kQIbDAUJBaOagAAKCRD9wwQLkqynSDueD/9dmpmoZmRvVe+L+C8lVkUaWdJN8qCKpF2kV7DV mslwhRBSLD5BXslIaUjKPFut3Smw9T8j3h9lY89a8KLPQRZqnhRJdfSq0EZxkpx/rToYIxPA pK3UUDoERtqmFVhXxy1Aee9xaU8j/OP5Ko3LriJY9eRhxET+pRoTLwRkQnKvW2NzjzCGAdyg 5fPLfm59D4NCC0uFCDwCFtpXHUgVOc9owf33P6YiZJBUEwIDOpXGt7UlKF+fwRoUhJpHCYJ/ igr/ctjip9NwiLraQ5DJGhi7VV1JkakJKTKdjnEuaDeWZgl2SiUUlzFDGITM2/+HW2RUENBL Vs8NBnRfODYIk7KH02Wb67vbsC2XyHG2gK+7cC0C/bBajvvoFVPvrnbf792BM5V3A//OFvDU /eKZjC6DlTxfRA8lLW6BieIFlV5c+iVJJcT4x6cOeD2ticOGkt0lAcGhGASp9jGnWqGF9jdB 2PluFxMbl0DDiLqy22SphzrKLSdBUWAjoWPyAzDx9zBoEvyOEfQrkGFSfhFUzvd26MhNFPOP Kjre3i6ZNRDNxKl0SsEz1PvPsI9opRllIm+2kYf5afiqZKYsly4ydNl3WQ02IR7ZGDfVXM8z 58YtYYnZBkcGLLafH0584y8+mOJpcDR7wqX2IUu14qcvoRT1Cb9/6ZS5s4ZSrdhY1YEifw== In-Reply-To: <20231211162729.1183207-1-xiaokeqinhealth@126.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------R3lDKX0aq7esnoekmafxhyOz" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------R3lDKX0aq7esnoekmafxhyOz Content-Type: multipart/mixed; boundary="------------0Ap9vbGReHzQa1oxlLIKQgfs"; protected-headers="v1" From: Robin Candau To: Xiao Yao , linux-bluetooth@vger.kernel.org Cc: Xiao Yao Message-ID: <55903fdb-e970-4b89-b620-daa93bad7811@archlinux.org> Subject: Re: [PATCH 1/2] adapter: Fix addr_type for smp_irk/ltk_info/link_key References: <20231211162729.1183207-1-xiaokeqinhealth@126.com> In-Reply-To: <20231211162729.1183207-1-xiaokeqinhealth@126.com> --------------0Ap9vbGReHzQa1oxlLIKQgfs Content-Type: multipart/mixed; boundary="------------yJiEFh18uPHPx66G0VhV2PYZ" --------------yJiEFh18uPHPx66G0VhV2PYZ Content-Type: multipart/alternative; boundary="------------rPYk7oy4fcL9aqfoGqOq0xg4" --------------rPYk7oy4fcL9aqfoGqOq0xg4 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 T24gMTIvMTEvMjMgMTc6MjcsIFhpYW8gWWFvIHdyb3RlOg0KPiBGcm9tOiBYaWFvIFlhbzx4 aWFveWFvQHJvY2stY2hpcHMuY29tPg0KPg0KPiBBY2NvcmRpbmcgdG8gQkxVRVRPT1RIIENP UkUgU1BFQ0lGSUNBVElPTiBWZXJzaW9uIDUuNCB8IFZvbCAzLA0KPiBQYXJ0IEgsIDIuNC4y NC8yLjQuMjUsIFRoZSBMRSBMVEsgYW5kIEJSL0VEUiBsaW5rIGtleXMgY2FuIGJlDQo+IGNv bnZlcnRlZCBiZXR3ZWVuIGVhY2ggb3RoZXIsIHNvIHRoZSBhZGRyIHR5cGUgY2FuIGJlIGVp dGhlcg0KPiBCUkVEUiBvciBMRSwgc28gZml4IGl0Lg0KPg0KPiBTaWduZWQtb2ZmLWJ5OiBY aWFvIFlhbzx4aWFveWFvQHJvY2stY2hpcHMuY29tPg0KPiAtLS0NCj4gICBzcmMvYWRhcHRl ci5jIHwgMjAgKysrKysrKysrKysrKystLS0tLS0NCj4gICAxIGZpbGUgY2hhbmdlZCwgMTQg aW5zZXJ0aW9ucygrKSwgNiBkZWxldGlv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gMTE6MDM6MTggQXJjaC1EZXNrdG9wIGJsdWV0b290aGRbNTkyXTogRmFp bGVkIHRvIGxvYWQgbGluayBrZXlzIA0KZm9yIGhjaTA6IEludmFsaWQgUGFyYW1ldGVycyAo MHgwZCkNClsuLi5dDQoNCioqSSBiaXNlY3RlZCB0aGUgYnVnIHdpdGggYGdpdCBiaXNlY3Rg IGFuZCBpdCBwb2ludGVkIG91dCB0aGlzIGNvbW1pdCANClsxXSBhcyB0aGUgImZhdWx0eSIg b25lLg0KSSBjYW4gY29uZmlybSB0aGF0IHJldmVydGluZyBpdCBzb2x2ZXMgdGhlIGlzc3Vl Lg0KDQpJIHJlcG9ydGVkIHRoaXMgYnVnIGluY2x1ZGluZyBkZXRhaWxzIGluIHRoZSBHaXRI dWIgcmVwbyBbMl0uDQoNCkkgcmVtYWluIGF2YWlsYWJsZSBpZiBhbnkgYWRkaXRpb25hbCBp bmZvcm1hdGlvbiBhcmUgbmVlZGVkLg0KDQpbMV0gDQpodHRwczovL2dpdGh1Yi5jb20vYmx1 ZXovYmx1ZXovY29tbWl0L2Q1NTM2ZTBjZDQzMWUyMmJlOWExMTMyYmU2ZDRhZjI0NDU1OTA2 MzMNClsyXSBodHRwczovL2dpdGh1Yi5jb20vYmx1ZXovYmx1ZXovaXNzdWVzLzY4NnwNCnwN Cg0KLS0gDQpSZWdhcmRzLA0KUm9iaW4gQ2FuZGF1IC8gQW50aXoNCg0K --------------rPYk7oy4fcL9aqfoGqOq0xg4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 12/11/23 17:27, Xiao Yao wrote:
=
From: Xiao Yao <xiaoyao@=
rock-chips.com>

According to BLUETOOTH CORE SPECIFICATION Version 5.4 | Vol 3,
Part H, 2.4.24/2.4.25, The LE LTK and BR/EDR link keys can be
converted between each other, so the addr type can be either
BREDR or LE, so fix it.

Signed-off-by: Xiao Yao <xiaoyao@rock-chips.com>
---
 src/adapter.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index 86fff72bc..ee70b00d2 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -170,6 +170,7 @@ static GSList *conn_fail_list =3D NULL;
=20
 struct link_key_info {
 	bdaddr_t bdaddr;
+	uint8_t bdaddr_type;
 	unsigned char key[16];
 	uint8_t type;
 	uint8_t pin_len;
@@ -3964,7 +3965,9 @@ static bool is_blocked_key(uint8_t key_type, uint8_=
t *key_value)
 	return false;
 }
=20
-static struct link_key_info *get_key_info(GKeyFile *key_file, const char=
 *peer)
+static struct link_key_info *get_key_info(GKeyFile *key_file, const char=
 *peer,
+					uint8_t bdaddr_type)
+
 {
 	struct link_key_info *info =3D NULL;
 	char *str;
@@ -3976,6 +3979,7 @@ static struct link_key_info *get_key_info(GKeyFile =
*key_file, const char *peer)
 	info =3D g_new0(struct link_key_info, 1);
=20
 	str2ba(peer, &info->bdaddr);
+	info->bdaddr_type =3D bdaddr_type;
=20
 	if (!strncmp(str, "0x", 2))
 		str2buf(&str[2], info->key, sizeof(info->key));
@@ -4343,7 +4347,7 @@ static void load_link_keys(struct btd_adapter *adap=
ter, GSList *keys,
 		struct link_key_info *info =3D l->data;
=20
 		bacpy(&key->addr.bdaddr, &info->bdaddr);
-		key->addr.type =3D BDADDR_BREDR;
+		key->addr.type =3D info->bdaddr_type;
 		key->type =3D info->type;
 		memcpy(key->val, info->key, 16);
 		key->pin_len =3D info->pin_len;
@@ -4598,14 +4602,18 @@ static void load_conn_params(struct btd_adapter *=
adapter, GSList *params)
 		btd_error(adapter->dev_id, "Load connection parameters failed");
 }
=20
-static uint8_t get_le_addr_type(GKeyFile *keyfile)
+static uint8_t get_addr_type(GKeyFile *keyfile)
 {
 	uint8_t addr_type;
 	char *type;
=20
+	/* The AddressType is written to file only When dev->le is
+	 * set to true, as referenced in the update_technologies().
+	 * Therefore, When type is NULL, it default to BDADDR_BREDR.
+	 */
 	type =3D g_key_file_get_string(keyfile, "General", "AddressType", NULL)=
;
 	if (!type)
-		return BDADDR_LE_PUBLIC;
+		return BDADDR_BREDR;
=20
 	if (g_str_equal(type, "public"))
 		addr_type =3D BDADDR_LE_PUBLIC;
@@ -4914,9 +4922,9 @@ static void load_devices(struct btd_adapter *adapte=
r)
 			g_clear_error(&gerr);
 		}
=20
-		key_info =3D get_key_info(key_file, entry->d_name);
+		bdaddr_type =3D get_addr_type(key_file);
=20
-		bdaddr_type =3D get_le_addr_type(key_file);
+		key_info =3D get_key_info(key_file, entry->d_name, bdaddr_type);
=20
 		ltk_info =3D get_ltk_info(key_file, entry->d_name, bdaddr_type);
=20

Hello,

It seems like the above commit introduced a regression where the initial auto-connect for Bluetooth devices doesn't work anymore.

Indeed, at system startup, starting a Bluetooth device will cause it to go in a "connected/disconnected" state loop, requiring to initialize a manual connection first (with sometimes multiple attempts needed) before getting it connected correctly and working as intended.

`systemctl status bluetooth` reports the following error:

[...]
d=C3=A9c. 15 11:03:18 Arch-Desktop bluetoothd[592]: Failed to load = link keys for hci0: Invalid Parameters (0x0d)
[...]

I bisected the bug with `git bisect` and it pointed out this commit [1] as the "faulty" one.
I can confirm that reverting it solves the issue.

I reported this bug including details in the GitHub repo [2].

I remain available if any additional information are needed.

[1] https://github.com/blue= z/bluez/commit/d5536e0cd431e22be9a1132be6d4af2445590633
[2] https://github.com/bluez/bluez/issues/686

--=20
Regards,
Robin Candau / Antiz
--------------rPYk7oy4fcL9aqfoGqOq0xg4-- --------------yJiEFh18uPHPx66G0VhV2PYZ Content-Type: application/pgp-keys; name="OpenPGP_0xFDC3040B92ACA748.asc" Content-Disposition: attachment; filename="OpenPGP_0xFDC3040B92ACA748.asc" Content-Description: OpenPGP public key Content-Transfer-Encoding: quoted-printable -----BEGIN PGP PUBLIC KEY BLOCK----- xsFNBGPRXZEBEADGfMANmAN/uCUdnzSThtfHJB84a4kmEt5f68BzohASR6++zyl4 3tZhyjM1BVNaqL2gG0nzulpEaMkeJmcojFXnzv4d8+ess9qWUELr9P3W38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bLi39wwQLkqynSAUCY9Fd kQIbDAUJBaOagAAKCRD9wwQLkqynSDueD/9dmpmoZmRvVe+L+C8lVkUaWdJN8qCK pF2kV7DVmslwhRBSLD5BXslIaUjKPFut3Smw9T8j3h9lY89a8KLPQRZqnhRJdfSq 0EZxkpx/rToYIxPApK3UUDoERtqmFVhXxy1Aee9xaU8j/OP5Ko3LriJY9eRhxET+ pRoTLwRkQnKvW2NzjzCGAdyg5fPLfm59D4NCC0uFCDwCFtpXHUgVOc9owf33P6Yi ZJBUEwIDOpXGt7UlKF+fwRoUhJpHCYJ/igr/ctjip9NwiLraQ5DJGhi7VV1JkakJ KTKdjnEuaDeWZgl2SiUUlzFDGITM2/+HW2RUENBLVs8NBnRfODYIk7KH02Wb67vb sC2XyHG2gK+7cC0C/bBajvvoFVPvrnbf792BM5V3A//OFvDU/eKZjC6DlTxfRA8l LW6BieIFlV5c+iVJJcT4x6cOeD2ticOGkt0lAcGhGASp9jGnWqGF9jdB2PluFxMb l0DDiLqy22SphzrKLSdBUWAjoWPyAzDx9zBoEvyOEfQrkGFSfhFUzvd26MhNFPOP Kjre3i6ZNRDNxKl0SsEz1PvPsI9opRllIm+2kYf5afiqZKYsly4ydNl3WQ02IR7Z GDfVXM8z58YtYYnZBkcGLLafH0584y8+mOJpcDR7wqX2IUu14qcvoRT1Cb9/6ZS5 s4ZSrdhY1YEifw=3D=3D =3Di8fF -----END PGP PUBLIC KEY BLOCK----- --------------yJiEFh18uPHPx66G0VhV2PYZ-- --------------0Ap9vbGReHzQa1oxlLIKQgfs-- --------------R3lDKX0aq7esnoekmafxhyOz Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEEJipY7GxR9+o5Wy4t/cMEC5Ksp0gFAmV89ocFAwAAAAAACgkQ/cMEC5Ksp0iV VhAAp7aTzzWjgli+RznsCpgw1GEvOT1eFi8kBe0MzGYOjBvwGXOYFqFTHHBGEW7hmbKkg0Pyo7em +/AJwmuvnd3f9fD7O+pFRBGioXjXoJzoO1svRTYCNUzd4c5T94Bnlc6WwxQuvuzJlDnuvUAemZUp hlkyjXG8y4jfeShIE7SZoPxQxhnKsdkNVvm1xa+ssBUJbmTPY8bd41FZcQ3WSWY6baSzGACwAQS/ MGGeSvv8LfFNBgg5XTLBrKmWLU5/eynuTvRJTb1yzkmQaUXUBwZKdc9T4CEhyQl/EUsyh1IMTBkn rFKtsJYrGGM5yLnJSPeHBBiJC/YEE0cKT17nw5CIdjdbcYwHtpTOGjiMOYKPMV+Yrmtyz5f5ynyA KFw7vIwBm3QqCjbQ0Sn1jJZSlww8Qd+0iXarGzlKqRHP3OJ3+eR/LhZ/Qe3AU8b1la+M/CSTOEAp QlZIen2TAXIQkJLUbCLzPSF7SMadSOauc76UGwk4YVJ17ljQuJgcPAJGzMsoRuvWQ+fTNa2n1hle e7D6k+heay3RfcQOBkNMvFCpTEIBOr7woqcOcZrxGZfPlJx7qBM1gfIM3Tct4UaExaEg7g54xZJb 5hX2u23YjTpciHI+K42X3bByyWiJ58ctQyeavQGzkohtViAyr2N4WrgJ56z8XH7Gea2BXCGZ6nt+ 6g8= =evCP -----END PGP SIGNATURE----- --------------R3lDKX0aq7esnoekmafxhyOz--