اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release بدلاً من aosp-main لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
بالنسبة إلى الأجهزة التي تعمل بالإصدار 13 من نظام التشغيل Android أو الإصدارات الأحدث، يتوافق Android
مع نهج المصادقة "الثقة عند الاستخدام الأول" (TOFU)
(RFC7435)،
الذي يتيح للمستخدمين الوثوق بشبكة مؤسسة (EAP) من خلال تثبيت هيئة إصدار الشهادات الجذر
التي يستخدمها الخادم وضبط اسم نطاقها في شبكة محفوظة. تسمح تقنية TOFU
للجهاز بالحصول على مفتاح عام غير موثَّق عندما يتصل مستخدم لأول مرة
بشبكة مؤسسة والاحتفاظ بالمفتاح للاتصالات اللاحقة.
الخلفية
مقارنةً بالشبكات الشخصية التي تتطلّب إدخال كلمة مرور فقط، تستخدم شبكات المؤسسات
مصادقة البنية الأساسية للمفتاح العام (PKI)، ما يتطلّب من العميل
تثبيت الشهادات مسبقًا. في نظام التشغيل Android 11 أو الإصدارات الأقدم، يمكن للمستخدمين اختيار الخيار
عدم التحقّق من الصحة لشهادة مرجع تصديق الخادم في إعدادات الشبكة،
متجاوزين عملية التحقّق من صحة الشهادة من جهة الخادم. ومع ذلك، لتعزيز
الأمان والامتثال لمواصفات WPA R2، أدخل نظام Android 12
متطلبًا لشبكات المؤسسات يقضي بإجراء عملية التحقّق من شهادة الخادم. وقد شكّل هذا المتطلّب الإضافي عائقًا أمام المستخدمين لأنّهم يحتاجون إلى تثبيت شهادة CA
لهذه الشبكات. توفّر تقنية TOFU طريقة للمستخدمين للاتصال بشبكة تابعة لمؤسسة تستند إلى PKI من خلال قبول مرجع تصديق الجذر الخاص بها.
سلوك الميزة
تعرض الأجهزة المتوافقة مع ميزة TOFU السلوك التالي عندما يتصل مستخدم
بشبكة مؤسسة لا تتضمّن مفتاحًا عامًا تم تثبيته
مسبقًا ومصادق عليه.
الاتصال بشبكة جديدة من خلال أداة اختيار Wi-Fi
اختَر شبكة مؤسسة جديدة في أداة اختيار Wi-Fi.
يعرض الجهاز مربّع حوار (الشكل 1) لتأكيد ما إذا كانت
الشبكة موثوقة.
انقر على نعم، اتّصل لقبول الاتصال بالشبكة، أو انقر على لا، لا
اتّصل لرفض الاتصال.
إذا نقرت على نعم، الاتصال، سيضبط الجهاز تلقائيًا
مَعلمات الأمان ويتصل بالشبكة ويفعِّل ميزة "الاتصال تلقائيًا"
للشبكة.
في حال النقر على لا، لا أريد الاتصال، سيتم قطع اتصال الجهاز بالشبكة ويُوقف الاتصال التلقائي بالشبكة.
الشكل 1: مربّع حوار لميزة TOFU
الاتصال بالشبكة الحالية مع تفعيل ميزة "الاتصال التلقائي"
عند الاتصال بشبكة مؤسسة تم تفعيل ميزة "الاتصال التلقائي" فيها ولكن
لا تتضمّن شهادة هيئة إصدار مصدق صالحة، يتصل الجهاز تلقائيًا ثم
يعرض إشعارًا ثابتًا (لا يمكن إغلاقه).
انقر على الإشعار.
يعرض الجهاز مربّع حوار (الشكل 1) لتأكيد ما إذا كانت
الشبكة موثوقة.
انقر على نعم، اتّصل لقبول الاتصال بالشبكة، أو انقر على لا، لا
اتّصل لرفض الاتصال.
إذا نقرت على نعم، الاتصال، سيضبط الجهاز تلقائيًا
مَعلمات الأمان ويتصل بالشبكة ويفعِّل ميزة "الاتصال تلقائيًا"
للشبكة.
في حال النقر على لا، لا أريد الاتصال، سيتم قطع اتصال الجهاز بالشبكة ويُوقف الاتصال التلقائي بالشبكة.
للتحقّق من صحة تنفيذ TOFU على جهازك، استخدِم الاختبارات التالية:
CTS: CtsWifiTestCases
VTS: VtsHalWifiSupplicantStaNetworkTargetTest
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Trust on First Use (TOFU)\n\nFor devices running Android 13 or higher, Android\nsupports the Trust on First Use (TOFU) authentication approach\n([RFC7435](https://datatracker.ietf.org/doc/html/rfc7435.html)),\nwhich lets users trust an enterprise (EAP) network by installing the root CA\nused by the server and setting its domain name in a saved network. TOFU allows\nthe device to obtain an unauthenticated public key when a user first connects\nto an enterprise network and retain the key for subsequent connections.\n\nBackground\n----------\n\nCompared to personal networks that just require a password, enterprise networks\nuse public key infrastructure (PKI) authentication, which requires the client\nto preinstall certificates. In Android 11 or lower, users can select the\n*Do not validate* option for the server CA certificate in the network settings,\nbypassing the validation of the server side certificate. However, to strengthen\nsecurity and comply with the WPA R2 specification, Android 12 introduced a\nrequirement for enterprise networks to have server certificate validation. This\nadditional requirement created a barrier for users as they need to install a CA\ncertificate for such networks. TOFU provides a way for users to connect to a\nPKI-based enterprise network by simply accepting its root CA.\n\nFeature behavior\n----------------\n\nDevices that support TOFU display the following behavior when a user connects\nto an enterprise network that doesn't have an *already-installed*\nauthenticated public key.\n\n### Connect to new network through Wi-Fi picker\n\n1. Select a new enterprise network in Wi-Fi picker.\n\n The device displays a dialog (Figure 1) to confirm whether the\n network is trusted.\n2. Tap **Yes, connect** to accept the network connection, or tap **No, don't\n connect** to decline.\n\n - If you tap **Yes, connect**, the device automatically configures the\n security parameters, connects to the network, and enables autoconnect\n for the network.\n\n | **Note:** Misconfigured networks that use invalid or expired certificates might not allow any security validation by the device. In such cases, the device fails to connect to the network.\n - If you tap **No, don't connect**, the device disconnects from the\n network and disables autoconnect for the network.\n\n **Figure 1.** Dialog for the TOFU feature\n\n### Connect to existing network with autoconnect enabled\n\nWhen connecting to an enterprise network that has autoconnect enabled but\ndoesn't have a valid CA certificate, the device connects automatically, then\ndisplays a sticky (nondismissable) notification.\n\n1. Tap the notification.\n\n The device displays a dialog (Figure 1) to confirm whether the\n network is trusted.\n2. Tap **Yes, connect** to accept the network connection, or tap **No, don't\n connect** to decline.\n\n - If you tap **Yes, connect**, the device automatically configures the\n security parameters, connects to the network, and enables autoconnect\n for the network.\n\n | **Note:** Misconfigured networks that use invalid or expired certificates might not allow any security validation by the device. In such cases, the device fails to connect to the network.\n - If you tap **No, don't connect**, the device disconnects from the\n network and disables autoconnect for the network.\n\nImplementation\n--------------\n\nTo support the TOFU feature, implement the supplicant HALs provided in the\nAndroid Open Source Project (AOSP) at\n[`/hardware/interfaces/wifi/supplicant/aidl/android/hardware/wifi/supplicant`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/wifi/supplicant/aidl/android/hardware/wifi/supplicant).\n\nThe following public APIs are available in Android 13\nfor use by apps:\n\n- [`WifiManager#isTrustOnFirstUseSupported()`](https://developer.android.com/reference/android/net/wifi/WifiManager#isTrustOnFirstUseSupported()): Indicates whether the device supports TOFU.\n- [`WifiEnterpriseConfig#enableTrustOnFirstUse(boolean)`](https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#enableTrustOnFirstUse(boolean)): Enables TOFU.\n- [`WifiEnterpriseConfig#isTrustOnFirstUseEnabled()`](https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#isTrustOnFirstUseEnabled()): Indicates whether TOFU is enabled.\n\nValidation\n----------\n\nTo validate the implementation of TOFU on your device, use the following tests:\n\n- CTS: `CtsWifiTestCases`\n- VTS: `VtsHalWifiSupplicantStaNetworkTargetTest`"]]