summaryrefslogtreecommitdiff
path: root/common/mock/fpsensor_state_mock.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/mock/fpsensor_state_mock.c')
-rw-r--r--common/mock/fpsensor_state_mock.c53
1 files changed, 32 insertions, 21 deletions
diff --git a/common/mock/fpsensor_state_mock.c b/common/mock/fpsensor_state_mock.c
index 1c931bc24d..cbeb29ae3c 100644
--- a/common/mock/fpsensor_state_mock.c
+++ b/common/mock/fpsensor_state_mock.c
@@ -7,6 +7,7 @@
#include <string.h>
#include "common.h"
+#include "driver/fingerprint/fpsensor.h"
#include "ec_commands.h"
#include "test_util.h"
@@ -21,27 +22,37 @@ const uint8_t default_fake_tpm_seed[] = {
};
BUILD_ASSERT(sizeof(default_fake_tpm_seed) == FP_CONTEXT_TPM_BYTES);
-const uint8_t default_fake_fp_positive_match_salt[] = {
- 0x04, 0x1f, 0x5a, 0xac, 0x5f, 0x79, 0x10, 0xaf, 0x04, 0x1d, 0x46, 0x3a,
- 0x5f, 0x08, 0xee, 0xcb, 0x04, 0x1f, 0x5a, 0xac, 0x5f, 0x79, 0x10, 0xaf,
- 0x04, 0x1d, 0x46, 0x3a, 0x5f, 0x08, 0xee, 0xcb, 0x04, 0x1f, 0x5a, 0xac,
- 0x5f, 0x79, 0x10, 0xaf, 0x04, 0x1d, 0x46, 0x3a, 0x5f, 0x08, 0xee, 0xcb,
- 0x04, 0x1f, 0x5a, 0xac, 0x5f, 0x79, 0x10, 0xaf, 0x04, 0x1d, 0x46, 0x3a,
- 0x5f, 0x08, 0xee, 0xcb, 0x04, 0x1f, 0x5a, 0xac, 0x5f, 0x79, 0x10, 0xaf,
- 0x04, 0x1d, 0x46, 0x3a, 0x5f, 0x08, 0xee, 0xcb
-};
-BUILD_ASSERT(sizeof(default_fake_fp_positive_match_salt) == 80);
-
-const uint8_t trivial_fp_positive_match_salt[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-BUILD_ASSERT(sizeof(trivial_fp_positive_match_salt) == 80);
+const uint8_t default_fake_fp_positive_match_salt
+ [FP_MAX_FINGER_COUNT][FP_POSITIVE_MATCH_SALT_BYTES] = {
+ { 0x04, 0x1f, 0x5a, 0xac, 0x5f, 0x79, 0x10, 0xaf, 0x04, 0x1d,
+ 0x46, 0x3a, 0x5f, 0x08, 0xee, 0xcb },
+ { 0x04, 0x1f, 0x5a, 0xac, 0x5f, 0x79, 0x10, 0xaf, 0x04, 0x1d,
+ 0x46, 0x3a, 0x5f, 0x08, 0xee, 0xcb },
+ { 0x04, 0x1f, 0x5a, 0xac, 0x5f, 0x79, 0x10, 0xaf, 0x04, 0x1d,
+ 0x46, 0x3a, 0x5f, 0x08, 0xee, 0xcb },
+ { 0x04, 0x1f, 0x5a, 0xac, 0x5f, 0x79, 0x10, 0xaf, 0x04, 0x1d,
+ 0x46, 0x3a, 0x5f, 0x08, 0xee, 0xcb },
+ { 0x04, 0x1f, 0x5a, 0xac, 0x5f, 0x79, 0x10, 0xaf, 0x04, 0x1d,
+ 0x46, 0x3a, 0x5f, 0x08, 0xee, 0xcb }
+ };
+BUILD_ASSERT(sizeof(default_fake_fp_positive_match_salt) ==
+ FP_MAX_FINGER_COUNT * FP_POSITIVE_MATCH_SALT_BYTES);
+
+const uint8_t trivial_fp_positive_match_salt
+ [FP_MAX_FINGER_COUNT][FP_POSITIVE_MATCH_SALT_BYTES] = {
+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
+ };
+BUILD_ASSERT(sizeof(trivial_fp_positive_match_salt) ==
+ FP_MAX_FINGER_COUNT * FP_POSITIVE_MATCH_SALT_BYTES);
int fpsensor_state_mock_set_tpm_seed(
const uint8_t tpm_seed[FP_CONTEXT_TPM_BYTES])