mindtct/morph.c: In function ‘get_south8_2’:
mindtct/morph.c:173:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if (row >= ih-1) /* catch case where image is undefined southwards */
^~
mindtct/morph.c:176:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
return *(ptr+iw);
^~~~~~
mindtct/morph.c: In function ‘get_north8_2’:
mindtct/morph.c:197:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if (row < 1) /* catch case where image is undefined northwards */
^~
mindtct/morph.c:200:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
return *(ptr-iw);
^~~~~~
mindtct/morph.c: In function ‘get_east8_2’:
mindtct/morph.c:221:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if (col >= iw-1) /* catch case where image is undefined eastwards */
^~
mindtct/morph.c:224:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
return *(ptr+ 1);
^~~~~~
mindtct/morph.c: In function ‘get_west8_2’:
mindtct/morph.c:243:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if (col < 1) /* catch case where image is undefined westwards */
^~
mindtct/morph.c:246:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
return *(ptr- 1);
^~~~~~
mindtct/block.c: In function ‘block_offsets’:
mindtct/block.c:108:18: warning: variable ‘ph’ set but not used [-Wunused-but-set-variable]
int pad2, pw, ph;
^~
NBIS is pretty complicated to update, seeing as we've made quite a few
changes to get it to compile as a library. With those scripts, we can
easily trim headers to remove functions we don't use, rename global
variables, and do any sort of fixups that are necessary right now.
In the future, removing unused NBIS functions might be as easy as
updating that script, re-running it, and pushing the changes.
Note that remove-function.lua is a very crude parser that only supports
NBIS' style of declaration, with the return type on the same line as the
function name. I wouldn't recommend trying to use it in another project.
Callcatcher (https://github.com/caolanm/callcatcher) was also used to
remove additional unused functions.
There has been a report that a 0x0c03 was installed straight (other
readers so far have produced images that are 90 degrees rotated). There
is no way for the dirver to know how a device is installed, so for now just
make an exception.
Sensor reset code has been removed because it is not needed during normal
operation.
Calibration and frame processing logic has been improved according to
recommendations from Elantech.
Make each command a separate struct to get finer control over which
commands are called on which devices. Update ssm's accordingly. Add
sensor_reset and fuse_load commands.
Support 0x0903, 0x0c03, 0x0c16, 0x0c1a, 0x0c26
Similarly to b1ac865abd, downgrade
fp_err() to be non-fatal. A number of drivers would spit out an error
when encountering this call, but not crash, carry on and most of the
time recover.
Make sure we don't assert in those cases.
BUG() and BUG_ON() didn't use to assert, but only print an error if
debugging was enabled. This was hiding a lot of state bugs in drivers,
and transforming those into assertions causes crashes.
Downgrade the assertion to only print a warning, and hope that those
eventually get fixed in the drivers so we can re-enable them.
Closes: #77
The driver will at least need to close its hardware resources, and
free memory, so it must have had one.
This case was never actually used as can be seen from the fact that
we would assert in fpi_drvcb_close_complete() if the state was wrong
but never set it to the expected value.
Which avoids passing zero lines to fpi_assemble_lines()
"gmem.c:130: failed to allocate 18446744073709551612 bytes"
#3 0x00007fe4f6ef428f in g_log (log_domain=log_domain@entry=0x7fe4f6f3506e "GLib", log_level=log_level@entry=G_LOG_LEVEL_ERROR, format=format@entry=0x7fe4f6f3e610 "%s: failed to allocate %lu bytes") at gmessages.c:1398
#4 0x00007fe4f6ef2ac4 in g_malloc0 (n_bytes=n_bytes@entry=18446744073709551612) at gmem.c:129
#5 0x00007fe4f8052020 in median_filter (filtersize=25, size=-1, data=0x0) at assembling.c:309
#6 fpi_assemble_lines (ctx=ctx@entry=0x7fe4f82ac3c0 <assembling_ctx>, lines=0x0, lines_len=0) at assembling.c:389
#7 0x00007fe4f805f3db in submit_image (ssm=ssm@entry=0x16c3cba360, data=data@entry=0x16c3cb9cc0) at drivers/vfs5011.c:412
See https://bugzilla.redhat.com/show_bug.cgi?id=1484812Closes: #42
Every frame stores the delta from the previous frame, in reverse mode
it stores the delta to the next frame. This causes images to use the
wrong delta while assembling in forward mode.
The broken assembling in forward mode will create a small error for
linear motion, because the delta of all frames is approximately the
same in this case. But if you move your finger, stop and then continue
moving in a single scan, the misplaced frames should be visible in
the assembled output.
This could result in false positives and verification failing.
https://bugs.freedesktop.org/show_bug.cgi?id=105027
aeslib.h and assembling.h don't need access to internal data structures,
so make them include the public fprint.h rather than the internal header
fp_internal.h.
This time, the macro didn't wrap the condition, resulting in calls
like BUG_ON(size > 100) being expanded to g_assert(!size > 100), when
what we wanted was BUG_ON(!(size > 100)).
See 9cca501650,
ff09456cf5, and egg on my face.
Remove deprecation warning that comes from an internal function, it
serves no purpose, and the function itself is deprecated.
Follow-up from commit 1f0079a274.
libfprint/drivers/upekts.c: In function ‘alloc_send_cmd_transfer’:
libfprint/drivers/upekts.c:161:2: warning: ‘strncpy’ output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
strncpy(buf, "Ciao", 4);
^~~~~~~~~~~~~~~~~~~~~~~
Replace with memcpy() to only copy the 4 bytes we need.
https://bugs.freedesktop.org/show_bug.cgi?id=106281
Remove all the headers already included through "fp_internal.h" such as
<libusb.h> and <errno.h>, include "assembling.h" and "driver_ids.h" there
as well to avoid doing it in (almost) every driver.
As this is pretty much copy/pasted in fprintd, and should instead be
implemented by whatever system actually stores the data, rather than
in a generic but not quite "fits-all-purpose" way.
https://bugs.freedesktop.org/show_bug.cgi?id=106550
Instead of having to modify both fp_internal.h to list each driver
definition structure, and core.c to add those drivers to arrays we
can loop over, generate both of those using meson.
We shouldn't need to specifically enable debug logging to get useful
data out of a compiled libfprint either, so always enable debugging
output. It will still be switched off at runtime, by default.
There are no parts of libfprint that are so resource intensive that we'd
want to disable logging. This avoids (hopefully rare) cases where
compiled versions of libfprint are distributed with logging completely
disabled, and thus can't be debugged.
nbis/mindtct/morph.c:152:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
nbis/mindtct/morph.c:176:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
nbis/mindtct/morph.c:200:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
nbis/mindtct/morph.c:222:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
https://bugs.freedesktop.org/show_bug.cgi?id=105429
libusb_free_device_list() needs to be called on the list of USB devices
obtained through libusb_get_device_list() or the list and its elements
will be leaked.
https://bugs.freedesktop.org/show_bug.cgi?id=105427
Add naive detection of image encryption: if stddev between two
adjacent rows is higher than threshold assume that image is encrypted
and decrypt it.
Fixes fd.o bug 88945
Use fpi_mean_sq_diff_norm() for blank line detection and
fpi_mean_sq_diff_norm() for duplicate line detection.
Fixes finger presence and removal detection.
The code was indented, but only the first call was actually in the
conditional, which meant that initialisation carried on as normal on top
of a failed USB device. Exit early and remove the conditional to fix
this.
https://bugzilla.gnome.org/show_bug.cgi?id=98594
The code was indented, but only the first call was actually in the
conditional, which meant that initialisation carried on as normal on top
of a failed USB device. Exit early and remove the conditional to fix
this.
The device is already supported by the vfs5011 driver and non-
blacklisted, so will show up in the udev rules, but for ease of
backporting to older versions, add it to the whitelist anyway.
https://bugzilla.redhat.com/show_bug.cgi?id=1173367
It seems that on faster devices, the driver can get more duplicate lines.
Without this change scan looks too stretched.
Suggested by: Thomas Rinsma <thomasrinsma@gmail.com>
Smart sensors like Upek TouchChip Coprocessor can provide scan status instead
of image, as result we need to report such status as "short scan" or "finger not centered"
from within the driver, since it's not a session error.
Sensor width seems to be only 128 pixels and that's not enough
for scanning whole finger surface. Lower bz3_threshold to 25,
since for wrong finger score never goes above 10, but sometimes
for right finger score is below 40.
Sensor width seems to be only 128 pixels and that's not enough
for scanning whole finger surface. Lower bz3_threshold to 20,
since for wrong fingerprint score never goes above 10, but sometimes
for right finger score is below 40.
New driver for VFS5011 138a:0011 and 138a:0018
https://bugs.freedesktop.org/show_bug.cgi?id=61692
[vasilykh]:
- use g_get_real_time() instead of non-portable time()
- use g_free() instead of free()
- comment out "RECV(VFS5011_IN_ENDPOINT_CTRL2, 8)"
Some scanners provide hardware assistance in frame assemling, i.e.
horizontal and vertical offset to previous frame is provided. This
commit improves code to utilise that assistance. Sensors without
hardware assistance will use software algorithm, which was also
improved to do search in horizontal direction.
pixman is very lightweight library for pixel manipulation, and it
has no dependencies except glibc, so using it instead of gdkpixbuf/imagemagick
makes list for libfprint dependencies a bit shorter.
Imaging drivers aren't allowed to change number of enroll stages anymore,
all that imaging driver does is providing image to the upper layer.
Upper layer decides if it needs more scans.
Imaging drivers aren't allowed to change number of enroll stages anymore,
all that imaging driver does is providing image to the upper layer.
Upper layer decides if it needs more scans.
Since 5 scans for enroll was introduced it's not necessary to lower
bz3_threshold anymore, there's a good probability that scan to verify matches
with at least one enrolled sample.
fp_dev_img_capture() is not implemented and returns -ENOTSUPP for all devices
since migration to asynchronous model. This commit implement missing functionality
AES3500 and AES4000 are pretty similar devices, have same
command send, the only difference is in image size and init sequence.
Extract common routines from AES4K to be used later in AES3500 driver
https://bugs.freedesktop.org/show_bug.cgi?id=64351
The blacklisted devices weren't correctly checked for past the first
item, as we weren't using the right index to get the product ID
from the ID table.
Re-check device state after fpi_drvcb_enroll_stage_completed().
If enrollment was cancelled after non-completing stage, we must
not restart acquire as it would confuse the internal state machine.
https://bugs.freedesktop.org/show_bug.cgi?id=57829
Call error callback before resetting img_transfer to NULL. This
variable is internally used to detect if we are still in imaging
loop and the call to execute_state_change() needs to be postponed.
Since this is the final thing imaging_complete() we can't reset
img_transfer until just before this call.
https://bugs.freedesktop.org/show_bug.cgi?id=57829
It can come before we finish reading the status register on some
cases. Arm the irq handler early, and fix the state machine to
handle early irq properly.
https://bugs.freedesktop.org/show_bug.cgi?id=57834
ID is just a some magic number to make fingerprint from one scanner model
incompatible with another scanner model. Get rid of "magic", declare enum
and use it.
https://bugs.freedesktop.org/show_bug.cgi?id=56956
Wait for 3 empty frames before stopping the scan
The driver used to stop the scan immediately after an empty frame
(by checking for hist sum == 0), but it is possible to get empty
frames in the middle of the scan due to low finger pressure.
Waiting for 3 empty frames stop the driver wrongly aborting the scan
too early.
https://bugs.freedesktop.org/show_bug.cgi?id=56715
We can only create the udev rules file when we're not cross-compiling,
so allow people to disable updating the file when building from
tarballs.
If you run with --enable-udev-rules=no and the
60-fprint-autosuspend.rules doesn't exist, you're on your own.
Instead of hardcoding whatever the new fashion is every few months, which might
even differ between distributions, just put the rules where udev says we should.
https://bugs.freedesktop.org/show_bug.cgi?id=50426
The function fpi_im_resize copy the new resized image into old fp_img
instead of newimg so, new image is empty and often it generated a
segmentation fault error.
On function fp_get_next_timeout if exist fprint timeout or libusb
timeout the function return the smaller of they.
But if one of that not exist and have a smaller value the function
return a timeout that not exist.
The libfprint library is generally built with C calling conventions.
Which makes it difficult to link to C++ programs as it is.
This patch adds the support for linking with C++ code - by telling the C++
compiler to use C calling conventions for libfprint functions.
Reported-by: Guus Ellenkamp <guus@activediscovery.net>
Signed-off-by: Kunal Gangakhedkar <kunal.gangakhedkar@gmail.com>
Don't consider the scan complete unless theres at least
MIN_ROWS recorded or very long blank read occurred.
Typical problem spot: one brief touch before starting the
actual scan. Happens most commonly if scan is started from
before the first joint resulting in a gap after the inital touch.
http://lists.reactivated.net/pipermail/fprint/2009-December/001406.html
Check all the drivers for one that'll drive our device in
question, and prefer ones that have a discover() method that runs
successfully to a driver without such a method.
This allow drivers to both reject devices (if 2 drivers handle
the same USB IDs), or a single driver to handle variants of the
same device (through the devtype out value of the discover method).
Most fingerprint readers can be suspended safely, so use
the udev rules to autosuspend them when they appear.
The script itself contains whitelists and blacklists.
When imaging support is required, we prefer to use gdk-pixbuf,
as it's already on things like Live CDs.
Also fix the examples building against the system libfprint.