diff --git a/obuspa/Makefile b/obuspa/Makefile index 01d80d7a4..70e446fd3 100644 --- a/obuspa/Makefile +++ b/obuspa/Makefile @@ -5,13 +5,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=obuspa -PKG_VERSION:=10.0.4.2 +PKG_VERSION:=10.0.5.0 LOCAL_DEV:=0 ifneq ($(LOCAL_DEV),1) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git -PKG_SOURCE_VERSION:=65dabfdb8fbb2f3c2590f3bfb2fabedef8dcd76e +PKG_SOURCE_VERSION:=ccd245d5405f0032bac234e143be41a21f1edd2a PKG_MAINTAINER:=Vivek Dutta PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz PKG_MIRROR_HASH:=skip diff --git a/obuspa/patches/0002-fix_e2e_session_init.patch b/obuspa/patches/0002-fix_e2e_session_init.patch index 6c9e24be4..0bfc134ef 100644 --- a/obuspa/patches/0002-fix_e2e_session_init.patch +++ b/obuspa/patches/0002-fix_e2e_session_init.patch @@ -1,8 +1,8 @@ -Index: obuspa-10.0.4.0/src/core/device_controller.c +Index: obuspa-10.0.5.0/src/core/device_controller.c =================================================================== ---- obuspa-10.0.4.0.orig/src/core/device_controller.c -+++ obuspa-10.0.4.0/src/core/device_controller.c -@@ -4214,6 +4214,14 @@ int ProcessControllerAdded(int cont_inst +--- obuspa-10.0.5.0.orig/src/core/device_controller.c ++++ obuspa-10.0.5.0/src/core/device_controller.c +@@ -4223,6 +4223,14 @@ int ProcessControllerAdded(int cont_inst goto exit; } @@ -17,7 +17,7 @@ Index: obuspa-10.0.4.0/src/core/device_controller.c // Exit if unable to get the object instance numbers present in this controller's MTP table USP_SNPRINTF(path, sizeof(path), "%s.%d.MTP", device_cont_root, cont_instance); err = DATA_MODEL_GetInstances(path, &iv); -@@ -4255,14 +4263,6 @@ int ProcessControllerAdded(int cont_inst +@@ -4264,14 +4272,6 @@ int ProcessControllerAdded(int cont_inst DEVICE_MQTT_UpdateControllerTopics(); #endif diff --git a/obuspa/patches/0006-contains-expression.patch b/obuspa/patches/0006-contains-expression.patch index f9cfb4226..b6977f2f1 100644 --- a/obuspa/patches/0006-contains-expression.patch +++ b/obuspa/patches/0006-contains-expression.patch @@ -1,7 +1,7 @@ -Index: obuspa-10.0.4.0/src/core/expr_vector.c +Index: obuspa-10.0.5.0/src/core/expr_vector.c =================================================================== ---- obuspa-10.0.4.0.orig/src/core/expr_vector.c -+++ obuspa-10.0.4.0/src/core/expr_vector.c +--- obuspa-10.0.5.0.orig/src/core/expr_vector.c ++++ obuspa-10.0.5.0/src/core/expr_vector.c @@ -59,6 +59,7 @@ char *expr_op_2_str[kExprOp_Max] = "<", // kExprOp_LessThan ">", // kExprOp_GreaterThan @@ -26,10 +26,10 @@ Index: obuspa-10.0.4.0/src/core/expr_vector.c // Exit if found the "<" operator op = strchr(buf, '<'); -Index: obuspa-10.0.4.0/src/core/path_resolver.c +Index: obuspa-10.0.5.0/src/core/path_resolver.c =================================================================== ---- obuspa-10.0.4.0.orig/src/core/path_resolver.c -+++ obuspa-10.0.4.0/src/core/path_resolver.c +--- obuspa-10.0.5.0.orig/src/core/path_resolver.c ++++ obuspa-10.0.5.0/src/core/path_resolver.c @@ -1088,7 +1088,7 @@ int ResolveUniqueKey(char *resolved, cha char temp[MAX_DM_PATH]; bool is_match; @@ -38,7 +38,7 @@ Index: obuspa-10.0.4.0/src/core/path_resolver.c + expr_op_t valid_ops[] = {kExprOp_Equal, kExprOp_NotEqual, kExprOp_LessThanOrEqual, kExprOp_GreaterThanOrEqual, kExprOp_LessThan, kExprOp_GreaterThan, kExprOp_Contains}; // Exit if unable to find the end of the unique key - p = strchr(unresolved, ']'); + p = TEXT_UTILS_StrStr(unresolved, "]"); @@ -1754,6 +1754,67 @@ int DoUniqueKeysMatch(int index, search_ } USP_ASSERT(gge->value != NULL); // GROUP_GET_VECTOR_GetValues() should have set an error message if the vendor hook didn't set a value for the parameter @@ -107,10 +107,10 @@ Index: obuspa-10.0.4.0/src/core/path_resolver.c // Determine the function to call to perform the comparison if (type_flags & (DM_INT | DM_UINT | DM_ULONG | DM_LONG | DM_DECIMAL)) { -Index: obuspa-10.0.4.0/src/include/usp_api.h +Index: obuspa-10.0.5.0/src/include/usp_api.h =================================================================== ---- obuspa-10.0.4.0.orig/src/include/usp_api.h -+++ obuspa-10.0.4.0/src/include/usp_api.h +--- obuspa-10.0.5.0.orig/src/include/usp_api.h ++++ obuspa-10.0.5.0/src/include/usp_api.h @@ -106,6 +106,7 @@ typedef enum kExprOp_LessThan, // '<' kExprOp_GreaterThan, // '>' diff --git a/obuspa/patches/1000-SecuredRole-bbfdm.patch b/obuspa/patches/1000-SecuredRole-bbfdm.patch index 7c203428f..4adc5ecb5 100644 --- a/obuspa/patches/1000-SecuredRole-bbfdm.patch +++ b/obuspa/patches/1000-SecuredRole-bbfdm.patch @@ -1,40 +1,40 @@ -Index: obuspa-10.0.4.0/src/core/device.h +Index: obuspa-10.0.5.0/src/core/device.h =================================================================== ---- obuspa-10.0.4.0.orig/src/core/device.h -+++ obuspa-10.0.4.0/src/core/device.h -@@ -310,6 +310,8 @@ void DEVICE_CTRUST_ApplyPermissionsToSub +--- obuspa-10.0.5.0.orig/src/core/device.h ++++ obuspa-10.0.5.0/src/core/device.h +@@ -311,6 +311,9 @@ int DEVICE_CTRUST_InstSelToRoleInstance( char *DEVICE_CTRUST_InstSelToPermTarget(int role_index, void *is, int *perm_instance); int DEVICE_CTRUST_SetRoleParameter(int instance, char *param_name, char *new_value); int DEVICE_CTRUST_SetPermissionParameter(int instance1, int instance2, char *param_name, char *new_value); ++ +bool DEVICE_CTRUST_IsControllerSecured(void); + + int DEVICE_CTRUST_DumpPermissionSelectors(int role_instance, char *path); int DEVICE_REQUEST_Init(void); int DEVICE_REQUEST_Add(char *path, char *command_key, int *instance); - void DEVICE_REQUEST_OperationComplete(int instance, int err_code, char *err_msg, kv_vector_t *output_args); -Index: obuspa-10.0.4.0/src/core/device_ctrust.c +Index: obuspa-10.0.5.0/src/core/device_ctrust.c =================================================================== ---- obuspa-10.0.4.0.orig/src/core/device_ctrust.c -+++ obuspa-10.0.4.0/src/core/device_ctrust.c -@@ -236,6 +236,7 @@ credential_t *FindCredentialByCertInstan +--- obuspa-10.0.5.0.orig/src/core/device_ctrust.c ++++ obuspa-10.0.5.0/src/core/device_ctrust.c +@@ -246,6 +246,7 @@ credential_t *FindCredentialByCertInstan int Get_CredentialRole(dm_req_t *req, char *buf, int len); int Get_CredentialCertificate(dm_req_t *req, char *buf, int len); int Get_CredentialNumEntries(dm_req_t *req, char *buf, int len); +int Validate_SecuredRoles(dm_req_t *req, char *value); + void ApplySearchExpressionPermissions(char *path, inst_sel_t *sel); + bool ValidateDataModelPathSegment(char *segment, bool is_last, char *path); + +@@ -293,6 +294,9 @@ int DEVICE_CTRUST_Init(void) + // Create a timer which will be used to apply all modified permissions to the data model, after processing a USP Message + SYNC_TIMER_Add(ApplyModifiedPermissions, 0, END_OF_TIME); - #ifndef REMOVE_DEVICE_SECURITY - int InitChallengeTable(); -@@ -355,6 +356,10 @@ int DEVICE_CTRUST_Init(void) - challenge_response_input_args, NUM_ELEM(challenge_response_input_args), - NULL, 0); - #endif -+ + // Register Device.LocalAgent.ControllerTrust.SecuredRoles parameter + err |= USP_REGISTER_DBParam_ReadWrite(DEVICE_CTRUST_ROOT ".SecuredRoles", "", Validate_SecuredRoles, NULL, DM_STRING); + - // Exit if any errors occurred - if (err != USP_ERR_OK) - { -@@ -2939,3 +2944,139 @@ exit: + // Register parameters implemented by this component + // Device.LocalAgent.ControllerTrust.Role.{i} + err |= USP_REGISTER_Object(DEVICE_ROLE_ROOT, ValidateAdd_CTrustRole, NULL, Notify_CTrustRoleAdded, +@@ -3533,3 +3537,139 @@ exit: return err; } #endif // REMOVE_DEVICE_SECURITY diff --git a/obuspa/patches/1000-suppress-logs.patch b/obuspa/patches/1000-suppress-logs.patch index 5f2bf3c7c..36421d6b4 100644 --- a/obuspa/patches/1000-suppress-logs.patch +++ b/obuspa/patches/1000-suppress-logs.patch @@ -1,8 +1,8 @@ -Index: obuspa-10.0.0.2/src/core/cli_server.c +Index: obuspa-10.0.5.0/src/core/cli_server.c =================================================================== ---- obuspa-10.0.0.2.orig/src/core/cli_server.c -+++ obuspa-10.0.0.2/src/core/cli_server.c -@@ -724,10 +724,6 @@ int ExecuteCli_Get(str_vector_t *args) +--- obuspa-10.0.5.0.orig/src/core/cli_server.c ++++ obuspa-10.0.5.0/src/core/cli_server.c +@@ -725,10 +725,6 @@ int ExecuteCli_Get(str_vector_t *args) USP_ASSERT(gge->value != NULL); SendCliResponse("%s => %s\n", gge->path, gge->value); } @@ -13,11 +13,11 @@ Index: obuspa-10.0.0.2/src/core/cli_server.c } GROUP_GET_VECTOR_Destroy(&ggv); -Index: obuspa-10.0.0.2/src/core/data_model.c +Index: obuspa-10.0.5.0/src/core/data_model.c =================================================================== ---- obuspa-10.0.0.2.orig/src/core/data_model.c -+++ obuspa-10.0.0.2/src/core/data_model.c -@@ -1321,7 +1321,7 @@ int DATA_MODEL_NotifyInstanceAdded(char +--- obuspa-10.0.5.0.orig/src/core/data_model.c ++++ obuspa-10.0.5.0/src/core/data_model.c +@@ -1325,7 +1325,7 @@ int DATA_MODEL_NotifyInstanceAdded(char // Exit if instance already exists - nothing to do if (exists) { @@ -26,7 +26,7 @@ Index: obuspa-10.0.0.2/src/core/data_model.c return USP_ERR_CREATION_FAILURE; } -@@ -1409,7 +1409,7 @@ int DATA_MODEL_NotifyInstanceDeleted(cha +@@ -1413,7 +1413,7 @@ int DATA_MODEL_NotifyInstanceDeleted(cha // Exit if instance does not exist - nothing to do if (exists == false) { @@ -35,11 +35,11 @@ Index: obuspa-10.0.0.2/src/core/data_model.c return USP_ERR_OBJECT_DOES_NOT_EXIST; } -diff --git a/src/core/mqtt.c b/src/core/mqtt.c -index 388697a..444b4da 100644 ---- a/src/core/mqtt.c -+++ b/src/core/mqtt.c -@@ -4020,7 +4020,7 @@ void MessageV5Callback(struct mosquitto *mosq, void *userdata, const struct mosq +Index: obuspa-10.0.5.0/src/core/mqtt.c +=================================================================== +--- obuspa-10.0.5.0.orig/src/core/mqtt.c ++++ obuspa-10.0.5.0/src/core/mqtt.c +@@ -4025,7 +4025,7 @@ void MessageV5Callback(struct mosquitto if (mosquitto_property_read_string(props, RESPONSE_TOPIC, &response_info_ptr, false) == NULL) { diff --git a/obuspa/patches/1001-use-datamodel-caching.patch b/obuspa/patches/1001-use-datamodel-caching.patch index 5220fe75d..d435d378f 100644 --- a/obuspa/patches/1001-use-datamodel-caching.patch +++ b/obuspa/patches/1001-use-datamodel-caching.patch @@ -4,11 +4,11 @@ Date: Wed Apr 30 17:18:27 2025 +0530 1001-use-datamodel-caching.patch -diff --git a/src/core/cli_server.c b/src/core/cli_server.c -index da61c6f..abac7cb 100644 ---- a/src/core/cli_server.c -+++ b/src/core/cli_server.c -@@ -511,6 +511,7 @@ int CLI_SERVER_ExecuteCliCommand(char *cmd_line) +Index: obuspa-10.0.5.0/src/core/cli_server.c +=================================================================== +--- obuspa-10.0.5.0.orig/src/core/cli_server.c ++++ obuspa-10.0.5.0/src/core/cli_server.c +@@ -512,6 +512,7 @@ int CLI_SERVER_ExecuteCliCommand(char *c SendCliResponse("WARNING: Discarding unused args: %s\n", args.vector[cli_cmd->max_args+1]); } @@ -16,7 +16,7 @@ index da61c6f..abac7cb 100644 // Process command err = cli_cmd->exec_cmd(&args); print_help = false; -@@ -670,6 +671,11 @@ int ExecuteCli_Version(str_vector_t *args) +@@ -671,6 +672,11 @@ int ExecuteCli_Version(str_vector_t *arg int ExecuteCli_Get(str_vector_t *args) { combined_role_t *combined_role; @@ -28,22 +28,22 @@ index da61c6f..abac7cb 100644 #ifndef REMOVE_USP_BROKER char *arg1; -diff --git a/src/core/data_model.h b/src/core/data_model.h -index 7564127..2736d7c 100755 ---- a/src/core/data_model.h -+++ b/src/core/data_model.h -@@ -405,5 +405,6 @@ int DM_PRIV_ReRegister_DBParam_Default(char *path, char *value); +Index: obuspa-10.0.5.0/src/core/data_model.h +=================================================================== +--- obuspa-10.0.5.0.orig/src/core/data_model.h ++++ obuspa-10.0.5.0/src/core/data_model.h +@@ -416,5 +416,6 @@ int DM_PRIV_ReRegister_DBParam_Default(c bool DM_PRIV_IsChildNodeOf(dm_node_t *node, dm_node_t *parent_node); void DM_PRIV_GetAllEventsAndCommands(dm_node_t *node, str_vector_t *events, str_vector_t *commands); +int vendor_create_dm_cache(char *paths[], int num_paths); #endif -diff --git a/src/core/handle_get.c b/src/core/handle_get.c -index d9d3e9e..c263978 100644 ---- a/src/core/handle_get.c -+++ b/src/core/handle_get.c -@@ -129,6 +129,7 @@ void MSG_HANDLER_HandleGet(Usp__Msg *usp, char *controller_endpoint, mtp_conn_t +Index: obuspa-10.0.5.0/src/core/handle_get.c +=================================================================== +--- obuspa-10.0.5.0.orig/src/core/handle_get.c ++++ obuspa-10.0.5.0/src/core/handle_get.c +@@ -129,6 +129,7 @@ void MSG_HANDLER_HandleGet(Usp__Msg *usp goto exit; } @@ -51,11 +51,11 @@ index d9d3e9e..c263978 100644 // Calculate the number of hierarchical levels to traverse in the data model when performing partial path resolution // NOTE: protocol buffer has depth as an unsigned quantity, but internally we use a signed number, so limit range to that of a signed number depth = usp->body->request->get->max_depth; -diff --git a/src/core/msg_handler.c b/src/core/msg_handler.c -index 647591d..b7498d8 100755 ---- a/src/core/msg_handler.c -+++ b/src/core/msg_handler.c -@@ -863,6 +863,8 @@ int HandleUspMessage(Usp__Msg *usp, char *endpoint_id, mtp_conn_t *mtpc) +Index: obuspa-10.0.5.0/src/core/msg_handler.c +=================================================================== +--- obuspa-10.0.5.0.orig/src/core/msg_handler.c ++++ obuspa-10.0.5.0/src/core/msg_handler.c +@@ -863,6 +863,8 @@ int HandleUspMessage(Usp__Msg *usp, char MSG_HANDLER_UspMsgTypeToString(usp->header->msg_type), iso8601_cur_time(buf, sizeof(buf)) ); diff --git a/obuspa/patches/1003-ct-full-access-rename.patch b/obuspa/patches/1003-ct-full-access-rename.patch index 6d40ba6fe..650ee402a 100644 --- a/obuspa/patches/1003-ct-full-access-rename.patch +++ b/obuspa/patches/1003-ct-full-access-rename.patch @@ -1,8 +1,8 @@ -Index: obuspa-10.0.0.2/src/core/data_model.c +Index: obuspa-10.0.5.0/src/core/data_model.c =================================================================== ---- obuspa-10.0.0.2.orig/src/core/data_model.c -+++ obuspa-10.0.0.2/src/core/data_model.c -@@ -5347,7 +5347,7 @@ int RegisterDefaultControllerTrust(void) +--- obuspa-10.0.5.0.orig/src/core/data_model.c ++++ obuspa-10.0.5.0/src/core/data_model.c +@@ -5443,7 +5443,7 @@ int RegisterDefaultControllerTrust(void) int err = USP_ERR_OK; // Register 'Full Access' role diff --git a/obuspa/patches/2001-validate-controller-mtp.patch b/obuspa/patches/2001-validate-controller-mtp.patch index 7ad67f881..2e80d3843 100644 --- a/obuspa/patches/2001-validate-controller-mtp.patch +++ b/obuspa/patches/2001-validate-controller-mtp.patch @@ -1,8 +1,8 @@ -Index: obuspa-10.0.4.0/src/core/device.h +Index: obuspa-10.0.5.0/src/core/device.h =================================================================== ---- obuspa-10.0.4.0.orig/src/core/device.h -+++ obuspa-10.0.4.0/src/core/device.h -@@ -352,6 +352,10 @@ void DEVICE_CONTROLLER_SetInheritedRole( +--- obuspa-10.0.5.0.orig/src/core/device.h ++++ obuspa-10.0.5.0/src/core/device.h +@@ -355,6 +355,10 @@ void DEVICE_CONTROLLER_SetInheritedRole( int DEVICE_CONTROLLER_CountEnabledWebsockClientConnections(void); #endif @@ -13,11 +13,11 @@ Index: obuspa-10.0.4.0/src/core/device.h #ifndef REMOVE_USP_BROKER int DEVICE_SUBSCRIPTION_RouteNotification(Usp__Msg *usp, int instance, char *subscribed_path); bool DEVICE_SUBSCRIPTION_MarkVendorLayerSubs(int broker_instance, subs_notify_t notify_type, char *path, int group_id); -Index: obuspa-10.0.4.0/src/core/device_controller.c +Index: obuspa-10.0.5.0/src/core/device_controller.c =================================================================== ---- obuspa-10.0.4.0.orig/src/core/device_controller.c -+++ obuspa-10.0.4.0/src/core/device_controller.c -@@ -968,6 +968,78 @@ int DEVICE_CONTROLLER_QueueBinaryMessage +--- obuspa-10.0.5.0.orig/src/core/device_controller.c ++++ obuspa-10.0.5.0/src/core/device_controller.c +@@ -969,6 +969,78 @@ int DEVICE_CONTROLLER_QueueBinaryMessage return USP_ERR_OK; } @@ -96,10 +96,10 @@ Index: obuspa-10.0.4.0/src/core/device_controller.c /*********************************************************************//** ** ** DEVICE_CONTROLLER_IsMTPConfigured -Index: obuspa-10.0.4.0/src/core/msg_handler.c +Index: obuspa-10.0.5.0/src/core/msg_handler.c =================================================================== ---- obuspa-10.0.4.0.orig/src/core/msg_handler.c -+++ obuspa-10.0.4.0/src/core/msg_handler.c +--- obuspa-10.0.5.0.orig/src/core/msg_handler.c ++++ obuspa-10.0.5.0/src/core/msg_handler.c @@ -1220,6 +1220,15 @@ int ValidateUspRecord(UspRecord__Record usp_service_instance = USP_BROKER_GetUspServiceInstance(rec->from_id, 0); #endif diff --git a/obuspa/patches/2005-revert-mqtt-sub-error.patch b/obuspa/patches/2005-revert-mqtt-sub-error.patch new file mode 100644 index 000000000..e70dd8e11 --- /dev/null +++ b/obuspa/patches/2005-revert-mqtt-sub-error.patch @@ -0,0 +1,15 @@ +Index: obuspa-10.0.5.0/src/core/mqtt.c +=================================================================== +--- obuspa-10.0.5.0.orig/src/core/mqtt.c ++++ obuspa-10.0.5.0/src/core/mqtt.c +@@ -3417,8 +3417,8 @@ void SubscribeToAll(mqtt_client_t *clien + // Exit if no agent response topic configured (or set by the CONNACK) + USP_SNPRINTF(buf, sizeof(buf), "%s: No response topic configured (or set by the CONNACK)", __FUNCTION__); + USP_LOG_Error("%s", buf); +- HandleMqttError(client, kMqttFailure_Misconfigured, buf); +- return; ++ //HandleMqttError(client, kMqttFailure_Misconfigured, buf); ++ //return; + } + + // Subscribe to all subscriptions configured in Device.MQTT.Client.{i}.Subscription.{i}