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

دليل العنقودمولَّد بالذكاء الاصطناعي

يضمن أمان المركبة من خلال خدمات التشفير ومصادقة PDU وإدارة المفاتيح واكتشاف الأحداث.
مُولَّد بالذكاء الاصطناعي غير مُراجَع النموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 2b0b830492f5 المصدر أسئلة مفتوحة (2)
المرساة السببية: R20-11 صالح اعتبارًا من R20-11 مُركَّب حديثًا لهذا الإصدار من المواصفة.
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني

يضمن أمان المركبة من خلال خدمات التشفير ومصادقة PDU وإدارة المفاتيح واكتشاف الأحداث.

يوفر عنقود Security & Intrusion Detection العناصر الأولية للتشفير عبر CSM وCryIf وCrypto Driver، ويحمي I-PDUs ببيانات المصادقة عبر 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] ويعيد توجيهها عبر واجهة التشفير (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 الفاشلة – كأحداث أمنية (SEv) إلى IdsM [SWS_IdsM_91002]، والذي يخزنها مؤقتًا بشكل متزامن [SWS_IdsM_00701] ويؤهلها بشكل غير متزامن عبر سلاسل تصفية قابلة للتكوين [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

مخطط معماري: البنية الطبقية وعلاقات الواجهات لعنقود الأمان واكتشاف التسلل (Security- und 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)، تضمن آليات الرجوع إلى بدائل (Fallback)، مثل أنماط المصادقة القياسية في SecOC [SWS_SecOC_91013] وعمليات التراجع في NvM في IdsM [SWS_IdsM_01702]، استقرار النظام بأكمله؛ وعند إيقاف التشغيل، يمحو KeyM مادة المفاتيح النشطة في RAM تمامًا [SWS_KeyM_00047].

معمارية النظام & دور مجموعة الوحدات

يوفر عنقود الوحدات Security & Intrusion Detection في AUTOSAR Classic Platform (الإصدار R20-11) خدمات قياسية للتشفير، والاتصال الآمن على متن المركبة، وإدارة المفاتيح والشهادات، بالإضافة إلى اكتشاف الهجمات. وظيفيًا، ينقسم العنقود عبر طبقات متعددة من برمجيات AUTOSAR الأساسية (BSW): على مستوى الخدمات، يغلف Crypto Service Manager (CSM) خدمات التشفير المستقلة عن العتاد AUTOSAR_CP_SWS_CryptoServiceManager ص. 21. وتتولى وحدة Secure Onboard Communication (SecOC) الاتصال الآمن لـ I-PDUs في طبقة الاتصالات [SWS_SecOC_00162]، بينما يقوم Key Manager (KeyM) كخدمة أمان بتنسيق دورة حياة المفاتيح التشفيرية والشهادات SWS_KeyManager ص. 31. وبشكل مكمل، يعمل Intrusion Detection System Manager (IdsM) كمجمّع ومصفٍّ مركزي للأحداث ذات الصلة بالأمان في النظام بأكمله AUTOSAR_CP_SWS_IntrusionDetectionSystemManager ص. 21.

أسفل CSM، تجرد واجهة التشفير (CryIf) بوصفها الطبقة CryIf الوصول الخاص بالعتاد أو البرمجيات إلى كائنات متعددة لبرامج تشغيل التشفير، وتوحد آلية إرسال المهام والمفاتيح SWS_CryptoInterface ص. 1. وعلى مستوى MCAL وبرامج التشغيل، ينفذ Crypto Driver (Crypto) الحسابات الفعلية في البرمجيات أو على وحدات أمان العتاد (HSM) [SWS_Crypto_91016]. يضمن التفاعل بين هذه الطبقات فصلاً كاملاً لبرمجيات التطبيق (SW-C) ووحدات الاتصال عن مسرعات التشفير الخاصة بالعتاد.

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

مخطط معماري: البنية الطبقية وعلاقات الواجهات لعنقود الأمان واكتشاف التسلل (Security- und 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]؛ التفسير: يُبلَّغ عن هذا الفشل كحدث أمني إلى 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-Cs للتطبيق عبر واجهات مثل IdsM_SetSecurityEvent [SWS_IdsM_91002] أو IdsM_SetSecurityEventWithCount [SWS_IdsM_91018]. وتُخزَّن الأحداث مؤقتًا، وتؤهل عبر سلاسل تصفية (مثل Block State Filter [SWS_IdsM_01020] أو مرشح التجميع AUTOSAR_CP_SWS_IntrusionDetectionSystemManager ص. 40)، ثم يتم توجيهها أخيرًا عبر PduR [SWS_IdsM_91009]، [SWS_IdsM_91010].

التحقق من PDU مؤمنة في SecOC مع مكدس التشفير وإعداد تقارير 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)رد نداء بنتيجة التحققaltVerifikation erfolgreichPduR Weiterleitung (Authentic PDU)Verifikation fehlgeschlagenIdsM_SetSecurityEvent(SEV_VERIFICATION_FAILURE)التخزين المؤقت في مخزن الأحداث والفلترة

مخطط تسلسلي: التحقق من صحة PDU مؤمنة في SecOC باستخدام مكدس التشفير وإبلاغ الأحداث الأمنية إلى IdsM. المصادر: [SWS_SecOC_00125]، [SWS_SecOC_00012]، [SWS_CryIf_91003]، [SWS_CryIf_91013]، [SWS_IdsM_91002].

المزامنة، وقابلية إعادة الدخول، وسياقات المهام

يتطلب تنفيذ حسابات التشفير وعمليات الأمان فصلاً صارمًا بين مسارات الاستدعاء المتزامنة وسياقات المهام غير المتزامنة. في CSM وCryIf، يعتمد سلوك التنفيذ على تكوين العناصر التشفيرية الأولية: يمكن أن تعمل العمليات بشكل متزامن مانع (blocking) أو غير متزامن [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 مما إذا كانت هناك PDUs موثوقة جديدة بانتظار التوقيع، ويحسب الموثقات (authenticators) ويبدأ الإرسال عبر 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) التنفيذُ في دالة خلفية قابلة للاستباق (preemptive) 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، والتدهور التدريجي للخدمة (Degradation)

تنفذ مجموعة الوحدات آليات شاملة لاكتشاف أخطاء التطوير (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 بالإرسال القابل للتكوين لـ PDUs بديلة غير مصادق عليها إلى الطبقات السفلى، وذلك للحفاظ على جاهزية المركبة [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 الخاصة بالإصدار R20-11 ويلخص بنية عنقود Security & Intrusion Detection.

خريطة المواضيع

عرض التفاصيل

اختر عنصرًا من المخطط.

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 دالة

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 دالة

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

void KeyM_Deinit (void);
KeyM_Finalize دالة

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 دالة

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 دالة

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 دالة

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 دالة

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 نوع

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 دالة

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 دالة

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"