Diff between ca8bdb762215398897162f82fff899edac35c1ec and 957999c49bd4d52c574c8be19092b9a0b880ca78

Changed Files

File Additions Deletions Status
src/adapter.c +18 -3 modified

Full Patch

diff --git a/src/adapter.c b/src/adapter.c
index 43501cb..e376b8e 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -6165,14 +6165,28 @@ static void store_csrk(const bdaddr_t *local, const bdaddr_t *peer,
 	GKeyFile *key_file;
 	char key_str[33];
 	gsize length = 0;
+	gboolean auth;
 	char *str;
 	int i;
 
-	if (type == 0x00 || type == 0x02)
+	switch (type) {
+	case 0x00:
+		group = "LocalSignatureKey";
+		auth = FALSE;
+		break;
+	case 0x01:
+		group = "RemoteSignatureKey";
+		auth = FALSE;
+		break;
+	case 0x02:
 		group = "LocalSignatureKey";
-	else if (type == 0x01 || type == 0x03)
+		auth = TRUE;
+		break;
+	case 0x03:
 		group = "RemoteSignatureKey";
-	else {
+		auth = TRUE;
+		break;
+	default:
 		warn("Unsupported CSRK type %u", type);
 		return;
 	}
@@ -6191,6 +6205,7 @@ static void store_csrk(const bdaddr_t *local, const bdaddr_t *peer,
 
 	g_key_file_set_string(key_file, group, "Key", key_str);
 	g_key_file_set_integer(key_file, group, "Counter", counter);
+	g_key_file_set_boolean(key_file, group, "Authenticated", auth);
 
 	create_file(filename, S_IRUSR | S_IWUSR);