All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Herrmann <dh.herrmann@googlemail.com>
To: linux-bluetooth@vger.kernel.org
Cc: johan.hedberg@gmail.com, hadess@hadess.net, dforsi@gmail.com,
	David Herrmann <dh.herrmann@googlemail.com>
Subject: [PATCH 4/4] Remove 16 byte limit for PIN codes returned by agents
Date: Sun, 10 Apr 2011 19:11:17 +0200	[thread overview]
Message-ID: <1302455477-27664-5-git-send-email-dh.herrmann@googlemail.com> (raw)
In-Reply-To: <1302455477-27664-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.4.4


  parent reply	other threads:[~2011-04-10 17:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-10 17:11 [RFC][PATCH 0/4] Allow hexadecimal encoded pins David Herrmann
2011-04-10 17:11 ` [PATCH 1/4] Add length argument to hci pincode reply David Herrmann
2011-05-05 17:34   ` Gustavo F. Padovan
2011-04-10 17:11 ` [PATCH 2/4] Make adapter API accept binary pincodes David Herrmann
2011-05-05 17:38   ` Gustavo F. Padovan
2011-04-10 17:11 ` [PATCH 3/4] Parse pin codes starting with '$' as hexadecimal encoded strings David Herrmann
2011-04-10 17:11 ` David Herrmann [this message]
2011-05-02 23:32 ` [RFC][PATCH 0/4] Allow hexadecimal encoded pins Bastien Nocera
2011-05-03 11:51   ` David Herrmann
2011-05-03 12:27     ` Daniele Forsi
2011-05-03 18:28       ` David Herrmann
2011-05-06  1:37         ` Bastien Nocera

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=1302455477-27664-5-git-send-email-dh.herrmann@googlemail.com \
    --to=dh.herrmann@googlemail.com \
    --cc=dforsi@gmail.com \
    --cc=hadess@hadess.net \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.