Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1949225lqg; Mon, 4 Mar 2024 08:24:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXm7KqHpYxkqUZikriKI1MTSdwC2Z+S7DaSH6w/+69BNdgMuxW5ahefO9MTRcxqX8zz+m73cv9jvDqKAh3P3QOZZWJnvgjHvhPPyuD6CA== X-Google-Smtp-Source: AGHT+IGBENcgE8ChLXtTdlN3czpZ52cXXiCp1OyL0wRxam5l8YHXwPfKWWU+WnrDt60QzYfKTl/S X-Received: by 2002:a05:6830:3499:b0:6e4:e561:6ba7 with SMTP id c25-20020a056830349900b006e4e5616ba7mr4530318otu.25.1709569486192; Mon, 04 Mar 2024 08:24:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709569486; cv=pass; d=google.com; s=arc-20160816; b=wGKRg/xqZh6nJ4ThBTC3Zj4EqSAHw97vWFCHDXiJBI9j4NqX7thol3/mFvLJrDiRYV 48bkLcIIgzyWnbeG8gKPTqxllrHt4uOtadLJDcm3Bh75EOR/zMRs0jenlB+KDyb/x5d2 Xz0gT2PofAWyhUvohfl5TWbYzm+vJpxvujIu+FlLMnKjBGT+bsJZ1R4pdGTp07Eeytcb TXIGhs8gxmJ8Oidy6DtPLXbav/OC14KgGmZ2DxS1LWEa4MtU+YjhMIY/VCdnPiFtumfz LE2iUkIu7M5/H5tAit7oIF6ZXo5czf5FkSqI6sdAla9NO/H8klLgL4N4H2Nlf+eQZ8TJ 9Xjw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=Deo75maeJiYNcFLY7fHOVoCKe4Wv78mnJAZ+onx4KCY=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=puM0viHAG7vkeSOyeuYZGtXXWboQs9kw3a0255AIXUoCEokRtCaSXAN6rGmluCoz3p +bk4l/0YYhEvAjQLGkWqTbRBDRhb8sy25Wb0RECWVo6RwTDHX+osm1qmGGH495TIF1ub LE7OBrvN4JNaLsOU7RQpPYik9JGG3HqLkOItqFG+gD9ctuYqgbp1mW5N3u8uaDfkvU5/ cx3II0wt+Aq9iCP6DtgSMpO7ZKgk3a56JIV6AJXEQm//haawYsW9K3LcPMPCcce7gH9Q M0sROLvbgjvu9NmYoIi7xN5HtMSijU2euN/QEk6luE++MLuxos4zuKPSWlHCpJdQua/t 9rCg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=jpaNeX09; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-bluetooth+bounces-2274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2274-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b27-20020a631b5b000000b005e47d608cbesi8404314pgm.134.2024.03.04.08.24.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 08:24:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-2274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=jpaNeX09; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-bluetooth+bounces-2274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2274-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9975BB21DBE for ; Mon, 4 Mar 2024 15:58:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C5BA93FB02; Mon, 4 Mar 2024 15:58:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="jpaNeX09" X-Original-To: linux-bluetooth@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 9EBA647A6A for ; Mon, 4 Mar 2024 15:58:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709567929; cv=none; b=dqpyZE2wNDwmMivU02wrq8VmSWoatSXx6g6F9Z0z2EN0VNimbCgCJB0T36Y75nRKKPSP8cYXfzs/L7huQNPDKXSntkmeAsP+GkNt7QejWRbhXUVxSDlBXEOcBl7bpSeB73wBZrPC0XxZqex42SoPDumF9vpBPFo6mtQhzgC891o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709567929; c=relaxed/simple; bh=qtwPI1qL+AOO+vwZwWzhKKYZrJ4AUsr99dOpvzZ+6F4=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=gmDul7DOz4MHPVlphUyw4MSnKs5ekNgVMrx/i42q+bfC+Or8UngRTwA0KTVn2Mq0Kgl/AgQFMoQAHxuY2pMhjSFdupaJB92kiED+oAeoeXTBRYVkwHZdyYmZje4elmQMt0OTg5DxOaDT5BzYJ/YYse4bfDUDmyMta0eo0ljueCo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=jpaNeX09; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1709567926; bh=qtwPI1qL+AOO+vwZwWzhKKYZrJ4AUsr99dOpvzZ+6F4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jpaNeX09j+JeXIuvDnR7M4x/QqwzHL1igAwH+B2FHs6BuyP7v91mg11bRBBZlXFjE 15PuswfJLDYE/oUF2qSH85oobFgsAqexJBIE+jZunRTCXC7NJZRP+rF6Kg7EGQ5o6V QrqRm8QEqcCXjEnJ+GlB2HvwdcAC9eFwyjWx/ug9y4BpL/8MpF3oFMkBM0v1PA7Ica XzHdWgN1HcRdc2ovZC6UKHaTm6pvRr+fXJgVMtWchLd4Y/4aTE27N3Hd8eNsHIU6xn /Lp2wBr3CTjWzYo7rr23SBDYtxg9DHlTJotQJcpqzfms9DnTzqtVJqN5oHP1iFCTz7 FK+EMM462kcpQ== Received: from fdanis-XPS-13-9370.. (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: fdanis) by madrid.collaboradmins.com (Postfix) with ESMTPSA id BFA7037820C8 for ; Mon, 4 Mar 2024 15:58:45 +0000 (UTC) From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= To: linux-bluetooth@vger.kernel.org Subject: [RESEND PATCH BlueZ v2 1/2] gatt-server: Add support for signed write command Date: Mon, 4 Mar 2024 16:58:38 +0100 Message-Id: <20240304155839.48888-2-frederic.danis@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240304155839.48888-1-frederic.danis@collabora.com> References: <20240304155839.48888-1-frederic.danis@collabora.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit GAP/SEC/CSIGN/BV-02-C request the ability to check that signed write has been performed successfully. --- v1 -> v2: No change --- src/shared/gatt-server.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/shared/gatt-server.c b/src/shared/gatt-server.c index c7ce3ec1f..0e399ceb1 100644 --- a/src/shared/gatt-server.c +++ b/src/shared/gatt-server.c @@ -106,6 +106,7 @@ struct bt_gatt_server { unsigned int read_multiple_vl_id; unsigned int prep_write_id; unsigned int exec_write_id; + unsigned int signed_write_cmd_id; uint8_t min_enc_size; @@ -155,6 +156,7 @@ static void bt_gatt_server_free(struct bt_gatt_server *server) bt_att_unregister(server->att, server->read_multiple_vl_id); bt_att_unregister(server->att, server->prep_write_id); bt_att_unregister(server->att, server->exec_write_id); + bt_att_unregister(server->att, server->signed_write_cmd_id); queue_destroy(server->prep_queue, prep_write_data_destroy); @@ -777,7 +779,8 @@ static void write_complete_cb(struct gatt_db_attribute *attr, int err, struct bt_gatt_server *server = op->server; uint16_t handle; - if (op->opcode == BT_ATT_OP_WRITE_CMD) { + if (op->opcode == BT_ATT_OP_WRITE_CMD || + op->opcode == BT_ATT_OP_SIGNED_WRITE_CMD) { async_write_op_destroy(op); return; } @@ -1628,6 +1631,14 @@ static bool gatt_server_register_att_handlers(struct bt_gatt_server *server) if (!server->exec_write_id) return NULL; + /* Signed Write Command */ + server->signed_write_cmd_id = bt_att_register(server->att, + BT_ATT_OP_SIGNED_WRITE_CMD, + write_cb, + server, NULL); + if (!server->signed_write_cmd_id) + return false; + return true; } -- 2.34.1