diff options
author | Benjamin Berg <bberg@redhat.com> | 2021-07-30 18:34:38 +0200 |
---|---|---|
committer | Benjamin Berg <bberg@redhat.com> | 2021-07-30 23:52:00 +0200 |
commit | 5f6e80de01c33ff1ad78f117b85ec2125310f924 (patch) | |
tree | c55c0ffe94fe2eccbbb63cfbc60c248e394df44a | |
parent | 3c8ac241b852effb2e342c36a1ca413bb57c059c (diff) |
file_storage: Ensure username/finger match our expectations
Otherwise we would need to track this separately, which would be a bit
of a pain.
The alternative would be simply overriding the values.
-rw-r--r-- | src/file_storage.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/file_storage.c b/src/file_storage.c index db9a971..e12fe58 100644 --- a/src/file_storage.c +++ b/src/file_storage.c @@ -220,6 +220,14 @@ file_storage_print_data_load (FpDevice *dev, if (r) return r; + /* Make sure the username/finger matches our expectations. */ + if (fp_print_get_finger (new) != finger) + return -EINVAL; + + if (g_strcmp0 (fp_print_get_username (new), username) != 0) + return -EINVAL; + + /* And that the print is compatible with the device. */ if (!fp_print_compatible (new, dev)) return -EINVAL; |