DEENESPTFRRUARHIKOZHNL

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).

Guide du clusterGÉNÉRÉ PAR IA

Garantit la sécurité à bord grâce aux services cryptographiques, à l'authentification des PDU, à la gestion des clés et à la détection d'événements.
GÉNÉRÉ PAR IA non vérifié Modèle : gemini-3.8-flash-medium · Effort : medium · Température : non réglable · Prompt : 2b0b830492f5 Provenance Questions ouvertes (2)
Ancre causale : R20-11 Valable à partir de R20-11 Synthétisé pour cette version de spécification.
traduit du guide allemandgemini-3.8-flash-low · 2026-10-13 · Original allemand

Garantit la sécurité à bord grâce aux services cryptographiques, à l'authentification des PDU, à la gestion des clés et à la détection d'événements.

Le cluster Security & Intrusion Detection met à disposition des primitives cryptographiques via CSM, CryIf et Crypto Driver, protège les I-PDU avec des données d'authentification via SecOC et gère les clés ainsi que les certificats avec KeyM AUTOSAR_CP_SWS_CryptoServiceManager p. 21. Les incidents de sécurité sont signalés sous forme d'événements à l'IdsM, où ils sont mis en mémoire tampon et filtrés de manière asynchrone [SWS_IdsM_00702]. Lors de l'arrêt, l'effacement actif des données de clés en RAM protège contre toute compromission non autorisée.

Le cluster de modules Security & Intrusion Detection réunit les modules secoc, idsm, keym, csm, cryif et crypto pour sécuriser la communication du véhicule et détecter les incidents de sécurité dans l'AUTOSAR Classic Platform AUTOSAR_CP_SWS_IntrusionDetectionSystemManager p. 21. Les services cryptographiques de base sont fournis de manière hiérarchique par le Crypto Service Manager (CSM), qui encapsule les jobs dans des structures Crypto_JobType [SWS_Csm_01013] et les transmet via le Crypto Interface (CryIf_ProcessJob [SWS_CryIf_91003]) aux objets pilotes matériels ou logiciels spécifiques du Crypto Driver.

La communication des PDU est protégée par SecOC au moyen de codes d'authentification de message (MAC) et de valeurs de fraîcheur ([SWS_SecOC_91006], [SWS_SecOC_00012]), tandis que le Key Manager (KeyM) prépare, met à jour et valide les certificats et les clés pour le CSM ([SWS_KeyM_00052], [SWS_KeyM_00059]). Les événements pertinents pour la sécurité – tels que les échecs de vérification de PDU – sont signalés sous forme de Security Events (SEv) à l'IdsM [SWS_IdsM_91002], qui les met en mémoire tampon de manière synchrone [SWS_IdsM_00701] et les qualifie de manière asynchrone via des chaînes de filtrage configurables [SWS_IdsM_01020].

SecArch SWC Application SW-Cs / Sensors IdsM IdsM (Intrusion Detection System Manager) SWC->IdsM IdsM_SetSecurityEvent SecOC SecOC (Secure Onboard Communication) SecOC->IdsM Security Events CSM CSM (Crypto Service Manager) SecOC->CSM Csm_MacGenerate / Csm_MacVerify PduR PduR (PDU Router) SecOC->PduR Secured / Authentic I-PDUs KeyM KeyM (Key Manager) KeyM->CSM Csm_KeyElementSet / Primitives CryIf CryIf (Crypto Interface) CSM->CryIf CryIf_ProcessJob / Key APIs Crypto Crypto Driver (Hardware / Software) CryIf->Crypto Crypto_ProcessJob / Driver Objects PduR->SecOC PDU Reception / Transmission

Diagramme d'architecture : architecture en couches et relations d'interface du cluster Security et Intrusion Detection. Sources : AUTOSAR_CP_SWS_IntrusionDetectionSystemManager p. 21, AUTOSAR_CP_SWS_CryptoServiceManager p. 21.

L'exécution sépare les points d'entrée d'API synchrones des tâches d'arrière-plan intensives en calcul dans IdsM_MainFunction, SecOC_MainFunctionTx [SWS_SecOC_00176] et KeyM_MainBackgroundFunction [SWS_KeyM_00075]. En cas d'erreur ou de surcharge du système (CRYPTO_E_BUSY), des mécanismes de repli tels que des motifs d'authentification par défaut dans SecOC [SWS_SecOC_91013] et des rollbacks NvM dans l'IdsM [SWS_IdsM_01702] assurent la stabilité globale du système ; lors de l'arrêt, KeyM efface intégralement le matériel de clé actif en RAM [SWS_KeyM_00047].

