Age | Commit message (Collapse) | Author | Files | Lines |
|
The new automake paralell test driver (enabled by default in 1.13),
creates log files to track test results and output, ignore them.
Ignore also the new generated systemd service file.
|
|
|
|
Unify its default value to be under PKGLIBDIR, instead of LIBDIR/near,
which does not match the name of the project nor the daemon. This also
fixes a discrepancy between the directory encoded in the daemon and
the pkg-config file. Centralize the variable to be only set once in
configure.ac.
|
|
Expanding the value when setting it causes uninitialized values to
trickle into generated files like neard.pc, which ends up with stuff
like libdir=NONE/lib.
|
|
|
|
These have no relation, so there's no point in making one conditional
to the other.
|
|
This means the unit tests will only be built when running «make check»,
only when they will be used.
|
|
The AC_OUTPUT call with arguments is obsolete.
|
|
|
|
Do not take over the autoconf namespace, as it might stomp with macros
provided in the future.
|
|
AC_PROG_LIBTOOL is deprecated and wrongly uses the autoconf namespace,
use LT_INIT instead. As we are using LT_INIT anyway we might as well
pass the disable-static option directly to it instead of using the
AC_DISABLE_STATIC macro, which is not deprecated right now, but uses
the autoconf namespace too.
|
|
|
|
This makes the project mailing list address available to the code as
the PACKAGE_BUGREPORT macro, shows the address on «configure --help»,
and on test suite failures.
|
|
When subscribing to the D-Bus signal NameOwnerChanged from the bus driver,
specify the object path and the sender in the match rule. Otherwise, random
connections on the bus could impersonate the bus driver.
|
|
This partially reverts 510b32b7156625b9df737c916b7a7a5c6fb285b9 since it
still necessary to take a reference before calling dbus_watch_handle
since internally it can call watch_info_free as in the following trace:
Invalid read of size 8
at 0x121085: watch_func (mainloop.c:105)
by 0x4C72694: g_main_context_dispatch (gmain.c:2539)
by 0x4C729C7: g_main_context_iterate.isra.23 (gmain.c:3146)
by 0x4C72DC1: g_main_loop_run (gmain.c:3340)
by 0x120541: main (main.c:551)
Address 0x5bbcd90 is 16 bytes inside a block of size 24 free'd
at 0x4A079AE: free (vg_replace_malloc.c:427)
by 0x4C7837E: g_free (gmem.c:252)
by 0x4F708BF: dbus_watch_set_data (dbus-watch.c:614)
by 0x4F70938: _dbus_watch_unref (dbus-watch.c:132)
by 0x4F6E9A7: _dbus_transport_handle_watch (dbus-transport.c:884)
by 0x4F59AFB: _dbus_connection_handle_watch (dbus-connection.c:1497)
by 0x4F70AF9: dbus_watch_handle (dbus-watch.c:683)
by 0x121084: watch_func (mainloop.c:103)
by 0x4C72694: g_main_context_dispatch (gmain.c:2539)
by 0x4C729C7: g_main_context_iterate.isra.23 (gmain.c:3146)
by 0x4C72DC1: g_main_loop_run (gmain.c:3340)
by 0x120541: main (main.c:551)
|
|
If g_dbus_add_service_watch is called for service which bus name is
already known the following crash can happen:
invalid read of size 1
at 0x4C2A2F2: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x4E97722: g_strdup (in /usr/lib64/libglib-2.0.so.0.3800.2)
by 0x405B0C: update_name_cache (watch.c:435)
by 0x405C37: update_service (watch.c:593)
by 0x4E7A2A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2)
by 0x4E7A627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
by 0x4E7AA39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2)
by 0x4038EA: client_ready (test-gdbus-client.c:1014)
by 0x4E9E5E0: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
by 0x4E9E7A5: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
by 0x4E9EB1A: g_test_run_suite (in /usr/lib64/libglib-2.0.so.0.3800.2)
by 0x403614: main (test-gdbus-client.c:1058)
Address 0x5dbe5d0 is 0 bytes inside a block of size 7 free'd
at 0x4C28577: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x4E7FF7E: g_free (in /usr/lib64/libglib-2.0.so.0.3800.2)
by 0x405B04: update_name_cache (watch.c:434)
by 0x405C37: update_service (watch.c:593)
by 0x4E7A2A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2)
by 0x4E7A627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
by 0x4E7AA39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2)
by 0x4038EA: client_ready (test-gdbus-client.c:1014)
by 0x4E9E5E0: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
by 0x4E9E7A5: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
by 0x4E9EB1A: g_test_run_suite (in /usr/lib64/libglib-2.0.so.0.3800.2)
by 0x403614: main (test-gdbus-client.c:1058)
|
|
This actually creates a problem since the code now does flush any pending
message on the queue any signal will be send right away before the
actual reply to GetManagedObjects which will not contain those interfaces.
|
|
Refactor filter_data_remove_callback so that we do not iterate over
freed pointer.
|
|
No matter if disconnection was reported previously, g_dbus_client_unref()
was always calling service disconnect callback. This patch fix the
following scenario:
1) service disconnects from the bus
2) disconnect callback gets called
3) client calls g_dbus_client_unref(), disconnect callback is called
again.
|
|
In the current implementation, with ConstantPoll enabled, neard will
retry to poll if a DEP link gets down. This may fail, if the Adapter is
still busy in that very moment. If this happens the polling will fail
with EBUSY and ConstantPoll functionality expires.
With this patch neard checks if the Adapter was busy when the first
start polling attempt was made, and will retry polling later.
Signed-off-by: Andreas Bender <andreas.bender@hertz.st>
|
|
In NCI it is possible for the NFCC to discover multiple targets.
In that case the kernel part will send a netlink event for each
of them before sending an end of list one.
In the current implementation the connection to the target is done
before the target done event. So the first discovered target was
the one that neard tries to connect to.
This patch fixes that by enabling p2p targets before tags or SEs ones.
We probably want to connect to NFC-DEP (usualy having NFC-DEP and
ISO-DEP on the same device means that ISO-DEP is the secure element
interface).
|
|
|
|
In ISO15693, it is possible for tags that have huge memory to encode
the number of blocks on 16bits instead of 8bits.
This has to be taken into account when GET_SYSTEM_INFO is received.
|
|
Add support of READ_MULTIPLE_BLOCKS for a faster tag reading procedure.
We fall back to READ_SINGLE_BLOCK if it is not supported by the tag.
Tested on RMB supported tags and with an emulation
of a tag that do not support RMB.
|
|
On NXP DESFire tag V1, the SELECT FILEID right after
the SELECT APPNAME has to use P1 = 0 and P2 = 0
(instead of P1 = 0 and P2 = 0x0C).
|
|
No need to read the whole thing, getting the ID back is enough.
|
|
The current implementation does not handle type1 dynamic tag reads
correctly, the dynamic command size format is different as the data
field is 8 bytes long (As opposed to 1 byte for the static commands).
Also, lock and reserved TLVs are not parsed so when several commands
are needed to retrieve all chunks of memory, lock and reserved
area are also copied, building a corrupted NDEF.
This is fixed by skipping all those areas when copying the NDEF over.
|
|
seeld and snep_send were missing from the rule that generates
the header symlink farm, resulting in headers not being available
in highly parallel builds.
|
|
ExecStart was evaluating to ${libexecdir}/neard, but the binary
is installed to ${pkglibexecdir}/neard. Change the subsitition
to reflect the actual paths.
Also remove NotifyAccess, it's only used when Type=notify.
|
|
They need to be converted to freedesktop's Object Manager API. Once
that's done, se-manager-api.txt will go away.
|
|
|
|
In command INS_GET_GP_DATA, when try to get the refresh tag
value, the return value is not null, then we need to set the
resp_lenght to 0. Also the response value for get refresh tag
operation is (tag, length, value), we missed the length option
in current code.
|
|
Currently, after we get the first SE(embedded type) from kernel
through netlink, we will try to get the ace rule directly, but
we may failed to get through netlink with error, then the next
SE type will not able to be added.
|
|
Due to we use queue to save the command, the callback function will handle
the error operation, else it may lead to buffer double free.
Move the free operation of req->apdu to io_cb since the io_cb function
may be called directly in the plugin, after req struct is freed,
req->apdu will be a wild pointer.
|
|
The APDU command will be freed in send_io even when transceive fails.
|
|
in close_channel_cb, return value 0 means the success operation
when channel path is removed in hash table, __seel_channel_remove
will be called by se_channel_free.
|
|
Because we use the queue to save the io request, we need to use
the callback function to free the request structure.
|
|
We only get the modem name from the telephony GetModems interface,
but in sim_changed signal, we get the dbus path, this patch will make
them in accordance with each other.
|
|
|
|
|
|
neard and seeld have their own, different, dynamically generated builtin
header.
|
|
|
|
seeld is a secure element daemon, providing a D-Bus interface for secure
elements and their channels.
It also implements an access control enforcer (ACE) as specified by the
Global Platform.
|
|
Add support for the ISO/IEC 14443-B protocol used by Type 4B tags.
|
|
The nfctype4_check_presence() routine should select the NDEF file
instead of the NDEF Tag Application otherwise write operations may
fail. To accomplish this, store the the NDEF file ID in the tag
structure and use it when issuing the 'Select' command thats a
part of the check presence process.
|
|
Extend the Type 4 tag-specific section of the tag structure to hold
the File ID from the 'NDEF File Control TLV' portion of the Capability
Container file. Also provide accessor functions to get & set the its
value.
|
|
The current implementation of the ISO_Select() routine always sets the
P2 value for the 'Select' command to 0. However, according the the NFC
Forum, Type 4 Tag Operation Specification, the value of P2 depends on
what is being selected. The proper values from the specification are
shown below.
Target of Selection P1 P2 Spec Reference
------------------- -- -- --------------
NDEF Tag Application 0x04 0x00 Table 10
Capability Container 0x00 0x0C Table 13
NDEF File 0x00 0x0C Table 19
So, when P1 is 0x04, P2 is 0x00 and when P1 is 0x00, P2 is 0x0C. Add
this logic to the ISO_Select() routine so the proper value for P2 is
always used.
|
|
The current t4_readbin_NDEF_ID() implementation assumes that the NDEF
file length is less than or equal to the Max R-APDU Data Size. This
may not alway be true so be sure to read the lesser of the two values.
data_read_cb() will continue to read the rest of the data when the NDEF
file length is larger than the Max R-APDU Data Size.
|
|
When reading the NDEF file from the tag, the t4_readbin_NDEF_ID()
routine reads "Max R-APDU Data Size" bytes instead of the number of
bytes in the NDEF file. Fix this by reading the number of bytes in
the NDEF file which is available in the response data passed into
t4_readbin_NDEF_ID().
|
|
Clean up some parenthesis usage which won't change the order of
evaluation but makes it clearer to the reader.
|