From: David Herrmann <dh.herrmann@googlemail.com>
To: linux-bluetooth@vger.kernel.org
Cc: johan.hedberg@gmail.com, hadess@hadess.net,
padovan@profusion.mobi,
David Herrmann <dh.herrmann@googlemail.com>
Subject: [PATCH 4/5] Remove 16 byte limit for PIN codes returned by agents
Date: Thu, 5 May 2011 21:17:19 +0200 [thread overview]
Message-ID: <1304623040-30461-4-git-send-email-dh.herrmann@googlemail.com> (raw)
In-Reply-To: <1304623040-30461-1-git-send-email-dh.herrmann@googlemail.com>
Agents can now return PIN codes longer than 16 characters. The
pin parser automatically truncates all PINs to 16 characters, but
allows hexadecimal PINs to be longer than 16 characters because
each two hexdecimal encoded bytes are parsed into one output byte.
---
src/agent.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/agent.c b/src/agent.c
index f87f253..40495bf 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -403,7 +403,7 @@ static void pincode_reply(DBusPendingCall *call, void *user_data)
len = strlen(pin);
dbus_error_init(&err);
- if (len > 16 || len < 1) {
+ if (len < 1) {
error("Invalid PIN length (%zu) from agent", len);
dbus_set_error_const(&err, "org.bluez.Error.InvalidArgs",
"Invalid passkey length");
--
1.7.5
next prev parent reply other threads:[~2011-05-05 19:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-05 19:17 [PATCH 1/5] Add length argument to hci pincode reply David Herrmann
2011-05-05 19:17 ` [PATCH 2/5] Make adapter API accept binary pincodes David Herrmann
2011-05-05 19:17 ` [PATCH 3/5] Parse pin codes starting with '$' as hexadecimal encoded strings David Herrmann
2011-05-05 19:17 ` David Herrmann [this message]
2011-05-05 19:17 ` [PATCH 5/5] Document new "hex-encoded pins" feature David Herrmann
2011-05-14 23:18 ` [PATCH 1/5] Add length argument to hci pincode reply Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1304623040-30461-4-git-send-email-dh.herrmann@googlemail.com \
--to=dh.herrmann@googlemail.com \
--cc=hadess@hadess.net \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=padovan@profusion.mobi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox