tools/btgatt-client: Add option to set BT_SECURITY_FIPS
authorŁukasz Rymanowski <lukasz.rymanowski@codecoup.pl>
Fri, 8 May 2020 13:23:49 +0000 (15:23 +0200)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:49 +0000 (14:30 +0530)
Needed for GAP/SEC/SEM/BI-10-C.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
tools/btgatt-client.c

index f08ca3aa859f192a75b180f6330170cb214cb61b..e6b159cbe87af74560f022727d7b88d10039fbaf 100755 (executable)
@@ -1506,8 +1506,8 @@ static void usage(void)
                "\t-d, --dest <addr>\t\tSpecify the destination address\n"
                "\t-t, --type [random|public] \tSpecify the LE address type\n"
                "\t-m, --mtu <mtu> \t\tThe ATT MTU to use\n"
-               "\t-s, --security-level <sec> \tSet security level (low|"
-                                                               "medium|high)\n"
+               "\t-s, --security-level <sec> \tSet security level (low|medium|"
+                                                               "high|fips)\n"
                "\t-v, --verbose\t\t\tEnable extra logging\n"
                "\t-h, --help\t\t\tDisplay help\n");
 }
@@ -1551,6 +1551,8 @@ int main(int argc, char *argv[])
                                sec = BT_SECURITY_MEDIUM;
                        else if (strcmp(optarg, "high") == 0)
                                sec = BT_SECURITY_HIGH;
+                       else if (strcmp(optarg, "fips") == 0)
+                               sec = BT_SECURITY_FIPS;
                        else {
                                fprintf(stderr, "Invalid security level\n");
                                return EXIT_FAILURE;