Architecture système & rôle du cluster de modules

Le cluster de modules Security & Intrusion Detection de l'AUTOSAR Classic Platform (Release R20-11) fournit des services standardisés pour la cryptographie, la communication sécurisée à bord, la gestion des clés et des certificats ainsi que la détection d'attaques. Sur le plan fonctionnel, le cluster s'articule sur plusieurs couches du Basic Software AUTOSAR (BSW) : au niveau service, le Crypto Service Manager (CSM) encapsule les services cryptographiques indépendants du matériel AUTOSAR_CP_SWS_CryptoServiceManager p. 21. La communication sécurisée des I-PDU est prise en charge par le module Secure Onboard Communication (SecOC) dans la couche de communication [SWS_SecOC_00162], tandis que le Key Manager (KeyM) orchestre, en tant que service de sécurité, le cycle de vie des clés cryptographiques et des certificats SWS_KeyManager p. 31. En complément, l'Intrusion Detection System Manager (IdsM) agit comme agrégateur et filtre central pour les événements pertinents pour la sécurité dans l'ensemble du système AUTOSAR_CP_SWS_IntrusionDetectionSystemManager p. 21.

Sous le CSM, le Crypto Interface (CryIf) abstrait, en tant que couche CryIf, l'accès spécifique au matériel ou au logiciel à plusieurs objets pilotes cryptographiques et uniformise le mécanisme de dispatching des ordres et des clés SWS_CryptoInterface p. 1. Au niveau MCAL et pilote, le Crypto Driver (Crypto) exécute les calculs réels dans le logiciel ou sur des modules de sécurité matériels (HSM) [SWS_Crypto_91016]. L'interaction de ces couches garantit un découplage total du logiciel d'application (SW-C) et des modules de communication par rapport aux accélérateurs cryptographiques spécifiques au matériel.

SecArch SWC Application SW-Cs / Sensors IdsM IdsM (Intrusion Detection System Manager) SWC->IdsM IdsM_SetSecurityEvent SecOC SecOC (Secure Onboard Communication) SecOC->IdsM Security Events CSM CSM (Crypto Service Manager) SecOC->CSM Csm_MacGenerate / Csm_MacVerify PduR PduR (PDU Router) SecOC->PduR Secured / Authentic I-PDUs KeyM KeyM (Key Manager) KeyM->CSM Csm_KeyElementSet / Primitives CryIf CryIf (Crypto Interface) CSM->CryIf CryIf_ProcessJob / Key APIs Crypto Crypto Driver (Hardware / Software) CryIf->Crypto Crypto_ProcessJob / Driver Objects PduR->SecOC PDU Reception / Transmission

Diagramme d'architecture : architecture en couches et relations d'interface du cluster Security et Intrusion Detection. Sources : AUTOSAR_CP_SWS_IntrusionDetectionSystemManager p. 21, AUTOSAR_CP_SWS_CryptoServiceManager p. 21.

Interaction & voies d'interaction entre les modules

Les modules du cluster sont interconnectés via des chemins de flux de contrôle et de données clairement définis. Le traitement des jobs cryptographiques s'effectue principalement via le CSM. Les modules applicatifs ou les modules BSW tels que SecOC et KeyM initient des ordres via des services CSM tels que 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] ou Csm_RandomGenerate [SWS_Csm_01543]. Les ordres sont encapsulés dans la structure d'exécution standardisée Crypto_JobType [SWS_Csm_01013], qui est pilotée par des modes de fonctionnement (Crypto_OperationModeType tels que CRYPTO_OPERATIONMODE_START, UPDATE, FINISH ou SINGLECALL) [SWS_Csm_00802]. Le CSM transmet le job à CryIf_ProcessJob [SWS_CryIf_91003], qui achemine l'appel vers l'objet pilote cryptographique compétent.

Le module SecOC sécurise le transfert de PDU entre le PduR et le bus de communication. Lors de la réception d'une PDU sécurisée via SecOC_TpRxIndication [SWS_SecOC_00125], SecOC récupère d'abord des valeurs de fraîcheur via SecOC_GetRxFreshnessAuthData [SWS_SecOC_91006] et construit les données à authentifier conformément à la spécification SecOcProtocol p. 19. Pour la vérification MAC, SecOC fait appel au CSM [SWS_SecOC_00012]. Après un contrôle réussi, la PDU authentique est transmise aux couches supérieures. Si la vérification échoue, le résultat est consigné dans l'état SecOC_VerificationStatusType [SWS_SecOC_00160], [SWS_SecOC_91014] ; interprétation : cet échec est signalé sous forme de Security Event à l'IdsM AUTOSAR_CP_SWS_IntrusionDetectionSystemManager p. 21. Question Q-8cfd1660757f3f1f (ouverte)

