summaryrefslogtreecommitdiffstats
path: root/hcid/security.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-04-17 00:43:37 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-04-17 00:43:37 +0000
commit18ebe398a14f4f26025db652c312dadeec8fa555 (patch)
tree972c2235f18fc75de26755b3cf88b946638737f5 /hcid/security.c
parentd9b8bee3e56f58da1f71ad9d12c49031015b76d0 (diff)
Add support for stored pin codes
Diffstat (limited to 'hcid/security.c')
-rw-r--r--hcid/security.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/hcid/security.c b/hcid/security.c
index e66e030e..1c4d988f 100644
--- a/hcid/security.c
+++ b/hcid/security.c
@@ -144,6 +144,7 @@ static void link_key_request(int dev, bdaddr_t *sba, bdaddr_t *dba)
}
}
+#if 0
static void save_link_key(struct link_key *key)
{
struct link_key *exist;
@@ -185,6 +186,7 @@ static void save_link_key(struct link_key *key)
failed:
close(f);
}
+#endif
static void link_key_notify(int dev, bdaddr_t *sba, void *ptr)
{
@@ -202,14 +204,16 @@ static void link_key_notify(int dev, bdaddr_t *sba, void *ptr)
key.type = evt->key_type;
key.time = time(0);
+#if 0
save_link_key(&key);
+#endif
write_link_key(sba, dba, evt->link_key, evt->key_type);
}
/* PIN code handling */
-int read_pin_code(void)
+static int read_default_pin_code(void)
{
char buf[17];
FILE *f;
@@ -542,7 +546,7 @@ void stop_security_manager(int hdev)
void init_security_data(void)
{
/* Set local PIN code */
- if (read_pin_code() < 0) {
+ if (read_default_pin_code() < 0) {
strcpy(hcid.pin_code, "BlueZ");
hcid.pin_len = 5;
}