public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans Juergen Gamauf <gamauf@sbox.tugraz.at>
To: bluez-users@lists.sourceforge.net
Subject: [Bluez-users] Problem with RFCOMM/Socket and security
Date: Tue, 12 Dec 2006 21:25:46 +0100	[thread overview]
Message-ID: <457F104A.3020508@sbox.tugraz.at> (raw)

Hello to all!

I'm working with an Embedded System (Arm 9, Linux 2.6.17.3, Uart
Bluetooth Module from Bluegiga WT11) with Bluez, but without using
/etc/bluetooth/hcid.conf
I'm starting it with

/usr/sbin/hciattach /dev/ttyS1 csr 115200
/usr/sbin/hciconfig hci0 up

and can set it up using hciconfig (currently I only set the name)

Now I want to establish a simple RFCOMM-Socket-Connection between two of
these systems through

////// Server
_sock = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
loc_addr.rc_family = AF_BLUETOOTH;
loc_addr.rc_bdaddr = *BDADDR_ANY;
loc_addr.rc_channel = (uint8_t) 1;
bind(_sock, (struct sockaddr *)&loc_addr, sizeof(loc_addr));
listen(_sock, 1);
_clientSock = accept(_sock, (struct sockaddr *)&rem_addr, (socklen_t*)&opt);


Everything works fine!


But now I want to Authenticate and Encrypt this Connection, so I inserted

opt = RFCOMM_LM_AUTH|RFCOMM_LM_ENCRYPT;
setsockopt(_sock, SOL_RFCOMM, RFCOMM_LM, &opt, sizeof(opt));

after creating the socket, both on the server and the client, but now
the connection cannot be established, of course, the pin is missing
but where can I introduce it? I have no hcid.conf, so no pin_helper and
so on, is it possible to tell bluez the pin through this programm?





One little other problem:
I have many clients, and I want that only one connection at a time can
be established, but when one client is talking to the server, the next
client can establish it (connect returns 0) and can send the data, but I
don't know who receives the data
Is it possible to reject the connection from the server if he is dealing
already a client?




Thank you in advance!

regards,

Hans Juergen



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

             reply	other threads:[~2006-12-12 20:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-12 20:25 Hans Juergen Gamauf [this message]
2006-12-15  7:07 ` [Bluez-users] Problem with RFCOMM/Socket and security amateur
  -- strict thread matches above, loose matches on Subject: below --
2006-12-12 19:30 Hans Juergen Gamauf

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=457F104A.3020508@sbox.tugraz.at \
    --to=gamauf@sbox.tugraz.at \
    --cc=bluez-users@lists.sourceforge.net \
    /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