Dans le Key Manager (KeyM), les mises à jour de clés et de certificats sont préparées et réalisées. Lors des vérifications de certificats (par exemple via KeyM_VerifyCertificates [SWS_KeyM_00059] ou KeyM_VerifyCertificateChain [SWS_KeyM_00061]), KeyM utilise les primitives cryptographiques du CSM pour la vérification de signature ainsi que des bases de temps externes du StbM pour la vérification de validité SWS_KeyManager p. 119. Les mises à jour de clés (KeyM_Update [SWS_KeyM_00052]) intègrent des gestionnaires spécifiques à l'utilisateur (KeyM_KH_Update [SWS_KeyM_00069], [SWS_KeyM_00055]), les octets de clé résultants étant activés dans le pilote cryptographique via Csm_KeyElementSet [SWS_Csm_00957] et Csm_JobKeySetValid [SWS_Csm_91027]. CryIf relaie les dérivations de clés et les opérations de copie via CryIf_KeyDerive [SWS_CryIf_91009] ou CryIf_KeyElementCopy [SWS_CryIf_91015] vers des fonctions de pilote telles que Crypto_KeyElementCopyPartial [SWS_Crypto_91015].

L'IdsM collecte les événements de sécurité (Security Events, SEv) provenant des capteurs BSW (dont SecOC) ainsi que des SW-C applicatifs via des interfaces telles que IdsM_SetSecurityEvent [SWS_IdsM_91002] ou IdsM_SetSecurityEventWithCount [SWS_IdsM_91018]. Les événements sont mis en mémoire tampon, qualifiés via des chaînes de filtrage (par exemple Block State Filter [SWS_IdsM_01020] ou filtre d'agrégation AUTOSAR_CP_SWS_IntrusionDetectionSystemManager p. 40) et finalement retransmis via PduR [SWS_IdsM_91009], [SWS_IdsM_91010].

Vérification d'une PDU sécurisée dans SecOC avec pile cryptographique et notification à l'IdsMPduRSecOCCSMCryIfCryptoIdsMSecOC_TpRxIndication(id, result)PDU parsen & Freshness Value abrufenCsm_MacVerify(jobId, mode, ...)CryIf_ProcessJob(channelId, job)Crypto_ProcessJob(objectId, job)CryIf_CallbackNotification(job, result)Csm_CallbackNotification(job, result)Rappel avec résultat de vérificationaltVerifikation erfolgreichPduR Weiterleitung (Authentic PDU)Verifikation fehlgeschlagenIdsM_SetSecurityEvent(SEV_VERIFICATION_FAILURE)Mise en tampon dans le tampon d'événements & filtrage

Diagramme de séquence : vérification d'une PDU sécurisée dans SecOC à l'aide de la pile cryptographique et notification d'événements de sécurité à l'IdsM. Sources : [SWS_SecOC_00125], [SWS_SecOC_00012], [SWS_CryIf_91003], [SWS_CryIf_91013], [SWS_IdsM_91002].

Synchronisation, réentrance et contextes de tâches

L'exécution des calculs cryptographiques et des opérations de sécurité requiert une stricte séparation entre les chemins d'appel synchrones et les contextes de tâches asynchrones. Dans le CSM et CryIf, le comportement d'exécution dépend de la configuration des primitives cryptographiques : les opérations peuvent se dérouler de manière synchrone bloquante ou asynchrone [SWS_Csm_00982], [SWS_CryIf_91003]. En cas de jobs asynchrones, le pilote cryptographique signale l'achèvement via CryIf_CallbackNotification [SWS_CryIf_91013], à la suite de quoi le CSM traite la fonction de rappel enregistrée de l'appelant [SWS_SecOC_00012]. Pour les calculs interruptibles ou à exécution plus longue, le CSM fournit la fonction d'interruption Csm_CancelJob [SWS_Csm_00968], qui est déléguée au pilote via CryIf_CancelJob [SWS_CryIf_91014].

