* [PATCH obexd 1/2] gobex: fix checking connection id for ABORT
@ 2011-11-08 12:58 Luiz Augusto von Dentz
2011-11-08 12:58 ` [PATCH obexd 2/2] gobex: make connection id check less strict Luiz Augusto von Dentz
0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2011-11-08 12:58 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
OBEX spec state that it is optional to send a Connection Id header in an
OBEX ABORT operation.
Reported by Hendrik Sattler <post@hendrik-sattler.de>
---
gobex/gobex.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/gobex/gobex.c b/gobex/gobex.c
index 86e1c4a..b0f3716 100644
--- a/gobex/gobex.c
+++ b/gobex/gobex.c
@@ -705,9 +705,16 @@ static void handle_request(GObex *obex, GObexPacket *req)
op = g_obex_packet_get_operation(req, NULL);
- if (op == G_OBEX_OP_CONNECT)
+ switch (op) {
+ case G_OBEX_OP_CONNECT:
parse_connect_data(obex, req);
- else if (check_connid(obex, req) == FALSE) {
+ break;
+ case G_OBEX_OP_ABORT:
+ break;
+ default:
+ if (check_connid(obex, req))
+ break;
+
g_obex_debug(G_OBEX_DEBUG_ERROR, "Invalid Connection ID");
g_obex_send_rsp(obex, G_OBEX_RSP_SERVICE_UNAVAILABLE, NULL,
G_OBEX_HDR_INVALID);
--
1.7.6.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH obexd 2/2] gobex: make connection id check less strict
2011-11-08 12:58 [PATCH obexd 1/2] gobex: fix checking connection id for ABORT Luiz Augusto von Dentz
@ 2011-11-08 12:58 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2011-11-08 12:58 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
OBEX spec says:
Only the first packet in the request needs to contain the Connection
Id header...
If a Connection Id header is received with an invalid connection
identifier, it is recommended that the operation be rejected with the
response code (0xD3) “Service Unavailable”.
Since not all requests packets need to contain Connection Id header we
should only try to validate it if it is part of the packet.
Reported by Hendrik Sattler <post@hendrik-sattler.de>
---
gobex/gobex.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gobex/gobex.c b/gobex/gobex.c
index b0f3716..f685162 100644
--- a/gobex/gobex.c
+++ b/gobex/gobex.c
@@ -691,7 +691,7 @@ static gboolean check_connid(GObex *obex, GObexPacket *pkt)
hdr = g_obex_packet_get_header(pkt, G_OBEX_HDR_CONNECTION);
if (hdr == NULL)
- return FALSE;
+ return TRUE;
g_obex_header_get_uint32(hdr, &id);
--
1.7.6.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-08 12:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-08 12:58 [PATCH obexd 1/2] gobex: fix checking connection id for ABORT Luiz Augusto von Dentz
2011-11-08 12:58 ` [PATCH obexd 2/2] gobex: make connection id check less strict Luiz Augusto von Dentz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).