קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
במכשירים עם חיישן טביעת אצבע, המשתמשים יכולים לרשום טביעת אצבע אחת או יותר ולהשתמש בהן כדי לפתוח את נעילת המכשיר וכדי לעשות דברים אחרים. מערכת Android משתמשת בשפת הגדרה לבניית ממשק חומרה לטביעות אצבעות (HIDL) כדי להתחבר לספרייה ספציפית לספק ולחומרה של טביעות אצבעות (לדוגמה, חיישן טביעות אצבע).
חיישן טביעות האצבע של מכשיר בדרך כלל לא פעיל. עם זאת, בתגובה לבקשה להפעלה אל authenticate או אל enroll, חיישן טביעת האצבע מחכה לנגיעה (יכול להיות שהמסך יופעל גם כשמשתמש נוגע בחיישן טביעת האצבע). התהליך הכללי של התאמת טביעות אצבע כולל את השלבים הבאים:
המשתמש מניח אצבע על חיישן טביעת האצבע.
הספרייה הספציפית לספק קובעת אם יש התאמה לטביעת אצבע במערך הנוכחי של תבניות טביעות אצבע רשומות.
התוצאות התואמות מועברות אל FingerprintService.
בתהליך הזה מניחים שטביעת אצבע כבר נרשמה במכשיר, כלומר, בספרייה הספציפית לספק נרשמה תבנית של טביעת האצבע. למידע נוסף, ראו אימות.
ארכיטקטורה
ה-HAL של טביעת האצבע יוצר אינטראקציה עם הרכיבים הבאים.
BiometricManager מקיים אינטראקציה ישירה עם אפליקציה בתהליך של אפליקציה.
לכל אפליקציה יש מופע של IBiometricsFingerprint.hal
FingerprintService פועל בתהליך המערכת, שמטפל בתקשורת עם HAL של טביעות אצבע.
Fingerprint HAL הוא הטמעה של C/C++ של ממשק IBiometricsFingerprint HIDL. הספרייה הספציפית לספק
שמבצעת תקשורת עם החומרה הספציפית למכשיר.
רכיבי Keystore API ו-KeyMint (לשעבר Keymaster) מספקים הצפנה שמגובה בחומרה לאחסון מאובטח של מפתחות בסביבה מאובטחת, כמו סביבת מחשוב אמינה (TEE).
איור 1. תרשים זרימת נתונים ברמה גבוהה לאימות באמצעות טביעת אצבע
הטמעה של HAL ספציפי לספק צריכה להשתמש בפרוטוקול התקשורת שנדרש על ידי TEE. אסור להעביר תמונות גולמיות ותכונות מעובדות של טביעות אצבעות בזיכרון לא מהימן. כל הנתונים הביומטריים האלה צריכים להיות מאוחסנים בחומרה מאובטחת, כמו TEE. תהליך הרוט (Root) לא יכול לפגוע בנתונים ביומטריים.
FingerprintService ו-fingerprintd מבצעות שיחות דרך Fingerprint HAL לספרייה הספציפית לספק כדי לרשום טביעות אצבע ולבצע פעולות אחרות.
איור 2. אינטראקציה של דימון (daemon) של טביעות אצבע
עם ספריית טביעות האצבע הספציפית לספק
הנחיות להטמעה
ההנחיות הבאות לגבי Fingerprint HAL נועדו להבטיח שנתוני טביעות האצבע לא ידלפו ויוסרו כשהמשתמש מוסר מהמכשיר:
אסור לאפשר גישה לנתוני טביעות אצבעות גולמיים או לנגזרות שלהם (לדוגמה, תבניות) מחוץ לדרייבר של החיישן או ל-TEE. אם החומרה תומכת ב-TEE, גישת החומרה אל TEE צריכה להיות מוגבלת ומוגנת על ידי מדיניות SELinux. הגישה לערוץ Serial Peripheral Interface (SPI) צריכה להיות מוגבלת ל-TEE, וצריכה להיות מדיניות SELinux מפורשת בכל קובצי המכשיר.
תהליך ההקלטה, ההרשמה והזיהוי של טביעות האצבעות צריך להתרחש בתוך ה-TEE.
אפשר לאחסן במערכת הקבצים רק את ההצפנה של נתוני טביעות האצבעות, אפילו אם מערכת הקבצים עצמה מוצפנת.
צריך לחתום על תבניות טביעות אצבעות באמצעות מפתח פרטי שייחודי למכשיר.
במקרה של Advanced Encryption Standard (AES), צריך לחתום על תבנית לפחות באמצעות הנתיב המוחלט של מערכת הקבצים, הקבוצה ומזהה טביעת האצבע, כך שקבצים של תבניות לא יוכלו לפעול במכשיר אחר או בשביל מישהו אחר מלבד המשתמש שרשם אותם באותו מכשיר. לדוגמה, אסור שאפשר יהיה להעתיק נתוני טביעות אצבעות ממשתמש אחר באותו מכשיר, או ממכשיר אחר.
ההטמעות צריכות להשתמש בנתיב של מערכת הקבצים שסופק על ידי הפונקציה setActiveGroup() או לספק דרך למחיקה של כל נתוני התבניות של המשתמש כשהמשתמש מוסר. מומלץ מאוד לאחסן את קובצי התבניות של טביעות האצבע כמוצפנים, ולשמור אותם בנתיב שצוין. אם זה לא אפשרי בגלל דרישות האחסון של TEE, המטמיע חייב להוסיף הוקים (hooks) כדי להבטיח שהנתונים יוסרו כשהמשתמש יוסר.
הפעלת מכונת מצבים של HAL כדי להתחיל את האיסוף והאחסון של תבנית טביעת אצבע. כשההרשמה מסתיימת, או אחרי פסק זמן, מכונת המצבים של HAL חוזרת למצב סרק.
preEnroll()
יוצרת טוקן ייחודי שמציין את ההתחלה של
רישום טביעת אצבע. מספקת אסימון לפונקציה enroll כדי לוודא שהיה אימות קודם, למשל באמצעות סיסמה. כדי למנוע שיבוש, הטוקן מוצפן אחרי שפרטי הכניסה של המכשיר מאושרים. צריך לבדוק את הטוקן במהלך ההרשמה כדי לוודא שהוא עדיין בתוקף.
getAuthenticatorId()
מחזירה טוקן שמשויך לקבוצת טביעות האצבע הנוכחית.
cancel()
מבטלת פעולות ממתינות של הרשמה או אימות. מכונת המצבים של HAL חוזרת למצב סרק.
enumerate()
קריאה סינכרונית לספירת כל תבניות טביעות האצבע הידועות.
remove()
מוחקת תבנית טביעת אצבע.
setActiveGroup()
מגבילה פעולת HAL לקבוצה של טביעות אצבע ששייכות לקבוצה מסוימת, שמזוהה על ידי מזהה קבוצה (GID).
authenticate()
מאמתת פעולה שקשורה לטביעת אצבע
(מזוהה באמצעות מזהה פעולה).
setNotify()
רושמת פונקציית משתמש שמקבלת
התראות מ-HAL. אם מכונת המצבים של HAL במצב עמוס, הפונקציה חסומה עד שממשק HAL יוצא מהמצב העמוס.
postEnroll()
הפעולה הזו מסיימת את פעולת ההרשמה ומבטלת את התוקף של האתגר preEnroll() שנוצר. צריך להפעיל את הפונקציה הזו בסוף סשן של רישום טביעות אצבעות של כמה אצבעות, כדי לציין שאי אפשר להוסיף עוד אצבעות.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-25 (שעון UTC).
[[["התוכן קל להבנה","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-08-25 (שעון UTC)."],[],[],null,["# Fingerprint HIDL\n\nOn devices with a fingerprint sensor, users can enroll one or more\nfingerprints and use those fingerprints to unlock the device and perform other\ntasks. Android uses the Fingerprint Hardware Interface Definition Language\n(HIDL) to connect to a vendor-specific library and fingerprint hardware (for\nexample, a fingerprint sensor).\n\nTo implement the Fingerprint HIDL, you must implement [`IBiometricsFingerprint.hal`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal)\nin a vendor-specific library.\n\nFingerprint matching\n--------------------\n\nThe fingerprint sensor of a device is generally idle. However, in response to\na call to `authenticate` or `enroll`, the\nfingerprint sensor listens for a touch (the screen might also wake when a user\ntouches the fingerprint sensor). The high-level flow of fingerprint matching\nincludes the following steps:\n\n1. User places a finger on the fingerprint sensor.\n2. The vendor-specific library determines if there is a fingerprint match in the current set of enrolled fingerprint templates.\n3. Matching results are passed to `FingerprintService`.\n\nThis flow assumes that a fingerprint has already been enrolled on the device, that is,\nthe vendor-specific library has enrolled a template for the fingerprint. For more\ndetails, see [Authentication](/docs/security/features/authentication).\n| **Note:** The more fingerprint templates stored on a device, the more time required for fingerprint matching.\n\nArchitecture\n------------\n\nThe Fingerprint HAL interacts with the following components.\n\n- `BiometricManager` interacts directly with an app in an app process. Each app has an instance of `IBiometricsFingerprint.hal`\n- `FingerprintService` operates in the system process, which handles communication with fingerprint HAL.\n- **Fingerprint HAL** is a C/C++ implementation of the IBiometricsFingerprint HIDL interface. This contains the vendor-specific library that communicates with the device-specific hardware.\n- **Keystore API and KeyMint (previously Keymaster)** components provide hardware-backed cryptography for secure key storage in a secure environment, such as the Trusted Execution Environment (TEE).\n\n**Figure 1.** High-level data flow for fingerprint authentication\n\nA vendor-specific HAL implementation must use the communication protocol\nrequired by a TEE. Raw images and processed fingerprint features must not\nbe passed in untrusted memory. All such biometric data needs to be stored\nin the secure hardware such as the TEE. Rooting **must not**\nbe able to compromise biometric data.\n\n`FingerprintService` and `fingerprintd` make calls through the Fingerprint HAL to\nthe vendor-specific library to enroll fingerprints and perform other\noperations.\n**Figure 2.** Interaction of the fingerprint daemon with the fingerprint vendor-specific library\n\nImplementation guidelines\n-------------------------\n\nThe following Fingerprint HAL guidelines are designed to ensure that\nfingerprint data is **not leaked** and is **removed**\nwhen a user is removed from a device:\n\n- Raw fingerprint data or derivatives (for example, templates) must never be accessible from outside the sensor driver or TEE. If the hardware supports a TEE, hardware access must be limited to the TEE and protected by an SELinux policy. The Serial Peripheral Interface (SPI) channel must be accessible only to the TEE and there must be an explicit SELinux policy on all device files.\n- Fingerprint acquisition, enrollment, and recognition must occur inside the TEE.\n- Only the encrypted form of the fingerprint data can be stored on the file system, even if the file system itself is encrypted.\n- Fingerprint templates must be signed with a private, device-specific key. For Advanced Encryption Standard (AES), at a minimum a template must be signed with the absolute file-system path, group, and finger ID such that template files are inoperable on another device or for anyone other than the user that enrolled them on the same device. For example, copying fingerprint data from a different user on the same device or from another device must not work.\n- Implementations must either use the file-system path provided by the `setActiveGroup()` function or provide a way to erase all user template data when the user is removed. It's strongly recommended that fingerprint template files be stored as encrypted and stored in the path provided. If this is infeasible due to TEE storage requirements, the implementer must add hooks to ensure removal of the data when the user is removed.\n\nFingerprint methods\n-------------------\n\nThe Fingerprint HIDL interface contains the following major methods in\n[`IBiometricsFingerprint.hal`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal).\n\n| Method | Description |\n|------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `enroll()` | Switches the HAL state machine to start the collection and storage of a fingerprint template. When enrollment is complete, or after a timeout, the HAL state machine returns to the idle state. |\n| `preEnroll()` | Generates a unique token to indicate the start of a fingerprint enrollment. Provides a token to the `enroll` function to ensure there was prior authentication, for example, using a password. To prevent tampering, the token is wrapped after the device credential is confirmed. The token must be checked during enrollment to verify that it's still valid. |\n| `getAuthenticatorId()` | Returns a token associated with the current fingerprint set. |\n| `cancel()` | Cancels pending enroll or authenticate operations. The HAL state machine is returned to the idle state. |\n| `enumerate()` | Synchronous call for enumerating all known fingerprint templates. |\n| `remove()` | Deletes a fingerprint template. |\n| `setActiveGroup()` | Restricts a HAL operation to a set of fingerprints that belong to a specified group, identified by a group identifier (GID). |\n| `authenticate()` | Authenticates a fingerprint-related operation (identified by an operation ID). |\n| `setNotify()` | Registers a user function that receives notifications from the HAL. If the HAL state machine is in a busy state, the function is blocked until the HAL leaves the busy state. |\n| `postEnroll()` | Finishes the enroll operation and invalidates the `preEnroll()` generated challenge. This must be called at the end of a multifinger enrollment session to indicate that no more fingers may be added. |\n\nFor more details on these, refer to the comments in [`IBiometricsFingerprint.hal`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal)."]]