Sensor requirements for secure biometrics
Microsoft leverages Trusted Platform Module (TPM) 2.0 to ensure that on appropriate hardware, software (up to and including kernel-level malware) cannot produce a valid biometric authentication if the user’s biometric was not provided at the time of authentication.
To do this, we use TPM 2.0 session-based authorizations and the sensor performing feature extraction and matching in a trusted execution environment. The first time the Windows Biometric Framework sees a secure sensor (as reported by the secure sensor capability), it provisions a secret that is shared between the secure biometric sensor and the TPM. That secret is never again exposed to the OS, and it is unique to each sensor.
To perform an authentication, the Windows Biometric Framework opens a session with the TPM and obtains a nonce. The nonce is passed into the secure sensor as part of a secure match operation. The sensor performs the match in the trusted execution environment, and if it is successful, calculates an HMAC over that nonce and the identity of the user who was identified.
This HMAC can be used by the Windows Biometric Framework to perform cryptographic operations in the TPM for the user who was identified. The HMAC is short-lived, and expires after a few seconds.
Using this protocol, after the initial provisioning, no sensitive data is contained in the OS. Secrets are held by the TPM and the secure sensor, and the only thing that is exposed during the authentication is the short-lived HMAC.
Secure sensor capability
The WINBIO_CAPABILITY_SECURE_SENSOR capability must be reported by the sensor if it supports the new engine adapter methods in v 4.0 of the engine adapter interface.
To claim that a sensor is a secure sensor it must meet the following requirements:
- The matching engine of the sensor must be isolated from the normal OS (for example, using a trusted execution environment)
- The sensor must support secure input of samples to the isolated matching engine; the content of the samples must never be exposed to the normal OS
- The matching engine must support secure credential release by implementing the new v4 methods outlined below
- The sensor must support presentation attack detection.
The WINBIO_CAPABILITY_SECURE_SENSOR value is contained in the WINBIO_CAPABILITIES structure. Here's an example of how to define it.
#define WINBIO_CAPABILITY_SECURE_SENSOR ((WINBIO_CAPABILITIES)0x00000100)
Error Codes
//
// MessageId: WINBIO_E_INVALID_KEY_IDENTIFIER
//
// MessageText:
//
// The key identifier is invalid.
//
#define WINBIO_E_INVALID_KEY_IDENTIFIER ((HRESULT)0x80098052L)
//
// MessageId: WINBIO_E_KEY_CREATION_FAILED
//
// MessageText:
//
// The key cannot be created.
//
#define WINBIO_E_KEY_CREATION_FAILED ((HRESULT)0x80098053L)
//
// MessageId: WINBIO_E_KEY_IDENTIFIER_BUFFER_TOO_SMALL
//
// MessageText:
//
// The key identifier buffer is too small.
//
#define WINBIO_E_KEY_IDENTIFIER_BUFFER_TOO_SMALL ((HRESULT)0x80098054L)
Engine adapter interface v 4.0
The engine adapter interface version has been incremented to 4.0. The additional functions in the new interface allow the sensor to participate in TPM 2.0. They are:
//
// Additional methods available in V4.0 and later
//
typedef HRESULT
(WINAPI *PIBIO_ENGINE_CREATE_KEY_FN)(
_Inout_ PWINBIO_PIPELINE Pipeline,
_In_reads_(KeySize) const UCHAR* Key,
_In_ SIZE_T KeySize,
_Out_writes_bytes_to_(KeyIdentifierSize, *ResultSize) PUCHAR KeyIdentifier,
_In_ SIZE_T KeyIdentifierSize,
_Out_ PSIZE_T ResultSize
);
typedef HRESULT
(WINAPI *PIBIO_ENGINE_IDENTIFY_FEATURE_SET_SECURE_FN)(
_Inout_ PWINBIO_PIPELINE Pipeline,
_In_reads_(NonceSize) const UCHAR* Nonce,
_In_ SIZE_T NonceSize,
_In_reads_(KeyIdentifierSize) const UCHAR* KeyIdentifier,
_In_ SIZE_T KeyIdentifierSize,
_Out_ PWINBIO_IDENTITY Identity,
_Out_ PWINBIO_BIOMETRIC_SUBTYPE SubFactor,
_Out_ PWINBIO_REJECT_DETAIL RejectDetail,
_Outptr_result_bytebuffer_(*AuthorizationSize) PUCHAR *Authorization,
_Out_ PSIZE_T AuthorizationSize
);
#define WINBIO_ENGINE_INTERFACE_VERSION_4 WINBIO_MAKE_INTERFACE_VERSION(4,0)
typedef struct _WINBIO_ENGINE_INTERFACE {
WINBIO_ADAPTER_INTERFACE_VERSION Version;
WINBIO_ADAPTER_TYPE Type;
SIZE_T Size;
GUID AdapterId;
PIBIO_ENGINE_ATTACH_FN Attach;
PIBIO_ENGINE_DETACH_FN Detach;
PIBIO_ENGINE_CLEAR_CONTEXT_FN ClearContext;
PIBIO_ENGINE_QUERY_PREFERRED_FORMAT_FN QueryPreferredFormat;
PIBIO_ENGINE_QUERY_INDEX_VECTOR_SIZE_FN QueryIndexVectorSize;
PIBIO_ENGINE_QUERY_HASH_ALGORITHMS_FN QueryHashAlgorithms;
PIBIO_ENGINE_SET_HASH_ALGORITHM_FN SetHashAlgorithm;
PIBIO_ENGINE_QUERY_SAMPLE_HINT_FN QuerySampleHint;
PIBIO_ENGINE_ACCEPT_SAMPLE_DATA_FN AcceptSampleData; // PROCESSES CURRENT BUFFER FROM PIPELINE AND GENERATES A FEATURE SET IN THE PIPELINE
PIBIO_ENGINE_EXPORT_ENGINE_DATA_FN ExportEngineData; // EXPORTS FEATURE SET OR TEMPLATE
PIBIO_ENGINE_VERIFY_FEATURE_SET_FN VerifyFeatureSet;
PIBIO_ENGINE_IDENTIFY_FEATURE_SET_FN IdentifyFeatureSet;
PIBIO_ENGINE_CREATE_ENROLLMENT_FN CreateEnrollment; // ATTACHES AN EMPTY ENROLLMENT TEMPLATE TO THE PIPELINE
PIBIO_ENGINE_UPDATE_ENROLLMENT_FN UpdateEnrollment; // CONVERTS CURRENT PIPELINE FEATURE SET INTO SOMETHING THAT CAN BE ADDED TO A TEMPLATE
PIBIO_ENGINE_GET_ENROLLMENT_STATUS_FN GetEnrollmentStatus; // QUERIES TEMPLATE ATTACHED TO THE PIPELINE TO SEE IF IT IS READY TO COMMIT
PIBIO_ENGINE_GET_ENROLLMENT_HASH_FN GetEnrollmentHash;
PIBIO_ENGINE_CHECK_FOR_DUPLICATE_FN CheckForDuplicate; // DETERMINES WHETHER TEMPLATE IS ALREADY ENROLLED
PIBIO_ENGINE_COMMIT_ENROLLMENT_FN CommitEnrollment;
PIBIO_ENGINE_DISCARD_ENROLLMENT_FN DiscardEnrollment;
PIBIO_ENGINE_CONTROL_UNIT_FN ControlUnit;
PIBIO_ENGINE_CONTROL_UNIT_PRIVILEGED_FN ControlUnitPrivileged;
#if (NTDDI_VERSION >= NTDDI_WIN8)
//
// V2.0 methods begin here...
//
PIBIO_ENGINE_NOTIFY_POWER_CHANGE_FN NotifyPowerChange;
PIBIO_ENGINE_RESERVED_1_FN Reserved_1;
#endif
#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
//
// V3.0 methods begin here...
//
PIBIO_ENGINE_PIPELINE_INIT_FN PipelineInit;
PIBIO_ENGINE_PIPELINE_CLEANUP_FN PipelineCleanup;
PIBIO_ENGINE_ACTIVATE_FN Activate;
PIBIO_ENGINE_DEACTIVATE_FN Deactivate;
PIBIO_ENGINE_QUERY_EXTENDED_INFO_FN QueryExtendedInfo;
PIBIO_ENGINE_IDENTIFY_ALL_FN IdentifyAll;
PIBIO_ENGINE_SET_ENROLLMENT_SELECTOR_FN SetEnrollmentSelector;
PIBIO_ENGINE_SET_ENROLLMENT_PARAMETERS_FN SetEnrollmentParameters;
PIBIO_ENGINE_QUERY_EXTENDED_ENROLLMENT_STATUS_FN QueryExtendedEnrollmentStatus;
PIBIO_ENGINE_REFRESH_CACHE_FN RefreshCache;
PIBIO_ENGINE_SELECT_CALIBRATION_FORMAT_FN SelectCalibrationFormat;
PIBIO_ENGINE_QUERY_CALIBRATION_DATA_FN QueryCalibrationData;
PIBIO_ENGINE_SET_ACCOUNT_POLICY_FN SetAccountPolicy;
#endif
#if (NTDDI_VERSION >= NTDDI_WIN10_RS1)
//
// V4.0 methods begin here...
//
PIBIO_ENGINE_CREATE_KEY_FN CreateKey;
PIBIO_ENGINE_IDENTIFY_FEATURE_SET_SECURE_FN IdentifyFeatureSetSecure;
#endif
} WINBIO_ENGINE_INTERFACE, *PWINBIO_ENGINE_INTERFACE;
Requirements
Windows 10