Remote device changes for SMP certification

Use Case:
Certification test cases for SMP require various scenarios
where the remote device needs to show a specific behavior
where it fails the pairing in a certain way, and the DUT is
required to abort the pairing properly.
In abcense of a proper PTS suite to execute these test cases,
we can use another device running the same host by configuring
certain run time property.

Test Cases:
TP/SCJW/BI-02-C
TP/SCJW/BV-02-C
TP/SCPK/BI-03-C
TP/SCPK/BI-04-C
TP/SCPK/BV-02-C
TP/SCPK/BV-03-C
TP/SCJW/BI-01-C
TP/SCCT/BV-01-C
TP/SCCT/BV-02-C
TP/SCPK/BI-01-C
TP/SCPK/BI-02-C
TP/SCPK/BV-04-C
TP/SCPK/BV-01-C

Fix:
Added a property in the bt_stack.conf file. The property name
is "SmpFailureCase". The values 2 to 6(inclusive), are forcausing SMP
failures with various failure reasons.
Failure case 1 and 9 are for producing error "Confirm value failure".
Cases 7 and 8 are for generating specific errors at pair cancel.

Note:
The default use of this feature is controlled using a compile
time flag BTM_BLE_SMP_CERTIFICATION.
The BTM_BLE_SMP_CERTIFICATION = TRUE is needed only while we
wait for the PTS support for the LE Secure connections.

Bug: 27852645
Change-Id: I1f7a8ff2659d85b5978b75870c57162a34d394d0
diff --git a/main/stack_config.c b/main/stack_config.c
index 09904e3..3f8b8af 100644
--- a/main/stack_config.c
+++ b/main/stack_config.c
@@ -33,6 +33,7 @@
 const char *PTS_LE_CONN_UPDATED_DISABLED = "PTS_DisableConnUpdates";
 const char *PTS_DISABLE_SDP_LE_PAIR = "PTS_DisableSDPOnLEPair";
 const char *PTS_SMP_PAIRING_OPTIONS_KEY = "PTS_SmpOptions";
+const char *PTS_SMP_FAILURE_CASE_KEY = "PTS_SmpFailureCase";
 
 static config_t *config;
 
@@ -108,6 +109,10 @@
   return config_get_string(config, CONFIG_DEFAULT_SECTION, PTS_SMP_PAIRING_OPTIONS_KEY, NULL);
 }
 
+static int get_pts_smp_failure_case(void) {
+  return config_get_int(config, CONFIG_DEFAULT_SECTION, PTS_SMP_FAILURE_CASE_KEY, 0);
+}
+
 static config_t *get_all(void) {
   return config;
 }
@@ -121,6 +126,7 @@
   get_pts_conn_updates_disabled,
   get_pts_crosskey_sdp_disable,
   get_pts_smp_options,
+  get_pts_smp_failure_case,
   get_all
 };