diff --git a/src/gatt-database.c b/src/gatt-database.c
index 22c78e8..99c8ea2 100644
--- a/src/gatt-database.c
+++ b/src/gatt-database.c
}
if (opcode == BT_ATT_OP_PREP_WRITE_REQ) {
- if (!desc->prep_authorized && desc->req_prep_authorization)
+ if (!device_is_trusted(device) && !desc->prep_authorized &&
+ desc->req_prep_authorization)
send_write(device, attrib, desc->proxy,
desc->pending_writes, id, value, len,
offset, bt_att_get_link_type(att),
queue = NULL;
if (opcode == BT_ATT_OP_PREP_WRITE_REQ) {
- if (!chrc->prep_authorized && chrc->req_prep_authorization)
+ if (!device_is_trusted(device) && !chrc->prep_authorized &&
+ chrc->req_prep_authorization)
send_write(device, attrib, chrc->proxy, queue,
id, value, len, offset,
bt_att_get_link_type(att), true, true);