AUTOSAR Classic Security & Intrusion Detection
Das Security-Cluster schützt vernetzte Fahrzeugfunktionen gegen Cyber-Bedrohungen durch Intrusion Detection (IdsM), kryptographische PDU-Authentifizierung und Freshness-Protection (SecOC) sowie Key- und Zertifikatsmanagement (KeyM).
Руководство по кластеруСОЗДАНО ИИ
Обеспечивает бортовую безопасность с помощью криптографических сервисов, аутентификации PDU, управления ключами и обнаружения событий.
Обеспечивает бортовую безопасность с помощью криптографических сервисов, аутентификации PDU, управления ключами и обнаружения событий.
Кластер Security & Intrusion Detection предоставляет криптографические примитивы через CSM, CryIf и Crypto Driver, защищает I-PDU с помощью данных аутентификации через SecOC и управляет ключами, а также сертификатами с помощью KeyM AUTOSAR_CP_SWS_CryptoServiceManager с. 21. Инциденты безопасности передаются как события в IdsM, где они буферизуются и асинхронно фильтруются [SWS_IdsM_00702]. При завершении работы (Shutdown) активное удаление данных ключей из RAM защищает от несанкционированной компрометации.
Модульный кластер Security & Intrusion Detection объединяет модули secoc, idsm, keym, csm, cryif и crypto для защиты внутриавтомобильной коммуникации и обнаружения инцидентов безопасности в AUTOSAR Classic Platform AUTOSAR_CP_SWS_IntrusionDetectionSystemManager с. 21. Базовые криптографические сервисы предоставляются иерархически через Crypto Service Manager (CSM), который инкапсулирует задания в структуры Crypto_JobType [SWS_Csm_01013] и перенаправляет их через Crypto Interface (CryIf_ProcessJob [SWS_CryIf_91003]) конкретным аппаратным или программным объектам Crypto Driver.
Коммуникация PDU защищается модулем SecOC с помощью кодов аутентификации сообщений (MAC) и значений свежести ([SWS_SecOC_91006], [SWS_SecOC_00012]), в то время как Key Manager (KeyM) подготавливает, обновляет и валидирует сертификаты и ключи для CSM ([SWS_KeyM_00052], [SWS_KeyM_00059]). События безопасности, такие как неудачные проверки PDU, передаются как Security Events (SEv) в IdsM [SWS_IdsM_91002], который синхронно буферизует их [SWS_IdsM_00701] и асинхронно квалифицирует через конфигурируемые цепочки фильтров [SWS_IdsM_01020].
Архитектурная диаграмма: многоуровневая архитектура и интерфейсные связи кластера Security и Intrusion Detection. Источники: AUTOSAR_CP_SWS_IntrusionDetectionSystemManager с. 21, AUTOSAR_CP_SWS_CryptoServiceManager с. 21.
При выполнении синхронные точки входа API отделяются от ресурсоемких фоновых задач в IdsM_MainFunction, SecOC_MainFunctionTx [SWS_SecOC_00176] и KeyM_MainBackgroundFunction [SWS_KeyM_00075]. В случае сбоя или перегрузки системы (CRYPTO_E_BUSY) резервные механизмы, такие как стандартные шаблоны аутентификации в SecOC [SWS_SecOC_91013] и откаты NvM в IdsM [SWS_IdsM_01702], обеспечивают стабильность всей системы; при завершении работы KeyM полностью удаляет активный ключевой материал из RAM [SWS_KeyM_00047].
Системная архитектура & роль кластера модулей
Модульный кластер Security & Intrusion Detection платформы AUTOSAR Classic Platform (Release R20-11) предоставляет стандартизированные сервисы для криптографии, защищенной бортовой коммуникации, управления ключами и сертификатами, а также обнаружения атак. Функционально кластер распределен по нескольким уровням Basic Software (BSW) AUTOSAR: на сервисном уровне Crypto Service Manager (CSM) инкапсулирует аппаратно-независимые криптографические сервисы AUTOSAR_CP_SWS_CryptoServiceManager с. 21. Защищенную передачу I-PDU берет на себя модуль Secure Onboard Communication (SecOC) на коммуникационном уровне [SWS_SecOC_00162], в то время как Key Manager (KeyM) в качестве сервиса безопасности оркестрирует жизненный цикл криптографических ключей и сертификатов SWS_KeyManager с. 31. В дополнение к этому Intrusion Detection System Manager (IdsM) выступает в роли центрального агрегатора и фильтра для событий безопасности во всей системе AUTOSAR_CP_SWS_IntrusionDetectionSystemManager с. 21.
Ниже CSM интерфейс Crypto Interface (CryIf) как уровень CryIf абстрагирует аппаратно- или программно-специфичный доступ к нескольким объектам криптографических драйверов и унифицирует механизм диспетчеризации заданий и ключей SWS_CryptoInterface с. 1. На уровне MCAL и драйверов Crypto Driver (Crypto) выполняет непосредственные вычисления программно или на аппаратных модулях безопасности (HSM) [SWS_Crypto_91016]. Взаимодействие этих уровней гарантирует полное разделение прикладного программного обеспечения (SW-C) и коммуникационных модулей от аппаратно-зависимых криптоускорителей.
Архитектурная диаграмма: многоуровневая архитектура и интерфейсные связи кластера Security и Intrusion Detection. Источники: AUTOSAR_CP_SWS_IntrusionDetectionSystemManager с. 21, AUTOSAR_CP_SWS_CryptoServiceManager с. 21.
Взаимодействие и пути взаимодействия между модулями
Модули кластера связаны друг с другом через четко определенные пути потоков управления и данных. Обработка криптографических заданий происходит преимущественно через CSM. Прикладные модули или модули BSW, такие как SecOC и KeyM, инициируют задания через сервисы CSM, такие как Csm_MacGenerate [SWS_Csm_00982], Csm_Encrypt [SWS_Csm_00984], Csm_AEADEncrypt [SWS_Csm_01023], Csm_SignatureGenerate [SWS_Csm_00992], Csm_Hash [SWS_Csm_00980] или Csm_RandomGenerate [SWS_Csm_01543]. Задания инкапсулируются в стандартизированной структуре времени выполнения Crypto_JobType [SWS_Csm_01013], которая управляется с помощью режимов работы (Crypto_OperationModeType, таких как CRYPTO_OPERATIONMODE_START, UPDATE, FINISH или SINGLECALL) [SWS_Csm_00802]. CSM передает задание в CryIf_ProcessJob [SWS_CryIf_91003], который перенаправляет вызов соответствующему объекту криптодрайвера.
Модуль SecOC защищает передачу PDU между PduR и коммуникационной шиной. При приеме защищенного PDU через SecOC_TpRxIndication [SWS_SecOC_00125] SecOC сначала запрашивает значения свежести через SecOC_GetRxFreshnessAuthData [SWS_SecOC_91006] и формирует подлежащие аутентификации данные в соответствии со спецификацией SecOcProtocol с. 19. Для верификации MAC модуль SecOC обращается к CSM [SWS_SecOC_00012]. После успешной проверки аутентичный PDU передается верхним уровням. Если верификация не удалась, результат фиксируется в статусе SecOC_VerificationStatusType [SWS_SecOC_00160], [SWS_SecOC_91014]; интерпретация: этот сбой регистрируется как Security Event в IdsM AUTOSAR_CP_SWS_IntrusionDetectionSystemManager с. 21. Вопрос Q-8cfd1660757f3f1f (открытый)
В Key Manager (KeyM) подготавливаются и осуществляются обновления ключей и сертификатов. При верификации сертификатов (например, через KeyM_VerifyCertificates [SWS_KeyM_00059] или KeyM_VerifyCertificateChain [SWS_KeyM_00061]) KeyM использует криптографические примитивы CSM для проверки подписи, а также внешние базисы времени StbM для проверки срока действия SWS_KeyManager с. 119. Обновления ключей (KeyM_Update [SWS_KeyM_00052]) подключают пользовательские обработчики (KeyM_KH_Update [SWS_KeyM_00069], [SWS_KeyM_00055]), при этом результирующие байты ключа активируются в криптодрайвере через Csm_KeyElementSet [SWS_Csm_00957] и Csm_JobKeySetValid [SWS_Csm_91027]. Деривацию ключей и операции копирования CryIf перенаправляет через CryIf_KeyDerive [SWS_CryIf_91009] или CryIf_KeyElementCopy [SWS_CryIf_91015] функциям драйвера, таким как Crypto_KeyElementCopyPartial [SWS_Crypto_91015].
IdsM собирает события безопасности (Security Events, SEv) от датчиков BSW (включая SecOC), а также программных компонентов приложений (SW-C) через такие интерфейсы, как IdsM_SetSecurityEvent [SWS_IdsM_91002] или IdsM_SetSecurityEventWithCount [SWS_IdsM_91018]. События буферизуются, квалифицируются через цепочки фильтров (например, фильтр состояний блокировки [SWS_IdsM_01020] или фильтр агрегации AUTOSAR_CP_SWS_IntrusionDetectionSystemManager с. 40) и, наконец, пересылаются через PduR [SWS_IdsM_91009], [SWS_IdsM_91010].
Диаграмма последовательности: верификация защищенного PDU в SecOC с использованием криптографического стека и передача сообщений о событиях безопасности в IdsM. Источники: [SWS_SecOC_00125], [SWS_SecOC_00012], [SWS_CryIf_91003], [SWS_CryIf_91013], [SWS_IdsM_91002].
Синхронизация, реентерабельность и контексты задач
Выполнение криптографических вычислений и операций безопасности требует строгого разделения синхронных путей вызова и асинхронных контекстов задач. В CSM и CryIf поведение при выполнении зависит от конфигурации криптографических примитивов: операции могут выполняться синхронно с блокировкой или асинхронно [SWS_Csm_00982], [SWS_CryIf_91003]. В случае асинхронных заданий криптодрайвер сообщает о завершении через CryIf_CallbackNotification [SWS_CryIf_91013], после чего CSM вызывает зарегистрированную функцию обратного вызова вызывающей стороны [SWS_SecOC_00012]. Для прерываемых или длительных вычислений CSM предоставляет функцию отмены Csm_CancelJob [SWS_Csm_00968], которая делегируется драйверу через CryIf_CancelJob [SWS_CryIf_91014].
Передача данных в модуле SecOC разделяется по времени: в периодических циклах SecOC_MainFunctionTx проверяет наличие новых аутентичных PDU для подписания, вычисляет аутентификаторы и инициирует отправку через PduR [SWS_SecOC_00176]. В IdsM прием зарегистрированных событий осуществляется с высокой производительностью в контексте датчика (задача или ISR) через IdsM_SetSecurityEvent [SWS_IdsM_91002], при этом события сначала синхронно сохраняются в конфигурируемых буферах событий [SWS_IdsM_00701], [SWS_IdsM_00702]. Требующие много времени фильтрация, обработка контекстных данных и добавление временных меток через StbM или RTE выполняются полностью асинхронно в контексте периодической функции IdsM_MainFunction SWS_IntrusionDetectionSystemManager с. 87, AUTOSAR_CP_SWS_IntrusionDetectionSystemManager с. 86.
Key Manager различает критичные ко времени и ресурсоемкие задачи: в то время как стандартные опросы состояния и оркестровка обратных вызовов выполняются в KeyM_MainFunction [SWS_KeyM_00074], для ресурсоемких синхронных процедур обработчиков (таких как KeyM_KH_Update) предусмотрено выполнение в вытесняющей фоновой функции KeyM_MainBackgroundFunction [SWS_KeyM_00075]. В многоядерных архитектурах CSM также поддерживает специфичные для разделов основные функции и инициализации [SWS_Csm_00646], SWS_CryptoInterface с. 1; интерпретация: данное секционирование соответствует назначению выделенных аппаратных объектов драйвера для каждого процессорного ядра. Вопрос (открытый)
Типичные жизненные циклы и режимы работы
Инициализация кластера следует строгой иерархии зависимостей снизу вверх. Сначала через Crypto_Init конфигурируются низкоуровневые драйверы [SWS_Crypto_91016], затем интерфейс CryIf [SWS_CryIf_91118] и CSM через Csm_Init [SWS_Csm_00646]. Только после этого разрешается инициализировать зависимые модули SecOC, KeyM и IdsM. В результате инициализации SecOC переходит из состояния SECOC_UNINIT в SECOC_INIT [SWS_SecOC_00162]. В KeyM все сконфигурированные сертификаты изначально получают статус KEYM_CERTIFICATE_NOT_AVAILABLE [SWS_KeyM_00021], [SWS_KeyM_91003] до того, как они будут считаны из NvM или загружены и верифицированы через KeyM_SetCertificate либо диагностику SWS_KeyManager с. 119.
Во время выполнения изменения состояния автомобиля влияют на режим работы IdsM: Basic Software Manager (BswM) сообщает IdsM об изменениях состояния через IdsM_BswM_StateChanged [SWS_IdsM_91005]. Эти состояния управляют фильтром состояний блокировки (Block State Filter) [SWS_IdsM_01020], [SWS_IdsM_91017], благодаря чему на определенных фазах работы (например, в режиме программирования или в фазах сна) пересылка событий безопасности подавляется. Кроме того, режимы отчетности о событиях можно диагностически модифицировать через DCM (IdsM_Dcm_SetReportingMode_Start [SWS_IdsM_91008], [SWS_IdsM_91013]) и сохранять персистентно в NvM [SWS_IdsM_01700], [SWS_IdsM_01701].
При отключении электронного блока управления (Shutdown) выполняется упорядоченная деинициализация модулей. SecOC_DeInit останавливает безопасную коммуникацию, очищает все внутренние буферы, а также переменные и переводит SecOC обратно в состояние SECOC_UNINIT [SWS_SecOC_00161]. При вызове KeyM_Deinit [SWS_KeyM_00047] из соображений безопасности весь находящийся в RAM криптографический ключевой материал активно уничтожается и перезаписывается начальными значениями, чтобы предотвратить несанкционированное считывание в состоянии покоя.
Обработка ошибок, трассировка DET и деградация
Модульный кластер реализует сквозные механизмы обнаружения ошибок разработки (Development Error Tracer, DET) и проблем времени выполнения. Все модули проверяют свою инициализацию и сообщают об ошибках DET при неинициализированном вызове, например CRYIF_E_UNINIT в интерфейсах CryIf, таких как CryIf_RandomSeed [SWS_CryIf_91007], CryIf_CancelJob [SWS_CryIf_91014], CryIf_KeyDerive [SWS_CryIf_91009] или CryIf_CallbackNotification [SWS_CryIf_91013]. Некорректные параметры-указатели также приводят к сообщениям DET, например CRYPTO_E_PARAM_POINTER в Crypto_GetVersionInfo [SWS_Crypto_91001], тогда как об ошибках инициализации в CSM сообщается с помощью CSM_E_INIT_FAILED [SWS_Csm_00646].
При перегрузке или сбое аппаратных криптографических объектов драйвер сигнализирует о статусе CRYPTO_E_BUSY [SWS_CryIf_91003], [SWS_Csm_00957]. В таких сценариях деградации SecOC с помощью SecOC_SendDefaultAuthenticationInformation допускает настраиваемую отправку неаутентифицированных замещающих PDU на нижние уровни для поддержания доступности автомобиля [SWS_SecOC_91013]. В IdsM исчерпание сконфигурированных буферов событий приводит к срабатыванию внутреннего события безопасности SEV_IDSM_NO_EVENT_BUFFER_AVAILABLE [SWS_IdsM_00703]. Если сохранение измененных параметров IdsM в NvM завершается сбоем, IdsM выполняет автоматический откат к предыдущему состоянию [SWS_IdsM_01702]. Если при установке ключей в Csm_KeyElementSet возникает ошибка, статус элемента ключа считается неопределенным и должен быть валидирован через Csm_KeyGetStatus [SWS_Csm_91047] и CryIf_KeyGetStatus [SWS_CryIf_91012].
Данное руководство основано на спецификациях AUTOSAR Classic Platform для Release R20-11 и обобщает архитектуру кластера Security & Intrusion Detection.
Инициализация и состояние
IdsM_GetVersionInfoIdsM_InitKeyM_DeinitKeyM_GetVersionInfoKeyM_InitSecOC_DeInitSecOC_GetVersionInfoSecOC_InitСервисы · Set…
Сервисы · Get…
Сервисы · Verify…
Сервисы · Cert…
Сервисы · Certificate…
Сервисы · Crypto…
Сервисы · Dcm…
Сервисы · K…
Сервисы · Tp…
Сервисы · Прочее
IdsM_BswM_StateChangedKeyM_FinalizeKeyM_MainBackgroundFunctionKeyM_PrepareKeyM_ServiceCertificateCallbackNotificationKeyM_StartSecOC_IfCancelTransmitSecOC_IfTransmitSecOC_SendDefaultAuthenticationInformationОбратные вызовы
IdsM_CopyTxDataIdsM_TpTxConfirmationIdsM_TxConfirmationSecOC_CopyRxDataSecOC_CopyTxDataSecOC_RxIndicationSecOC_SPduTxConfirmationSecOC_StartOfReceptionSecOC_TpRxIndicationSecOC_TpTxConfirmationSecOC_TriggerTransmitSecOC_TxConfirmationCallout-функции и ожидаемые интерфейсы
SecOC_VerificationStatusCalloutЦиклические
IdsM_MainFunctionKeyM_MainFunctionSecOC_MainFunctionRxSecOC_MainFunctionTxТипы
IdsM_ConfigTypeIdsM_Filters_BlockStateTypeIdsM_Filters_ReportingModeTypeIdsM_SecurityEventIdTypeIdsM_TimestampTypeKeyM_CertDataPointerTypeKeyM_CertDataTypeKeyM_CertElementIdTypeKeyM_CertElementIteratorTypeKeyM_CertificateElementTypeKeyM_CertificateIdTypeKeyM_CertificateStatusTypeKeyM_ConfigTypeKeyM_CryptoKeyDataTypeKeyM_CryptoKeyIdTypeKeyM_KH_UpdateOperationTypeKeyM_ResultTypeKeyM_ServiceCertificateTypeKeyM_StartTypeMaxSecOC_ConfigTypeSecOC_FreshnessArrayTypeSecOC_OverrideStatusTypeSecOC_StateTypeSecOC_VerificationResultTypeSecOC_VerificationStatusTypeФункции
IdsM_BswM_StateChangedIdsM_CopyTxDataIdsM_Dcm_GetReportingMode_RequestResultsIdsM_Dcm_GetReportingMode_StartIdsM_Dcm_SetReportingMode_StartIdsM_GetVersionInfoIdsM_InitIdsM_MainFunctionIdsM_SetSecurityEventIdsM_SetSecurityEventWithContextDataIdsM_SetSecurityEventWithCountIdsM_SetSecurityEventWithCountContextDataIdsM_SetSecurityEventWithTimestampCountIdsM_SetSecurityEventWithTimestampCountContextDataIdsM_TpTxConfirmationIdsM_TxConfirmationKeyM_CertElementGetKeyM_CertElementGetFirstKeyM_CertElementGetNextKeyM_CertGetStatusKeyM_CertificateElementGetByIndexKeyM_CertificateElementGetCountKeyM_CertificateVerifyCallbackNotificationKeyM_CryptoKeyFinalizeCallbackNotificationKeyM_CryptoKeyUpdateCallbackNotificationKeyM_CryptoKeyVerifyCallbackNotificationKeyM_DeinitKeyM_FinalizeKeyM_GetCertificateKeyM_GetVersionInfoKeyM_InitKeyM_KH_FinalizeKeyM_KH_PrepareKeyM_KH_StartKeyM_MainBackgroundFunctionKeyM_MainFunctionKeyM_PrepareKeyM_ServiceCertificateCallbackNotificationKeyM_SetCertificateKeyM_StartKeyM_VerifyCertificateKeyM_VerifyCertificateChainKeyM_VerifyCertificatesSecOC_CopyRxDataSecOC_CopyTxDataSecOC_DeInitSecOC_GetRxFreshnessSecOC_GetRxFreshnessAuthDataSecOC_GetTxFreshnessSecOC_GetTxFreshnessTruncDataSecOC_GetVersionInfoSecOC_IfCancelTransmitSecOC_IfTransmitSecOC_InitSecOC_MainFunctionRxSecOC_MainFunctionTxSecOC_RxIndicationSecOC_SendDefaultAuthenticationInformationSecOC_SPduTxConfirmationSecOC_StartOfReceptionSecOC_TpCancelReceiveSecOC_TpCancelTransmitSecOC_TpRxIndicationSecOC_TpTransmitSecOC_TpTxConfirmationSecOC_TriggerTransmitSecOC_TxConfirmationSecOC_VerificationStatusCalloutSecOC_VerifyStatusSecOC_VerifyStatusOverrideТипы
IdsM_ConfigTypeIdsM_Filters_BlockStateTypeIdsM_Filters_ReportingModeTypeIdsM_SecurityEventIdTypeIdsM_TimestampTypeKeyM_CertDataPointerTypeKeyM_CertDataTypeKeyM_CertElementIdTypeKeyM_CertElementIteratorTypeKeyM_CertificateElementTypeKeyM_CertificateIdTypeKeyM_CertificateStatusTypeKeyM_ConfigTypeKeyM_CryptoKeyDataTypeKeyM_CryptoKeyIdTypeKeyM_KH_UpdateOperationTypeKeyM_ResultTypeKeyM_ServiceCertificateTypeKeyM_StartTypeMaxSecOC_ConfigTypeSecOC_FreshnessArrayTypeSecOC_OverrideStatusTypeSecOC_StateTypeSecOC_VerificationResultTypeSecOC_VerificationStatusTypeКарта тем
IdsM
21KeyM
42SecOC
33Для этого релиза нет данных об элементах
IdsM
This callback function is invoked by the BswM to indicate ECU state changes.
void IdsM_BswM_StateChanged (IdsM_Filters_BlockStateType state);This function is called to acquire the transmit data of an I-PDU segment (N-PDU). Each call to this function provides the next part of the I-PDU data unless retry->TpDataState is TP_ DATARETRY. In this case the function restarts to copy the data beginning at the offset from the current position indicated by retry->TxTpDataCnt. The size of the remaining data is written to the position indicated by availableDataPtr.
BufReq_ReturnType IdsM_CopyTxData (PduIdType id, const PduInfoType* info, const RetryInfoType* retry, PduLengthType* availableDataPtr);This function is a request from DCM to the IdsM to read the routine results triggered by function IdsM_Dcm_GetReportingMode_Start().
Std_ReturnType IdsM_Dcm_GetReportingMode_RequestResults (Dcm_OpStatusType OpStatus, uint8* Out_ReportingMode, Dcm_NegativeResponseCodeType* ErrorCode);This function is a request from DCM to the IdsM to start the routine execution to request the current reporting mode of a specific Security Event ID.
Std_ReturnType IdsM_Dcm_GetReportingMode_Start (uint16 In_SecurityEventId, uint8 In_SensorInstanceId, Dcm_OpStatusType OpStatus, Dcm_NegativeResponseCodeType* ErrorCode);This function is a request from DCM to the IdsM to start the routine execution to set the reporting mode of a specific Security Event ID.
Std_ReturnType IdsM_Dcm_SetReportingMode_Start (uint16 In_SecurityEventId, uint8 In_SensorInstanceId, uint8 In_ReportingMode, Dcm_OpStatusType OpStatus, Dcm_NegativeResponseCodeType* ErrorCode);Returns version information, vendor ID and AUTOSAR module ID of the component.
void IdsM_GetVersionInfo (const Std_VersionInfoType* versionInfo);Service to initialize the module IdsM. It initializes all variables and sets the module state to initialized.
void IdsM_Init (const IdsM_ConfigType* configPtr);This function is called periodically. It processes security events asynchronously which are queued during API function calls.
void IdsM_MainFunction (void);This API is the application interface to report security events to the IdsM.
void IdsM_SetSecurityEvent (IdsM_SecurityEventIdType securityEventId);This API is the application interface to report security events with context data to the IdsM.
void IdsM_SetSecurityEventWithContextData (IdsM_SecurityEventIdType securityEventId, const uint8* contextData, uint16 contextDataSize);This API is the application interface for Smart Sensors to report security events with a count value to the IdsM.
void IdsM_SetSecurityEventWithCount (IdsM_SecurityEventIdType securityEventId, uint16 count);This API is the application interface for Smart Sensors to report security events with a count value and context data to the IdsM.
void IdsM_SetSecurityEventWithCountContextData (IdsM_SecurityEventIdType securityEventId, uint16 count, const uint8* contextData, uint16 contextDataSize);This API is the application interface for Smart Sensors to report security events with a timestamp and a count value to the IdsM.
void IdsM_SetSecurityEventWithTimestampCount (IdsM_SecurityEventIdType securityEventId, IdsM_TimestampType timestamp, uint16 count);This API is the application interface for Smart Sensors to report security events with a timestamp, a count value and context data to the IdsM.
void IdsM_SetSecurityEventWithTimestampCountContextData (IdsM_SecurityEventIdType securityEventId, IdsM_TimestampType timestamp, uint16 count, const uint8* contextData, uint16 contextDataSize);This function is called after the I-PDU has been transmitted on its network, the result indicates whether the transmission was successful or not.
void IdsM_TpTxConfirmation (PduIdType id, Std_ReturnType result);The lower layer communication interface module confirms the transmission of a PDU, or the failure to transmit a PDU.
void IdsM_TxConfirmation (PduIdType TxPduId, Std_ReturnType result);Configuration data structure of IdsM module.
Data type used for "Block State" filter values (bit masks)
Reporting modes used by the reporting mode filter
Data type used for local IdsM Security Event IDs
Data type for IdsM timestamps
KeyM
Service KeyM_CertElementGet.
Std_ReturnType KeyM_CertElementGet (KeyM_CertificateIdType CertId, KeyM_CertElementIdType CertElementId, uint8* CertElementData, uint32* CertElementDataLength);Service KeyM_CertElementGetFirst.
Std_ReturnType KeyM_CertElementGetFirst (KeyM_CertificateIdType CertId, KeyM_CertElementIdType CertElementId, KeyM_CertElementIteratorType* CertElementIterator, uint8* CertElementData, uint32* CertElementDataLength);Service KeyM_CertElementGetNext.
Std_ReturnType KeyM_CertElementGetNext (KeyM_CertElementIteratorType* CertElementIterator, uint8* CertElementData, uint32* CertElementDataLength);This function provides the sta tus of a certificate.
Std_ReturnType KeyM_CertGetStatus (KeyM_CertificateIdType CertId, KeyM_CertificateStatusType* Status);Service KeyM_CertificateElementGetByIndex.
Std_ReturnType KeyM_CertificateElementGetByIndex (KeyM_CertificateIdType CertId, KeyM_CertElementIdType CertElementId, uint32 Index, uint8* CertElementDataPtr, uint32* CertElementDataLengthPtr);This function provides the total number of data elements that a re available for the specified certificate element. Typically, only one data element is available. But in some cases, several data elements can be assigned to one certificate element in a row. This function retrieves the total number of elements. The indiv idual data elements can then accessed with Key M_ Certificate Element Get By Index(). It is similar to the functions Key M_ Cert Element Get First/ Key M_ Cert Element Get Next to retrieve a group of data elements of one certificate element. AUTOSAR CP R20 - of
Std_ReturnType KeyM_CertificateElementGetCount (KeyM_CertificateIdType CertId, KeyM_CertElementIdType CertElementId, uint16* CountPtr);Notifies the application that a certificate verification has been finished. The function name is configurable by Key MCertificate Verify Callback Notification Func. Availabl e via Key M_ Externals.h
Std_ReturnType KeyM_CertificateVerifyCallbackNotification (KeyM_CertificateIdType CertId, KeyM_CertificateStatusType Result);This function resets the key management module to the uninitialized state.
void KeyM_Deinit (void);The function is used to finalize key update operations. It is typi cally used in conjunction with the Key M_
Std_ReturnType KeyM_Finalize (const uint8* RequestDataPtr, uint16 RequestDataLength, uint8* ResponseDataPtr, uint16 ResponseMaxDataLength);This function provides the certificate data
Std_ReturnType KeyM_GetCertificate (KeyM_CertificateIdType CertId, KeyM_CertDataType* CertificateDataPtr);Provides the version information of this module.
void KeyM_GetVersionInfo (Std_VersionInfoType* VersionInfo);This function initializes the key management module.
void KeyM_Init (const KeyM_ConfigType* ConfigPtr);If Key MCrypto Key Start Finalize Function Enabled and Key MCrypto Key Handler Start Finalize Enabled is set to TRUE, this function will be called immediately when Key M_
Std_ReturnType KeyM_KH_Finalize (const uint8* RequestData, uint16 RequestDataLength, uint8* ResponseData, uint16* ResponseDataLength);If the configuration parameters Key MCrypto Key Prepare Function Enabled and Key MCrypto Key Handler Prepare Enabled are both set to TRUE, then this function w ill be called immediately when Key M_ Prepare gets called. The function takes over the task to prepare a key management operation. The response data will be passed on as is to the caller of Key_ Prepare.
Std_ReturnType KeyM_KH_Prepare (const uint8* RequestData, uint16 RequestDataLength, uint8* ResponseDataPtr, uint16* ResponseDataLength);If Key MCrypto Key Start Finalize Function Enabled and Key MCrypto Key
Std_ReturnType KeyM_KH_Start (KeyM_StartType StartType, const uint8* RequestData, uint16 RequestDataLength, uint8* ResponseData, uint16* ResponseDataLength);Function is called from a pre - emptive operating system when no other task operation is needed. Can be used for calling time consuming synchronous functions such as Key M_ KH_ Update().
void KeyM_MainBackgroundFunction (void);Function is called periodically according the specified time interval.
void KeyM_MainFunction (void);This function is used to prepare a key update operation. The main intent is to provide information for the key operation to the key server. Other operations may start the negotiation for a common secret that is used further to derive key material. This function is only av ailable if Key MCrypto Key Prepare Function Enabled is set to TRUE.
Std_ReturnType KeyM_Prepare (const uint8* RequestData, uint16 RequestDataLength, uint8* ResponseData, uint16* ResponseDataLength);Notifies the application that the certificate service operation has been finished. This function is used by the certificate submodule. Thi s callback is only provided if Key MService Certificate Function Enabled is set to TRUE. The function name is configurable by Key MService Certificate Callback Notification Func.
This function provides the certificate data to the key managem ent module to temporarily store the certificate.
Std_ReturnType KeyM_SetCertificate (KeyM_CertificateIdType CertId, const KeyM_CertDataType* CertificateDataPtr);This function is optional and only used if the configuration item Key MCrypto Key Start Finalize Function Enabled is set to true. It intents to allow key update operation.
Std_ReturnType KeyM_Start (KeyM_StartType StartType, const uint8* RequestData, uint16 RequestDataLength, uint8* ResponseData, uint16* ResponseDataLength);Service KeyM_VerifyCertificate.
Std_ReturnType KeyM_VerifyCertificate (KeyM_CertificateIdType CertId);Service KeyM_VerifyCertificateChain.
Std_ReturnType KeyM_VerifyCertificateChain (KeyM_CertificateIdType CertId, const KeyM_CertDataType[] certChainData, uint8 NumberOfCertificates);This function verifies two certificates that are stored and parsed internally against each other. The certificat e referenced with Cert Id was signed by the certificate referenced with cert Upper Id. Only these two certificates are validated against each other.
Std_ReturnType KeyM_VerifyCertificates (KeyM_CertificateIdType CertId, KeyM_CertificateIdType CertUpperId);Byte - pointer to the data of the certificate
This structure is used to exchange certificate data through interface functions.
Certificate Element handle.
This structure is used to iterate through a number of elements of a certificate.
Array long enough to store data
Certificate handle.
Type KeyM_CertificateStatusType.
This structure is the base type to initialize the Key Manager module. A pointer to an instance of this structure will be used in the initialization of the Key Manager module.
Byte - pointer to the input or output data
Crypto key handle.
Specifies the type of key handler update operation that was performed in the callback.
Specifies the result type of an asynchronous key management fu nction.
This type specifies the requested service operation and what information is provided with this function.
This type specifies in which mode the key operation will start. The OEM production mode provides higher privileges compared to workshop mode.
Array long enough to store the key or certificate name. base Type Encoding = UTF -
SecOC
This function is called to provide the received data of an I - PDU segment (N - PDU) to the upper layer. Each call to this function provides the next part of the I - PDU data. The si ze of the remaining buffer is written to the position indicated by buffer Size Ptr.
BufReq_ReturnType SecOC_CopyRxData (PduIdType id, const PduInfoType* info, PduLengthType* bufferSizePtr);Service SecOC_CopyTxData.
BufReq_ReturnType SecOC_CopyTxData (PduIdType id, const PduInfoType* info, const RetryInfoType* retry, PduLengthType* availableDataPtr);This service stops the secure onboard communication. All buffered I - PDU are removed and have to be obtained again, if needed, after Sec OC_ Init has been called. By a call to Sec OC_ De Init the AUTOSAR Sec OC module is put into a not in itialized state (Sec OC_ UNINIT).
void SecOC_DeInit (void);Service SecOC_GetRxFreshnessAuthData.
Std_ReturnType SecOC_GetRxFreshnessAuthData (uint16 SecOCFreshnessValueID, const uint8* SecOCTruncatedFreshnessValue, uint32 SecOCTruncatedFreshnessValueLength, const uint8* SecOCAuthDataFreshnessValue, uint16 SecOCAuthDataFreshnessValueLength, uint16 SecOCAuthVerifyAttempts, uint8* SecOCFreshnessValue, uint32* SecOCFreshnessValueLength);This API returns th e freshness value from the Most Significant Bits in the first byte in the array (Sec OCFreshness Value), in big endian format.
Std_ReturnType SecOC_GetTxFreshness (uint16 SecOCFreshnessValueID, uint8* SecOCFreshnessValue, uint32* SecOCFreshnessValueLength);Returns the version information of this module.
void SecOC_GetVersionInfo (Std_VersionInfoType* versioninfo);Requests cancellation of an ongoing transmission of a PDU in a lower layer communication module.
Std_ReturnType SecOC_IfCancelTransmit (PduIdType TxPduId);Requests transmission of a PDU.
Std_ReturnType SecOC_IfTransmit (PduIdType TxPduId, const PduInfoType* PduInfoPtr);Initializes the the Sec OC module. Successful initialization leads to state Sec OC_ INIT. In configurations, in which Sec OC is assigned to more than one partition (i.e. Sec OC_ Main Functions are mapped to partition s), Sec OC may provide one init AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_SecureOnboardCommunication function per partition. The decision on whether a single Sec OC_ Init() function or one per partition is provided is implementation - specific. In case a given implementation provides one Sec OC_ Init() function per partition, it is up to the implementation to devise a naming pattern that prevents name clashes among the different Sec OC_ Init() functions (e.g., by adding a suffix containing short name the Ecuc Partition.
void SecOC_Init (const SecOC_ConfigType* config);This function performs the processing of the Sec OC module's authentication and verification processing for the Rx path. Per configured Sec OCMain Function Rx instance one Sec OC_ Main Function Rx_ shall be implemented. Hereby is the short name of the Sec OCMain Function Rx configuration container in the ECU configuration.
void SecOC_MainFunctionRx (void);This function performs the processing of the Sec OC module's authentication and verification processing for the Tx path. Per configured Sec OCMain Function Tx instance one Sec OC_ Main Function Tx_ shall be implemented. Hereby is t he short name of the Sec OCMain Function Tx configuration container in the ECU configuration.
void SecOC_MainFunctionTx (void);Indication of a received PDU from a lower layer communication interface module.
void SecOC_RxIndication (PduIdType RxPduId, const PduInfoType* PduInfoPtr);The service provides the ability to enable the sending of un - authenticated PDU to lower layer. (example: in case authentication build counter has reached the configuration value Sec OCAuthentication Build Attempts or the query of the freshness function returns E_ NOT_ OK or the calculation of the authenticator has returned a non - recoverable error such as returning E_ NOT_ OK or KEY_ FAILURE). T his service is optional (the service is available only if Sec OCDefault Authentication Information Pattern is configured). If the service is not available or the service is available but the service was called with send Default
Std_ReturnType SecOC_SendDefaultAuthenticationInformation (uint16 FreshnessValueID, boolean sendDefaultAuthenticationInformation);This interface is used by the Sec OC to indicate that the Secured I - PDU has been initiated for transmission.
void SecOC_SPduTxConfirmation (uint16 SecOCFreshnessValueID);Service SecOC_StartReception.
BufReq_ReturnType SecOC_StartOfReception (PduIdType id, const PduInfoType* info, PduLengthType TpSduLength, PduLengthType* bufferSizePtr);Requests cancellation of an ongoing reception of a PDU in a lower layer transport protocol module.
Std_ReturnType SecOC_TpCancelReceive (PduIdType RxPduId);Requests cancellation of an ongoing transmission of a PDU in a lower layer communication module.
Std_ReturnType SecOC_TpCancelTransmit (PduIdType TxPduId);Called after an I - PDU has been received via the TP API, the result indicates whether the transmission was successful or not.
void SecOC_TpRxIndication (PduIdType id, Std_ReturnType result);Requests transmission of a PDU.
Std_ReturnType SecOC_TpTransmit (PduIdType TxPduId, const PduInfoType* PduInfoPtr);This function is called after the I - PDU has been transmitted on its network, the result indicates whether the transmission was successful or not.
void SecOC_TpTxConfirmation (PduIdType id, Std_ReturnType result);Within this API , the upper layer module (called module) shall check whether the available data fits into the buffer size reported by Pdu Info Ptr - >Sdu Length. If it fits, it shall copy its data into the buffer provided by Pdu Info Ptr - >Sdu Data Ptr and update the length of the actual copied data in Pdu Info Ptr - >Sdu Length. If not, it returns E_ NOT_ OK without changing Pdu Info Ptr.
Std_ReturnType SecOC_TriggerTransmit (PduIdType TxPduId, PduInfoType* PduInfoPtr);The lower layer communication interface module confirms the transmission of a PDU, or the failure to transmit a PDU.
void SecOC_TxConfirmation (PduIdType TxPduId, Std_ReturnType result);Service is used to propagate the status of each verification attempt from the Sec OC module to other modules. This service can be configured such that: Only: "False" Verifica tion Status is propagated to modules Both: "True" and "False" Verification Status are propagated to modules None: No Verification Status is propagated
void SecOC_VerificationStatusCallout (SecOC_VerificationStatusType verificationStatus);This s ervice provides the ability to inform the application about the result of the verification attempt of a received PDU by the Sec OC module.
void SecOC_VerifyStatus (SecOC_VerificationStatusType verificationStatus);Service SecOC_VerifyStatusOverride.
Std_ReturnType SecOC_VerifyStatusOverride (uint16 ValueID, SecOC_OverrideStatusType overrideStatus, uint8 numberOfMessagesToOverride);Configuration data structure of Sec OC module
Type SecOC_OverrideStatusType.
States of the Sec OC module
Enumeration to indicate veri fication results.
Data structure to bundle the status of a verification attempt for a specific Freshness Value and Data ID
Module im Cluster
Firewall (Fw)
AUTOSAR Classic Communication Services-Modul Firewall (Fw, Spezifikation: AUTOSAR_CP_SWS_Firewall.pdf).
Intrusion Detection System Manager (IdsM)
Collects and reports onboard security events to detect threats.
Key Manager (KeyM)
Manages lifecycle, storage, and distribution of cryptographic keys and certificates.
MACsec Key Agreement (Mka)
AUTOSAR Classic Communication Services-Modul MACsec Key Agreement (Mka, Spezifikation: AUTOSAR_CP_SWS_MACsecKeyAgreement.pdf, AUTOSAR_SWS_MACsecKeyAgreement.pdf).
Secure Onboard Communication (SecOC)
Provides cryptographic authentication and freshness protection for critical communication PDUs.
gemini-3.8-flash-low· 2026-10-13 · Немецкий оригинал