@@ -808,6 +808,42 @@ void BSL_SecOper_AppendOption(BSL_SecOper_t *self, const BSL_IdValPair_t *option
808808 */
809809void BSL_SecOper_AppendParam (BSL_SecOper_t * self , const BSL_IdValPair_t * param );
810810
811+ /** Add an empty security parameter.
812+ *
813+ * @param[in,out] self This security operation.
814+ * @param[in] param_id Security parameter ID.
815+ * @return The parameter owned by this operation.
816+ */
817+ BSL_IdValPair_t * BSL_SecOper_AddParam (BSL_SecOper_t * self , int64_t param_id );
818+
819+ /** Add an empty security result.
820+ *
821+ * @param[in,out] self This security operation.
822+ * @param[in] result_id Security result ID.
823+ * @return The result owned by this operation.
824+ */
825+ BSL_IdValPair_t * BSL_SecOper_AddResult (BSL_SecOper_t * self , int64_t result_id );
826+
827+ /** Get the count of parameters contained within this security operation.
828+ *
829+ * @param[in] self This security operation
830+ * @return Count of security parameters.
831+ */
832+ size_t BSL_SecOper_CountParams (const BSL_SecOper_t * self );
833+
834+ /** Get the count of results contained within this security operation.
835+ *
836+ * @param[in] self This security operation
837+ * @return Count of security results.
838+ */
839+ size_t BSL_SecOper_CountResults (const BSL_SecOper_t * self );
840+
841+ /** Clear all parameters and results contained within this security operation.
842+ *
843+ * @param[in,out] self This security operation
844+ */
845+ void BSL_SecOper_ClearParamsAndResults (BSL_SecOper_t * self );
846+
811847/** Return true if this security operation's role is SOURCE
812848 * @param[in] self This Security Operation
813849 * @return boolean
@@ -934,75 +970,6 @@ const BSL_IdValPair_t *BSL_AbsSecBlock_FindResult(BSL_AbsSecBlock_t *self, uint6
934970 */
935971int BSL_TlmCounters_IncrementCounter (BSL_LibCtx_t * bsl , BSL_TlmCounterIndex_e tlm_index , uint64_t count );
936972
937- /** @brief Represents the output following execution of a security operation.
938- */
939- typedef struct BSL_SecOutcome_s BSL_SecOutcome_t ;
940-
941- /// @brief Returns the size of the ::BSL_SecOutcome_s structure.
942- size_t BSL_SecOutcome_Sizeof (void );
943-
944- /** Populate a pre-allocated security outcome struct.
945- *
946- * @param[in,out] self Non-Null pointer to this security outcome.
947- * @param[in] sec_oper Security operation containing the necessary info.
948- */
949- void BSL_SecOutcome_Init (BSL_SecOutcome_t * self , const BSL_SecOper_t * sec_oper );
950-
951- /** Release any resources owned by this security outcome.
952- *
953- * @param[in,out] self Non-Null pointer to this security outcome.
954- */
955- void BSL_SecOutcome_Deinit (BSL_SecOutcome_t * self );
956-
957- /** Return true if internal invariants hold
958- *
959- * @param[in] self This sec outcome.
960- * @return true if invariants hold
961- */
962- bool BSL_SecOutcome_IsConsistent (const BSL_SecOutcome_t * self );
963-
964- /** Append a Security Result to this outcome.
965- *
966- * @param[in,out] self Non-NULL pointer to this security outcome.
967- * @return Non-NULL pointer to security result just appended.
968- */
969- BSL_IdValPair_t * BSL_SecOutcome_AppendResult (BSL_SecOutcome_t * self );
970-
971- /** Get the result at index i. Panics if i is out of range.
972- *
973- * @param[in] self This outcome
974- * @param[in] index Index in the list to retrieve
975- * @return Sec Result at index
976- */
977- const BSL_IdValPair_t * BSL_SecOutcome_GetResultAtIndex (const BSL_SecOutcome_t * self , size_t index );
978-
979- /** Get the number of results
980- *
981- * @param[in] self this sec outcome
982- * @return number of results in sec outcome
983- */
984- size_t BSL_SecOutcome_CountResults (const BSL_SecOutcome_t * self );
985-
986- /** Append a Security Parameter to this outcome.
987- *
988- * @param[in,out] self Non-NULL pointer to this security outcome.
989- * @return Non-NULL pointer to the initialized security parameter.
990- */
991- BSL_IdValPair_t * BSL_SecOutcome_AppendParam (BSL_SecOutcome_t * self );
992-
993- /** @brief Returns number of parameters in this outcome.
994- * @param[in] self This outcome
995- * @return Number of parameters
996- */
997- size_t BSL_SecOutcome_CountParams (const BSL_SecOutcome_t * self );
998-
999- /** Get the security parameter from the security outcome at the provided index
1000- * @param[in] self security outcome
1001- * @param[in] index index to retrieve security parameter from
1002- * @return Security parameter
1003- */
1004- const BSL_IdValPair_t * BSL_SecOutcome_GetParamAt (const BSL_SecOutcome_t * self , size_t index );
1005-
1006973/**
1007974 * @return size of security operation
1008975 */
@@ -1134,40 +1101,6 @@ const BSL_SecurityAction_t *BSL_SecurityActionSet_GetActionAtIndex(const BSL_Sec
11341101 */
11351102size_t BSL_SecurityActionSet_CountErrors (const BSL_SecurityActionSet_t * self );
11361103
1137- /// @brief Returns size of this struct type
1138- size_t BSL_SecurityResponseSet_Sizeof (void );
1139-
1140- /** Initialize with the given count of operations and failures
1141- *
1142- */
1143- void BSL_SecurityResponseSet_Init (BSL_SecurityResponseSet_t * self );
1144-
1145- /** Zeroize itself and release any owned resources
1146- *
1147- * @param[in,out] self This response set.
1148- */
1149- void BSL_SecurityResponseSet_Deinit (BSL_SecurityResponseSet_t * self );
1150-
1151- /** Return true if internal consistency checks pass.
1152- *
1153- * @param[in] self This response set.
1154- */
1155- bool BSL_SecurityResponseSet_IsConsistent (const BSL_SecurityResponseSet_t * self );
1156-
1157- /** Return number of responses (operations acted upon)
1158- *
1159- * @param[in] self This response set.
1160- */
1161- size_t BSL_SecurityResponseSet_CountResponses (const BSL_SecurityResponseSet_t * self );
1162-
1163- /** Append a result code to the security response set
1164- * @param[in,out] self the response set to append result to
1165- * @param[in] result the result code to append
1166- * @param[in] policy_action the on-failure policy action associated with the response
1167- */
1168- void BSL_SecurityResponseSet_AppendResult (BSL_SecurityResponseSet_t * self , int64_t result ,
1169- BSL_PolicyAction_e policy_action );
1170-
11711104/** Queries the policy provider for any security operations to take on the bundle.
11721105 *
11731106 * @note The caller is obligated to allocate space for the policy_action_set output.
@@ -1194,12 +1127,11 @@ int BSL_PolicyRegistry_InspectActions(const BSL_LibCtx_t *bsl, BSL_SecurityActio
11941127 * @param[in] policy_actions A policy action set, which may contain error codes and other info. @preallocated
11951128 * Caller-allocated, zeroed space for action set
11961129 * @param[in,out] bundle Bundle seeking security operations
1197- * @param[in] response_output results from security context
11981130 * @param[in] location Where in the BPA lifecycle this query arises from
11991131 * @return 0 if success
12001132 */
12011133int BSL_PolicyRegistry_FinalizeActions (const BSL_LibCtx_t * bsl , const BSL_SecurityActionSet_t * policy_actions ,
1202- BSL_BundleRef_t * bundle , const BSL_SecurityResponseSet_t * response_output );
1134+ BSL_BundleRef_t * bundle );
12031135
12041136/// @brief Callback interface to query policy provider to populate the action set
12051137typedef int (* BSL_PolicyInspect_f )(void * user_data , BSL_SecurityActionSet_t * output_action_set ,
@@ -1208,7 +1140,7 @@ typedef int (*BSL_PolicyInspect_f)(void *user_data, BSL_SecurityActionSet_t *out
12081140/// @brief Callback interface to finalize policy provider over the action set. Finalize should ignore actions from
12091141/// different policy providers
12101142typedef int (* BSL_PolicyFinalize_f )(void * user_data , const BSL_SecurityActionSet_t * output_action_set ,
1211- BSL_BundleRef_t * bundle , const BSL_SecurityResponseSet_t * response_output );
1143+ BSL_BundleRef_t * bundle );
12121144
12131145/// @brief Callback interface for policy provider to shut down and release any resources
12141146typedef void (* BSL_PolicyDeinit_f )(void * user_data );
@@ -1225,13 +1157,12 @@ struct BSL_PolicyDesc_s
12251157/** Call the underlying security context to perform the given action set
12261158 *
12271159 * @param[in] lib This BSL context
1228- * @param[out] output_response Pointer to allocated, zeroed memory into which the response is populated
12291160 * @param[in,out] bundle Pointer to bundle, which may be modified.
12301161 * @param[in] action_set Action containing all params and operations.
12311162 * @return 0 on success, negative on failure.
12321163 */
1233- int BSL_SecCtx_ExecutePolicyActionSet (BSL_LibCtx_t * lib , BSL_SecurityResponseSet_t * output_response ,
1234- BSL_BundleRef_t * bundle , const BSL_SecurityActionSet_t * action_set );
1164+ int BSL_SecCtx_ExecutePolicyActionSet (BSL_LibCtx_t * lib , BSL_BundleRef_t * bundle ,
1165+ const BSL_SecurityActionSet_t * action_set );
12351166
12361167/** Call the underlying security context to validate the given action set
12371168 *
@@ -1258,13 +1189,10 @@ typedef bool (*BSL_SecCtx_Validate_f)(BSL_LibCtx_t *lib, BSL_BundleRef_t *bundle
12581189 *
12591190 * @param[in] lib The library context.
12601191 * @param[in,out] bundle The bundle to modify.
1261- * @param[in] sec_oper The security operation to perform.
1262- * @param[in] asb For verifier or acceptor, this is the existing ASB structure.
1263- * @param[in,out] sec_outcome The pre-allocated outcome to populate
1192+ * @param[in, out] sec_oper Security operation inputs and generated outputs.
12641193 * @return 0 if security operation performed successfully.
12651194 */
1266- typedef int (* BSL_SecCtx_Execute_f )(BSL_LibCtx_t * lib , BSL_BundleRef_t * bundle , const BSL_SecOper_t * sec_oper ,
1267- BSL_SecOutcome_t * sec_outcome );
1195+ typedef int (* BSL_SecCtx_Execute_f )(BSL_LibCtx_t * lib , BSL_BundleRef_t * bundle , BSL_SecOper_t * sec_oper );
12681196
12691197/** @brief Security Context descriptor (interface)
12701198 */
@@ -1280,22 +1208,22 @@ struct BSL_SecCtxDesc_s
12801208 * @warning This is exposed for testing only.
12811209 */
12821210int BSL_ExecBIBSource (BSL_SecCtx_Execute_f sec_context_fn , BSL_LibCtx_t * lib , BSL_BundleRef_t * bundle ,
1283- BSL_SecOper_t * sec_oper , BSL_SecOutcome_t * outcome );
1211+ BSL_SecOper_t * sec_oper );
12841212/** Internal function to execute an operation as verifier or acceptor.
12851213 * @overload
12861214 */
12871215int BSL_ExecBIBVerifierAcceptor (BSL_SecCtx_Execute_f sec_context_fn , BSL_LibCtx_t * lib , BSL_BundleRef_t * bundle ,
1288- BSL_SecOper_t * sec_oper , BSL_SecOutcome_t * outcome );
1216+ BSL_SecOper_t * sec_oper );
12891217/** Internal function to execute an operation as source.
12901218 * @overload
12911219 */
12921220int BSL_ExecBCBSource (BSL_SecCtx_Execute_f sec_context_fn , BSL_LibCtx_t * lib , BSL_BundleRef_t * bundle ,
1293- BSL_SecOper_t * sec_oper , BSL_SecOutcome_t * outcome );
1221+ BSL_SecOper_t * sec_oper );
12941222/** Internal function to execute an operation as verifier or acceptor.
12951223 * @overload
12961224 */
12971225int BSL_ExecBCBVerifierAcceptor (BSL_SecCtx_Execute_f sec_context_fn , BSL_LibCtx_t * lib , BSL_BundleRef_t * bundle ,
1298- BSL_SecOper_t * sec_oper , BSL_SecOutcome_t * outcome );
1226+ BSL_SecOper_t * sec_oper );
12991227
13001228#ifdef __cplusplus
13011229} // extern C
0 commit comments