La transmission dans le module SecOC est découplée de manière temporisée : lors de cycles périodiques, SecOC_MainFunctionTx vérifie si de nouvelles PDU authentiques sont en attente de signature, calcule les authentificateurs et initie l'envoi via PduR [SWS_SecOC_00176]. Dans l'IdsM, la prise en charge des événements signalés s'effectue avec de hautes performances dans le contexte du capteur (tâche ou ISR) via IdsM_SetSecurityEvent [SWS_IdsM_91002], les événements étant d'abord déposés de manière synchrone dans des tampons d'événements configurables [SWS_IdsM_00701], [SWS_IdsM_00702]. Le filtrage chronophage, le traitement des données de contexte et l'enrichissement par horodatage via StbM ou la RTE sont intégralement traités de manière asynchrone dans le contexte de la fonction périodique IdsM_MainFunction SWS_IntrusionDetectionSystemManager p. 87, AUTOSAR_CP_SWS_IntrusionDetectionSystemManager p. 86.

Le Key Manager distingue les tâches critiques en temps de celles intensives en calcul : alors que les interrogations d'état standard et les orchestrations de rappels s'exécutent dans KeyM_MainFunction [SWS_KeyM_00074], l'exécution dans une fonction d'arrière-plan préemptive KeyM_MainBackgroundFunction est prévue pour les déroulements de gestionnaires synchrones intensifs en calcul (tels que KeyM_KH_Update) [SWS_KeyM_00075]. Dans les architectures multicœurs, le CSM prend en charge en outre des fonctions principales et des initialisations spécifiques aux partitions [SWS_Csm_00646], SWS_CryptoInterface p. 1 ; interprétation : ce partitionnement correspond à l'affectation d'objets pilotes matériels dédiés par cœur de processeur. Question (ouverte)

Cycles de vie et modes de fonctionnement typiques

L'initialisation du cluster suit une hiérarchie de dépendances stricte, de bas en haut. Les pilotes proches du matériel sont d'abord configurés via Crypto_Init [SWS_Crypto_91016], suivis par l'interface CryIf [SWS_CryIf_91118] et le CSM via Csm_Init [SWS_Csm_00646]. Ce n'est qu'après que les modules dépendants SecOC, KeyM et IdsM peuvent être initialisés. Par l'initialisation, SecOC passe de l'état SECOC_UNINIT à SECOC_INIT [SWS_SecOC_00162]. Dans KeyM, tous les certificats configurés reçoivent initialement l'état KEYM_CERTIFICATE_NOT_AVAILABLE [SWS_KeyM_00021], [SWS_KeyM_91003], avant d'être lus depuis la NvM ou chargés et vérifiés via KeyM_SetCertificate ou par diagnostic SWS_KeyManager p. 119.

Au moment de l'exécution, les changements d'état du véhicule influencent le mode de fonctionnement de l'IdsM : le Basic Software Manager (BswM) notifie les changements d'état à l'IdsM via IdsM_BswM_StateChanged [SWS_IdsM_91005]. Ces états commandent le Block State Filter [SWS_IdsM_01020], [SWS_IdsM_91017], ce qui supprime la transmission des événements de sécurité lors de certaines phases d'exploitation (par exemple le mode de programmation ou les phases de sommeil). De plus, les modes de rapport d'événements peuvent être modifiés par diagnostic via le DCM (IdsM_Dcm_SetReportingMode_Start [SWS_IdsM_91008], [SWS_IdsM_91013]) et stockés de façon persistante dans la NvM [SWS_IdsM_01700], [SWS_IdsM_01701].

Lors de l'arrêt du calculateur (Shutdown), les modules sont désinitialisés de façon ordonnée. SecOC_DeInit arrête la communication sécurisée, vide tous les tampons ainsi que les variables internes et ramène SecOC à l'état SECOC_UNINIT [SWS_SecOC_00161]. Lors de l'appel de KeyM_Deinit [SWS_KeyM_00047], tout le matériel de clé cryptographique présent en RAM est activement détruit et écrasé avec des valeurs initiales pour des raisons de sécurité, afin d'empêcher toute lecture non autorisée à l'état de repos.

Gestion des erreurs, traçage DET et dégradation

Le cluster de modules implémente des mécanismes de bout en bout pour la détection des erreurs de développement (Development Error Tracer, DET) et des problèmes d'exécution. Tous les modules contrôlent leur initialisation et signalent des erreurs DET en cas d'appel non initialisé, par exemple CRYIF_E_UNINIT dans des interfaces CryIf telles que CryIf_RandomSeed [SWS_CryIf_91007], CryIf_CancelJob [SWS_CryIf_91014], CryIf_KeyDerive [SWS_CryIf_91009] ou CryIf_CallbackNotification [SWS_CryIf_91013]. De même, des paramètres de pointeur erronés entraînent des notifications DET, telles que CRYPTO_E_PARAM_POINTER dans Crypto_GetVersionInfo [SWS_Crypto_91001], tandis que les erreurs d'initialisation dans le CSM sont signalées par CSM_E_INIT_FAILED [SWS_Csm_00646].

En cas de surcharge ou de défaillance d'objets matériels cryptographiques, le pilote signale l'état CRYPTO_E_BUSY [SWS_CryIf_91003], [SWS_Csm_00957]. Dans de tels scénarios de dégradation, SecOC autorise via SecOC_SendDefaultAuthenticationInformation l'envoi configurable de PDU de remplacement non authentifiées aux couches inférieures afin de maintenir la disponibilité du véhicule [SWS_SecOC_91013]. Dans l'IdsM, une saturation des tampons d'événements configurés déclenche l'événement de sécurité interne SEV_IDSM_NO_EVENT_BUFFER_AVAILABLE [SWS_IdsM_00703]. Si la persistance en NvM de paramètres IdsM modifiés échoue, l'IdsM effectue un rollback automatique vers l'état précédent [SWS_IdsM_01702]. Si une erreur survient lors de la définition de clés dans Csm_KeyElementSet, l'état de l'élément de clé est considéré comme non défini et doit être validé via Csm_KeyGetStatus [SWS_Csm_91047] et CryIf_KeyGetStatus [SWS_CryIf_91012].

Ce guide repose sur les spécifications AUTOSAR de la Classic Platform pour la Release R20-11 et résume l'architecture du cluster Security & Intrusion Detection.

Carte des thèmes

Vue détaillée

Sélectionnez une entrée dans le plan.

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);
IdsM_Init fonction

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);

Service KeyM_CryptoKeyFinalizeCallbackNotification.

void KeyM_CryptoKeyFinalizeCallbackNotification (KeyM_ResultType Result, uint16 ResultDataLength, const uint8* ResultDataPtr);

Notifies the application that a crypto key update operation has been finished. This function is used by the key manager.

void KeyM_CryptoKeyUpdateCallbackNotification (KeyM_ResultType Result, uint16 ResultDataLength, const uint8* ResultDataPtr);

Notifies the application that a crypto key verify operation has been finished. This function is used by the key manager.

void KeyM_CryptoKeyVerifyCallbackNotification (KeyM_ResultType Result, uint32 KeyId, uint16 ResultDataLength, const uint8* ResultDataPtr);
KeyM_Deinit fonction

This function resets the key management module to the uninitialized state.

void KeyM_Deinit (void);
KeyM_Finalize fonction

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);
KeyM_Init fonction

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);
KeyM_KH_Start fonction

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);
KeyM_Prepare fonction

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.

void KeyM_ServiceCertificateCallbackNotification (KeyM_CertificateIdType CertId, KeyM_ResultType Result, uint16 ResultDataLength, const uint8* ResultDataPtr);

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);
KeyM_Start fonction

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.

Max type

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);
SecOC_DeInit fonction

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_GetRxFreshness.

Std_ReturnType SecOC_GetRxFreshness (uint16 SecOCFreshnessValueID, const uint8* SecOCTruncatedFreshnessValue, uint32 SecOCTruncatedFreshnessValueLength, uint16 SecOCAuthVerifyAttempts, uint8* SecOCFreshnessValue, uint32* SecOCFreshnessValueLength);

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);

Service SecOC_GetTxFreshnessTruncData.

Std_ReturnType SecOC_GetTxFreshnessTruncData (uint16 SecOCFreshnessValueID, uint8* SecOCFreshnessValue, uint32* SecOCFreshnessValueLength, uint8* SecOCTruncatedFreshnessValue, uint32* SecOCTruncatedFreshnessValueLength);

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);
SecOC_Init fonction

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).

BSW ID 111 Keine C-API · 0 Records #include "Fw.h"

Intrusion Detection System Manager (IdsM)

Collects and reports onboard security events to detect threats.

BSW ID 108 21 APIs (16 Funktionen, 5 Typen) #include "IdsM.h"

Key Manager (KeyM)

Manages lifecycle, storage, and distribution of cryptographic keys and certificates.

BSW ID 109 42 APIs (27 Funktionen, 15 Typen) #include "KeyM.h"

MACsec Key Agreement (Mka)

AUTOSAR Classic Communication Services-Modul MACsec Key Agreement (Mka, Spezifikation: AUTOSAR_CP_SWS_MACsecKeyAgreement.pdf, AUTOSAR_SWS_MACsecKeyAgreement.pdf).

BSW ID 151 Keine C-API · 0 Records #include "Mka.h"

Secure Onboard Communication (SecOC)

Provides cryptographic authentication and freshness protection for critical communication PDUs.

BSW ID 150 33 APIs (27 Funktionen, 6 Typen) #include "SecOC.h"